Snap for 7430111 from 9ab4b3d2d9 to tm-release
Change-Id: Ieffc921af9e5b304ca649027ec79e26f94ae0e82
This commit is contained in:
commit
a85c4dd636
14 files changed
+133
-208
No files matched your search
@@ -350,8 +350,7 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> {
|
||||
public void startHome() {
|
||||
if (LIVE_TILE.get()) {
|
||||
RecentsView recentsView = getOverviewPanel();
|
||||
recentsView.switchToScreenshot(() -> recentsView.finishRecentsAnimation(true,
|
||||
this::startHomeInternal));
|
||||
recentsView.switchToScreenshotAndFinishAnimationToRecents(this::startHomeInternal);
|
||||
} else {
|
||||
startHomeInternal();
|
||||
}
|
||||
|
||||
@@ -176,6 +176,10 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
TaskThumbnailCache.HighResLoadingState.HighResLoadingStateChangedCallback,
|
||||
TaskVisualsChangeListener, SplitScreenBounds.OnChangeListener {
|
||||
|
||||
// TODO(b/184899234): We use this timeout to wait a fixed period after switching to the
|
||||
// screenshot when dismissing the current live task to ensure the app can try and get stopped.
|
||||
private static final int REMOVE_TASK_WAIT_FOR_APP_STOP_MS = 100;
|
||||
|
||||
public static final FloatProperty<RecentsView> CONTENT_ALPHA =
|
||||
new FloatProperty<RecentsView>("contentAlpha") {
|
||||
@Override
|
||||
@@ -2423,8 +2427,11 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
if (success) {
|
||||
if (shouldRemoveTask) {
|
||||
if (dismissedTaskView.getTask() != null) {
|
||||
UI_HELPER_EXECUTOR.execute(() -> ActivityManagerWrapper.getInstance()
|
||||
.removeTask(dismissedTaskId));
|
||||
switchToScreenshotAndFinishAnimationToRecents(() -> {
|
||||
UI_HELPER_EXECUTOR.getHandler().postDelayed(() ->
|
||||
ActivityManagerWrapper.getInstance().removeTask(
|
||||
dismissedTaskId), REMOVE_TASK_WAIT_FOR_APP_STOP_MS);
|
||||
});
|
||||
mActivity.getStatsLogManager().logger()
|
||||
.withItemInfo(dismissedTaskView.getItemInfo())
|
||||
.log(LAUNCHER_TASK_DISMISS_SWIPE_UP);
|
||||
@@ -2529,10 +2536,13 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
mPendingAnimation.addEndListener(isSuccess -> {
|
||||
if (isSuccess) {
|
||||
// Remove all the task views now
|
||||
UI_HELPER_EXECUTOR.execute(
|
||||
ActivityManagerWrapper.getInstance()::removeAllRecentTasks);
|
||||
removeTasksViewsAndClearAllButton();
|
||||
startHome();
|
||||
switchToScreenshotAndFinishAnimationToRecents(() -> {
|
||||
UI_HELPER_EXECUTOR.getHandler().postDelayed(
|
||||
ActivityManagerWrapper.getInstance()::removeAllRecentTasks,
|
||||
REMOVE_TASK_WAIT_FOR_APP_STOP_MS);
|
||||
removeTasksViewsAndClearAllButton();
|
||||
startHome();
|
||||
});
|
||||
}
|
||||
mPendingAnimation = null;
|
||||
});
|
||||
@@ -2687,9 +2697,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
protected void onConfigurationChanged(Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
if (LIVE_TILE.get() && mEnableDrawingLiveTile && newConfig.orientation != mOrientation) {
|
||||
switchToScreenshot(
|
||||
() -> finishRecentsAnimation(true /* toRecents */,
|
||||
this::updateRecentsRotation));
|
||||
switchToScreenshotAndFinishAnimationToRecents(this::updateRecentsRotation);
|
||||
mEnableDrawingLiveTile = false;
|
||||
} else {
|
||||
updateRecentsRotation();
|
||||
@@ -3687,6 +3695,10 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
}
|
||||
}
|
||||
|
||||
public void switchToScreenshotAndFinishAnimationToRecents(Runnable onFinishRunnable) {
|
||||
switchToScreenshot(() -> finishRecentsAnimation(true /* toRecents */, onFinishRunnable));
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch the current running task view to static snapshot mode,
|
||||
* capturing the snapshot at the same time.
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
**
|
||||
** Copyright 2021, The Android Open Source Project
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
*/
|
||||
-->
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?android:attr/colorControlHighlight">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/surface" />
|
||||
<corners
|
||||
android:topLeftRadius="@dimen/widget_list_content_corner_radius"
|
||||
android:topRightRadius="@dimen/widget_list_content_corner_radius"
|
||||
android:bottomLeftRadius="@dimen/widget_list_top_bottom_corner_radius"
|
||||
android:bottomRightRadius="@dimen/widget_list_top_bottom_corner_radius" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:id="@android:id/background">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/surface" />
|
||||
<corners
|
||||
android:topLeftRadius="@dimen/widget_list_content_corner_radius"
|
||||
android:topRightRadius="@dimen/widget_list_content_corner_radius"
|
||||
android:bottomLeftRadius="@dimen/widget_list_top_bottom_corner_radius"
|
||||
android:bottomRightRadius="@dimen/widget_list_top_bottom_corner_radius" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
@@ -1,43 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
**
|
||||
** Copyright 2021, The Android Open Source Project
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
*/
|
||||
-->
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?android:attr/colorControlHighlight">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/surface" />
|
||||
<corners
|
||||
android:topLeftRadius="@dimen/widget_list_content_corner_radius"
|
||||
android:topRightRadius="@dimen/widget_list_content_corner_radius"
|
||||
android:bottomLeftRadius="@dimen/widget_list_content_corner_radius"
|
||||
android:bottomRightRadius="@dimen/widget_list_content_corner_radius" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:id="@android:id/background">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/surface" />
|
||||
<corners
|
||||
android:topLeftRadius="@dimen/widget_list_content_corner_radius"
|
||||
android:topRightRadius="@dimen/widget_list_content_corner_radius"
|
||||
android:bottomLeftRadius="@dimen/widget_list_content_corner_radius"
|
||||
android:bottomRightRadius="@dimen/widget_list_content_corner_radius" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
@@ -1,42 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
**
|
||||
** Copyright 2021, The Android Open Source Project
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
*/
|
||||
-->
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?android:attr/colorControlHighlight">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/surface" />
|
||||
<corners
|
||||
android:topLeftRadius="@dimen/widget_list_top_bottom_corner_radius"
|
||||
android:topRightRadius="@dimen/widget_list_top_bottom_corner_radius"
|
||||
android:bottomLeftRadius="@dimen/widget_list_top_bottom_corner_radius"
|
||||
android:bottomRightRadius="@dimen/widget_list_top_bottom_corner_radius" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:id="@android:id/background">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/surface" />
|
||||
<corners
|
||||
android:topLeftRadius="@dimen/widget_list_top_bottom_corner_radius"
|
||||
android:topRightRadius="@dimen/widget_list_top_bottom_corner_radius"
|
||||
android:bottomLeftRadius="@dimen/widget_list_top_bottom_corner_radius"
|
||||
android:bottomRightRadius="@dimen/widget_list_top_bottom_corner_radius" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
@@ -1,43 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
**
|
||||
** Copyright 2021, The Android Open Source Project
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
*/
|
||||
-->
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?android:attr/colorControlHighlight">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/surface" />
|
||||
<corners
|
||||
android:topLeftRadius="@dimen/widget_list_top_bottom_corner_radius"
|
||||
android:topRightRadius="@dimen/widget_list_top_bottom_corner_radius"
|
||||
android:bottomLeftRadius="@dimen/widget_list_content_corner_radius"
|
||||
android:bottomRightRadius="@dimen/widget_list_content_corner_radius" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:id="@android:id/background">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/surface" />
|
||||
<corners
|
||||
android:topLeftRadius="@dimen/widget_list_top_bottom_corner_radius"
|
||||
android:topRightRadius="@dimen/widget_list_top_bottom_corner_radius"
|
||||
android:bottomLeftRadius="@dimen/widget_list_content_corner_radius"
|
||||
android:bottomRightRadius="@dimen/widget_list_content_corner_radius" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
@@ -20,7 +20,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:background="@drawable/widgets_list_middle_ripple"
|
||||
android:layout_marginBottom="@dimen/widget_list_entry_bottom_margin"
|
||||
android:paddingVertical="@dimen/widget_list_header_view_vertical_padding"
|
||||
android:orientation="horizontal"
|
||||
|
||||
@@ -19,5 +19,4 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:background="@drawable/widgets_list_middle_ripple"
|
||||
android:layout_marginBottom="@dimen/widget_list_entry_bottom_margin"/>
|
||||
@@ -131,6 +131,7 @@
|
||||
|
||||
<dimen name="widget_list_top_bottom_corner_radius">28dp</dimen>
|
||||
<dimen name="widget_list_content_corner_radius">4dp</dimen>
|
||||
<dimen name="widget_list_content_joined_corner_radius">0dp</dimen>
|
||||
|
||||
<dimen name="widget_list_header_view_vertical_padding">20dp</dimen>
|
||||
<dimen name="widget_list_entry_bottom_margin">2dp</dimen>
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (C) 2021 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.launcher3.widget.picker;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.graphics.drawable.RippleDrawable;
|
||||
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.util.Themes;
|
||||
|
||||
/** Helper class for creating drawables to use as background for list elements. */
|
||||
final class WidgetsListDrawables {
|
||||
|
||||
private WidgetsListDrawables() {}
|
||||
|
||||
/** Creates a list background drawable with the specified radii. */
|
||||
static Drawable createListBackgroundDrawable(
|
||||
Context context,
|
||||
float topRadius,
|
||||
float bottomRadius) {
|
||||
GradientDrawable backgroundMask = new GradientDrawable();
|
||||
backgroundMask.setColor(context.getColorStateList(R.color.surface));
|
||||
backgroundMask.setShape(GradientDrawable.RECTANGLE);
|
||||
|
||||
backgroundMask.setCornerRadii(
|
||||
new float[]{
|
||||
topRadius,
|
||||
topRadius,
|
||||
topRadius,
|
||||
topRadius,
|
||||
bottomRadius,
|
||||
bottomRadius,
|
||||
bottomRadius,
|
||||
bottomRadius
|
||||
});
|
||||
|
||||
return new RippleDrawable(
|
||||
/* color= */ ColorStateList.valueOf(
|
||||
Themes.getAttrColor(context, android.R.attr.colorControlHighlight)),
|
||||
/* content= */ backgroundMask,
|
||||
/* mask= */ backgroundMask);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -60,6 +60,9 @@ public final class WidgetsListHeader extends LinearLayout implements ItemInfoUpd
|
||||
@Nullable private Drawable mIconDrawable;
|
||||
private final int mIconSize;
|
||||
private final int mBottomMarginSize;
|
||||
private final float mTopBottomCornerRadius;
|
||||
private final float mMiddleCornerRadius;
|
||||
private final float mJoinedCornerRadius;
|
||||
|
||||
private ImageView mAppIcon;
|
||||
private TextView mTitle;
|
||||
@@ -87,6 +90,12 @@ public final class WidgetsListHeader extends LinearLayout implements ItemInfoUpd
|
||||
grid.iconSizePx);
|
||||
mBottomMarginSize =
|
||||
getResources().getDimensionPixelSize(R.dimen.widget_list_entry_bottom_margin);
|
||||
mTopBottomCornerRadius =
|
||||
getResources().getDimension(R.dimen.widget_list_top_bottom_corner_radius);
|
||||
mMiddleCornerRadius =
|
||||
getResources().getDimension(R.dimen.widget_list_content_corner_radius);
|
||||
mJoinedCornerRadius =
|
||||
getResources().getDimension(R.dimen.widget_list_content_joined_corner_radius);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -254,6 +263,20 @@ public final class WidgetsListHeader extends LinearLayout implements ItemInfoUpd
|
||||
verifyHighRes();
|
||||
}
|
||||
|
||||
/** Updates the list to have a background drawable with the appropriate corner radii. */
|
||||
@UiThread
|
||||
public void updateListBackground(boolean isFirst, boolean isLast, boolean isExpanded) {
|
||||
float topRadius = isFirst ? mTopBottomCornerRadius : mMiddleCornerRadius;
|
||||
float bottomRadius = isLast
|
||||
? mTopBottomCornerRadius
|
||||
: isExpanded
|
||||
? mJoinedCornerRadius
|
||||
: mMiddleCornerRadius;
|
||||
setBackground(
|
||||
WidgetsListDrawables.createListBackgroundDrawable(
|
||||
getContext(), topRadius, bottomRadius));
|
||||
}
|
||||
|
||||
private void setTitles(WidgetsListSearchHeaderEntry entry) {
|
||||
mTitle.setText(entry.mPkgItem.title);
|
||||
|
||||
|
||||
@@ -52,15 +52,10 @@ public final class WidgetsListHeaderViewHolderBinder implements
|
||||
public void bindViewHolder(WidgetsListHeaderHolder viewHolder, WidgetsListHeaderEntry data,
|
||||
int position) {
|
||||
WidgetsListHeader widgetsListHeader = viewHolder.mWidgetsListHeader;
|
||||
if (mWidgetsListAdapter.getItemCount() == 1) {
|
||||
widgetsListHeader.setBackgroundResource(R.drawable.widgets_list_single_item_ripple);
|
||||
} else if (position == 0) {
|
||||
widgetsListHeader.setBackgroundResource(R.drawable.widgets_list_top_ripple);
|
||||
} else if (position == mWidgetsListAdapter.getItemCount() - 1) {
|
||||
widgetsListHeader.setBackgroundResource(R.drawable.widgets_list_bottom_ripple);
|
||||
} else {
|
||||
widgetsListHeader.setBackgroundResource(R.drawable.widgets_list_middle_ripple);
|
||||
}
|
||||
widgetsListHeader.updateListBackground(
|
||||
/* isFirst= */ position == 0,
|
||||
/* isLast= */ position == mWidgetsListAdapter.getItemCount() - 1,
|
||||
/* isExpanded= */ data.isWidgetListShown());
|
||||
widgetsListHeader.applyFromItemInfoWithIcon(data);
|
||||
widgetsListHeader.setExpanded(data.isWidgetListShown());
|
||||
widgetsListHeader.setOnExpandChangeListener(isExpanded ->
|
||||
|
||||
+4
-9
@@ -53,15 +53,10 @@ public final class WidgetsListSearchHeaderViewHolderBinder implements
|
||||
public void bindViewHolder(WidgetsListSearchHeaderHolder viewHolder,
|
||||
WidgetsListSearchHeaderEntry data, int position) {
|
||||
WidgetsListHeader widgetsListHeader = viewHolder.mWidgetsListHeader;
|
||||
if (mWidgetsListAdapter.getItemCount() == 1) {
|
||||
widgetsListHeader.setBackgroundResource(R.drawable.widgets_list_single_item_ripple);
|
||||
} else if (position == 0) {
|
||||
widgetsListHeader.setBackgroundResource(R.drawable.widgets_list_top_ripple);
|
||||
} else if (position == mWidgetsListAdapter.getItemCount() - 1) {
|
||||
widgetsListHeader.setBackgroundResource(R.drawable.widgets_list_bottom_ripple);
|
||||
} else {
|
||||
widgetsListHeader.setBackgroundResource(R.drawable.widgets_list_middle_ripple);
|
||||
}
|
||||
widgetsListHeader.updateListBackground(
|
||||
/* isFirst= */ position == 0,
|
||||
/* isLast= */ position == mWidgetsListAdapter.getItemCount() - 1,
|
||||
/* isExpanded= */ data.isWidgetListShown());
|
||||
widgetsListHeader.applyFromItemInfoWithIcon(data);
|
||||
widgetsListHeader.setExpanded(data.isWidgetListShown());
|
||||
widgetsListHeader.setOnExpandChangeListener(isExpanded ->
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
package com.android.launcher3.widget.picker;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -51,6 +52,9 @@ public final class WidgetsListTableViewHolderBinder
|
||||
private final OnLongClickListener mIconLongClickListener;
|
||||
private final WidgetPreviewLoader mWidgetPreviewLoader;
|
||||
private final WidgetsListAdapter mWidgetsListAdapter;
|
||||
private final float mTopBottomCornerRadius;
|
||||
private final float mMiddleCornerRadius;
|
||||
private final float mJoinedCornerRadius;
|
||||
private boolean mApplyBitmapDeferred = false;
|
||||
|
||||
public WidgetsListTableViewHolderBinder(
|
||||
@@ -65,6 +69,13 @@ public final class WidgetsListTableViewHolderBinder
|
||||
mIconLongClickListener = iconLongClickListener;
|
||||
mWidgetPreviewLoader = widgetPreviewLoader;
|
||||
mWidgetsListAdapter = listAdapter;
|
||||
Resources resources = context.getResources();
|
||||
mTopBottomCornerRadius =
|
||||
resources.getDimension(R.dimen.widget_list_top_bottom_corner_radius);
|
||||
mMiddleCornerRadius =
|
||||
resources.getDimension(R.dimen.widget_list_content_corner_radius);
|
||||
mJoinedCornerRadius =
|
||||
resources.getDimension(R.dimen.widget_list_content_joined_corner_radius);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -100,13 +111,14 @@ public final class WidgetsListTableViewHolderBinder
|
||||
entry.mWidgets.size(), table.getChildCount()));
|
||||
}
|
||||
|
||||
if (position == mWidgetsListAdapter.getItemCount() - 1) {
|
||||
table.setBackgroundResource(R.drawable.widgets_list_bottom_ripple);
|
||||
} else {
|
||||
// WidgetsListContentEntry is never shown in position 0. There must be a header above
|
||||
// it.
|
||||
table.setBackgroundResource(R.drawable.widgets_list_middle_ripple);
|
||||
}
|
||||
// The content is always joined to an expanded header above.
|
||||
float topRadius = mJoinedCornerRadius;
|
||||
float bottomRadius = position == mWidgetsListAdapter.getItemCount() - 1
|
||||
? mTopBottomCornerRadius
|
||||
: mMiddleCornerRadius;
|
||||
table.setBackgroundDrawable(
|
||||
WidgetsListDrawables.createListBackgroundDrawable(
|
||||
holder.itemView.getContext(), topRadius, bottomRadius));
|
||||
|
||||
List<ArrayList<WidgetItem>> widgetItemsTable =
|
||||
WidgetsTableUtils.groupWidgetItemsIntoTable(entry.mWidgets, mMaxSpansPerRow);
|
||||
|
||||
Reference in new issue
Block a user