Merge "Adjust font, color, margin, corners for all widgets tray" into sc-dev

This commit is contained in:
Steven Ng authored and Android (Google) Code Review committed 2021-03-18 10:25:00 +00:00
commit 99060b30ca
20 files changed
+234 -28

No files matched your search

+1 -1
View File
@@ -18,7 +18,7 @@
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?android:attr/textColorHint">
android:tint="?android:attr/textColorSecondary">
<path
android:fillColor="#FF000000"
android:pathData="M18.59,16.41L20,15l-8,-8 -8,8 1.41,1.41L12,9.83"/>
+1 -1
View File
@@ -18,7 +18,7 @@
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?android:attr/textColorHint">
android:tint="?android:attr/textColorSecondary">
<path
android:fillColor="#FF000000"
android:pathData="M5.41,7.59L4,9l8,8 8,-8 -1.41,-1.41L12,14.17"/>
@@ -0,0 +1,41 @@
<?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">
<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="?android:attr/colorBackground" />
<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>
@@ -0,0 +1,42 @@
<?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">
<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="?android:attr/colorBackground" />
<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>
+42
View File
@@ -0,0 +1,42 @@
<?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">
<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="?android:attr/colorBackground" />
<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>
+4 -3
View File
@@ -36,7 +36,7 @@
android:gravity="center_horizontal"
android:singleLine="true"
android:maxLines="1"
android:textColor="?android:attr/textColorSecondary"
android:textColor="?android:attr/textColorPrimary"
android:textSize="14sp" />
<!-- The original dimensions of the widget (can't be the same text as above due to different
@@ -46,7 +46,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textColor="?android:attr/textColorSecondary"
android:textColor="?android:attr/textColorTertiary"
android:textSize="14sp"
android:alpha="0.8" />
@@ -55,7 +55,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textSize="12sp"
android:textSize="14sp"
android:textColor="?android:attr/textColorTertiary"
android:maxLines="2"
android:ellipsize="end"
android:fadingEdge="horizontal" />
+1 -1
View File
@@ -25,7 +25,7 @@
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/colorPrimary"
android:background="?android:attr/colorBackgroundFloating"
android:elevation="4dp">
<TextView
@@ -25,7 +25,7 @@
android:layout_width="48dp"
android:layout_height="2dp"
android:layout_gravity="center_horizontal"
android:background="@color/popup_color_primary_dark"/>
android:background="?android:attr/textColorSecondary"/>
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
@@ -33,6 +33,7 @@
android:gravity="center_horizontal"
android:textSize="24sp"
android:layout_marginTop="16dp"
android:textColor="?android:attr/textColorSecondary"
android:text="@string/widget_button_text"/>
<include layout="@layout/widgets_search_bar"/>
</LinearLayout>
+4 -1
View File
@@ -18,7 +18,9 @@
android:id="@+id/widgets_list_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:layout_marginHorizontal="8dp"
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">
@@ -54,6 +56,7 @@
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:attr/textColorTertiary"
tools:text="m widgets, n shortcuts" />
</LinearLayout>
+2 -1
View File
@@ -19,4 +19,5 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:background="?android:attr/colorPrimaryDark" />
android:background="@drawable/widgets_list_middle_ripple"
android:layout_marginBottom="@dimen/widget_list_entry_bottom_margin"/>
+5
View File
@@ -110,7 +110,12 @@
<dimen name="widget_cell_vertical_padding">8dp</dimen>
<dimen name="widget_cell_horizontal_padding">16dp</dimen>
<dimen name="widget_list_top_bottom_corner_radius">28dp</dimen>
<dimen name="widget_list_content_corner_radius">4dp</dimen>
<dimen name="widget_list_header_view_vertical_padding">20dp</dimen>
<dimen name="widget_list_entry_bottom_margin">2dp</dimen>
<dimen name="widget_preview_shadow_blur">0.5dp</dimen>
<dimen name="widget_preview_key_shadow_distance">1dp</dimen>
@@ -34,6 +34,7 @@ import android.widget.TextView;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.R;
import com.android.launcher3.WidgetPreviewLoader;
import com.android.launcher3.icons.BitmapInfo;
import com.android.launcher3.icons.ComponentWithLabel;
import com.android.launcher3.icons.IconCache;
@@ -78,6 +79,8 @@ public final class WidgetsListHeaderViewHolderBinderTest {
@Mock
private DeviceProfile mDeviceProfile;
@Mock
private WidgetPreviewLoader mWidgetPreviewLoader;
@Mock
private OnHeaderClickListener mOnHeaderClickListener;
@Before
@@ -97,8 +100,14 @@ public final class WidgetsListHeaderViewHolderBinderTest {
return componentWithLabel.getComponent().getShortClassName();
}).when(mIconCache).getTitleNoCache(any());
WidgetsListAdapter widgetsListAdapter = new WidgetsListAdapter(mContext,
LayoutInflater.from(mTestActivity),
mWidgetPreviewLoader,
mIconCache,
/* iconClickListener= */ view -> {},
/* iconLongClickListener= */ view -> false);
mViewHolderBinder = new WidgetsListHeaderViewHolderBinder(
LayoutInflater.from(mTestActivity), mOnHeaderClickListener);
LayoutInflater.from(mTestActivity), mOnHeaderClickListener, widgetsListAdapter);
}
@After
@@ -115,7 +124,7 @@ public final class WidgetsListHeaderViewHolderBinderTest {
APP_NAME,
TEST_PACKAGE,
/* numOfWidgets= */ 3);
mViewHolderBinder.bindViewHolder(viewHolder, entry);
mViewHolderBinder.bindViewHolder(viewHolder, entry, /* position= */ 0);
TextView appTitle = widgetsListHeader.findViewById(R.id.app_title);
TextView appSubtitle = widgetsListHeader.findViewById(R.id.app_subtitle);
@@ -133,7 +142,7 @@ public final class WidgetsListHeaderViewHolderBinderTest {
TEST_PACKAGE,
/* numOfWidgets= */ 3);
mViewHolderBinder.bindViewHolder(viewHolder, entry);
mViewHolderBinder.bindViewHolder(viewHolder, entry, /* position= */ 0);
widgetsListHeader.callOnClick();
verify(mOnHeaderClickListener).onHeaderClicked(eq(true),
@@ -34,6 +34,7 @@ import android.widget.TextView;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.R;
import com.android.launcher3.WidgetPreviewLoader;
import com.android.launcher3.icons.BitmapInfo;
import com.android.launcher3.icons.ComponentWithLabel;
import com.android.launcher3.icons.IconCache;
@@ -78,6 +79,8 @@ public final class WidgetsListSearchHeaderViewHolderBinderTest {
@Mock
private DeviceProfile mDeviceProfile;
@Mock
private WidgetPreviewLoader mWidgetPreviewLoader;
@Mock
private OnHeaderClickListener mOnHeaderClickListener;
@Before
@@ -97,8 +100,14 @@ public final class WidgetsListSearchHeaderViewHolderBinderTest {
return componentWithLabel.getComponent().getShortClassName();
}).when(mIconCache).getTitleNoCache(any());
WidgetsListAdapter widgetsListAdapter = new WidgetsListAdapter(mContext,
LayoutInflater.from(mTestActivity),
mWidgetPreviewLoader,
mIconCache,
/* iconClickListener= */ view -> {},
/* iconLongClickListener= */ view -> false);
mViewHolderBinder = new WidgetsListSearchHeaderViewHolderBinder(
LayoutInflater.from(mTestActivity), mOnHeaderClickListener);
LayoutInflater.from(mTestActivity), mOnHeaderClickListener, widgetsListAdapter);
}
@After
@@ -115,7 +124,7 @@ public final class WidgetsListSearchHeaderViewHolderBinderTest {
APP_NAME,
TEST_PACKAGE,
/* numOfWidgets= */ 3);
mViewHolderBinder.bindViewHolder(viewHolder, entry);
mViewHolderBinder.bindViewHolder(viewHolder, entry, /* position= */ 0);
TextView appTitle = widgetsListHeader.findViewById(R.id.app_title);
TextView appSubtitle = widgetsListHeader.findViewById(R.id.app_subtitle);
@@ -134,7 +143,7 @@ public final class WidgetsListSearchHeaderViewHolderBinderTest {
TEST_PACKAGE,
/* numOfWidgets= */ 3);
mViewHolderBinder.bindViewHolder(viewHolder, entry);
mViewHolderBinder.bindViewHolder(viewHolder, entry, /* position= */ 0);
widgetsListHeader.callOnClick();
verify(mOnHeaderClickListener).onHeaderClicked(eq(true),
@@ -106,12 +106,19 @@ public final class WidgetsListTableViewHolderBinderTest {
return componentWithLabel.getComponent().getShortClassName();
}).when(mIconCache).getTitleNoCache(any());
WidgetsListAdapter widgetsListAdapter = new WidgetsListAdapter(mContext,
LayoutInflater.from(mTestActivity),
mWidgetPreviewLoader,
mIconCache,
/* iconClickListener= */ view -> {},
/* iconLongClickListener= */ view -> false);
mViewHolderBinder = new WidgetsListTableViewHolderBinder(
mContext,
LayoutInflater.from(mTestActivity),
mOnIconClickListener,
mOnLongClickListener,
mWidgetPreviewLoader);
mWidgetPreviewLoader,
widgetsListAdapter);
}
@After
@@ -127,7 +134,7 @@ public final class WidgetsListTableViewHolderBinderTest {
APP_NAME,
TEST_PACKAGE,
/* numOfWidgets= */ 3);
mViewHolderBinder.bindViewHolder(viewHolder, entry);
mViewHolderBinder.bindViewHolder(viewHolder, entry, /* position= */ 0);
shadowOf(getMainLooper()).idle();
// THEN the table container has one row, which contains 3 widgets.
@@ -33,7 +33,7 @@ public interface ViewHolderBinder<T, V extends ViewHolder> {
V newViewHolder(ViewGroup parent);
/** Populate UI references in {@link ViewHolder} with data. */
void bindViewHolder(V viewHolder, T data);
void bindViewHolder(V viewHolder, T data, int position);
/**
* Called when the view is recycled. Views are recycled in batches once they are sufficiently
@@ -89,16 +89,17 @@ public class WidgetsListAdapter extends Adapter<ViewHolder> implements OnHeaderC
OnClickListener iconClickListener, OnLongClickListener iconLongClickListener) {
mDiffReporter = new WidgetsDiffReporter(iconCache, this);
mWidgetsListTableViewHolderBinder = new WidgetsListTableViewHolderBinder(context,
layoutInflater, iconClickListener, iconLongClickListener, widgetPreviewLoader);
layoutInflater, iconClickListener, iconLongClickListener,
widgetPreviewLoader, /* listAdapter= */ this);
mViewHolderBinders.put(VIEW_TYPE_WIDGETS_LIST, mWidgetsListTableViewHolderBinder);
mViewHolderBinders.put(
VIEW_TYPE_WIDGETS_HEADER,
new WidgetsListHeaderViewHolderBinder(
layoutInflater, /*onHeaderClickListener=*/this));
layoutInflater, /* onHeaderClickListener= */this, /* listAdapter= */ this));
mViewHolderBinders.put(
VIEW_TYPE_WIDGETS_SEARCH_HEADER,
new WidgetsListSearchHeaderViewHolderBinder(
layoutInflater, /*onHeaderClickListener=*/ this));
layoutInflater, /*onHeaderClickListener=*/ this, /* listAdapter= */ this));
}
public void setFilter(Predicate<WidgetsListBaseEntry> filter) {
@@ -178,7 +179,7 @@ public class WidgetsListAdapter extends Adapter<ViewHolder> implements OnHeaderC
@Override
public void onBindViewHolder(ViewHolder holder, int pos) {
ViewHolderBinder viewHolderBinder = mViewHolderBinders.get(getItemViewType(pos));
viewHolderBinder.bindViewHolder(holder, mVisibleEntries.get(pos));
viewHolderBinder.bindViewHolder(holder, mVisibleEntries.get(pos), pos);
}
@Override
@@ -29,6 +29,7 @@ import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
import androidx.recyclerview.widget.RecyclerView;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.FastBitmapDrawable;
@@ -58,6 +59,7 @@ public final class WidgetsListHeader extends LinearLayout implements ItemInfoUpd
@Nullable private HandlerRunnable mIconLoadRequest;
@Nullable private Drawable mIconDrawable;
private final int mIconSize;
private final int mBottomMarginSize;
private ImageView mAppIcon;
private TextView mTitle;
@@ -83,6 +85,8 @@ public final class WidgetsListHeader extends LinearLayout implements ItemInfoUpd
R.styleable.WidgetsListRowHeader, defStyleAttr, /* defStyleRes= */ 0);
mIconSize = a.getDimensionPixelSize(R.styleable.WidgetsListRowHeader_appIconSize,
grid.iconSizePx);
mBottomMarginSize =
getResources().getDimensionPixelSize(R.dimen.widget_list_entry_bottom_margin);
}
@Override
@@ -113,6 +117,13 @@ public final class WidgetsListHeader extends LinearLayout implements ItemInfoUpd
public void setExpanded(boolean isExpanded) {
this.mIsExpanded = isExpanded;
mExpandToggle.setChecked(isExpanded);
if (getLayoutParams() instanceof RecyclerView.LayoutParams) {
int bottomMargin = isExpanded ? 0 : mBottomMarginSize;
RecyclerView.LayoutParams layoutParams =
((RecyclerView.LayoutParams) getLayoutParams());
layoutParams.bottomMargin = bottomMargin;
setLayoutParams(layoutParams);
}
}
/** Apply app icon, labels and tag using a generic {@link WidgetsListHeaderEntry}. */
@@ -30,11 +30,14 @@ public final class WidgetsListHeaderViewHolderBinder implements
ViewHolderBinder<WidgetsListHeaderEntry, WidgetsListHeaderHolder> {
private final LayoutInflater mLayoutInflater;
private final OnHeaderClickListener mOnHeaderClickListener;
private final WidgetsListAdapter mWidgetsListAdapter;
public WidgetsListHeaderViewHolderBinder(LayoutInflater layoutInflater,
OnHeaderClickListener onHeaderClickListener) {
OnHeaderClickListener onHeaderClickListener,
WidgetsListAdapter listAdapter) {
mLayoutInflater = layoutInflater;
mOnHeaderClickListener = onHeaderClickListener;
mWidgetsListAdapter = listAdapter;
}
@Override
@@ -46,8 +49,16 @@ public final class WidgetsListHeaderViewHolderBinder implements
}
@Override
public void bindViewHolder(WidgetsListHeaderHolder viewHolder, WidgetsListHeaderEntry data) {
public void bindViewHolder(WidgetsListHeaderHolder viewHolder, WidgetsListHeaderEntry data,
int position) {
WidgetsListHeader widgetsListHeader = viewHolder.mWidgetsListHeader;
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.applyFromItemInfoWithIcon(data);
widgetsListHeader.setExpanded(data.isWidgetListShown());
widgetsListHeader.setOnExpandChangeListener(isExpanded ->
@@ -31,11 +31,14 @@ public final class WidgetsListSearchHeaderViewHolderBinder implements
ViewHolderBinder<WidgetsListSearchHeaderEntry, WidgetsListSearchHeaderHolder> {
private final LayoutInflater mLayoutInflater;
private final OnHeaderClickListener mOnHeaderClickListener;
private final WidgetsListAdapter mWidgetsListAdapter;
public WidgetsListSearchHeaderViewHolderBinder(LayoutInflater layoutInflater,
OnHeaderClickListener onHeaderClickListener) {
OnHeaderClickListener onHeaderClickListener,
WidgetsListAdapter listAdapter) {
mLayoutInflater = layoutInflater;
mOnHeaderClickListener = onHeaderClickListener;
mWidgetsListAdapter = listAdapter;
}
@Override
@@ -48,8 +51,15 @@ public final class WidgetsListSearchHeaderViewHolderBinder implements
@Override
public void bindViewHolder(WidgetsListSearchHeaderHolder viewHolder,
WidgetsListSearchHeaderEntry data) {
WidgetsListSearchHeaderEntry data, int position) {
WidgetsListHeader widgetsListHeader = viewHolder.mWidgetsListHeader;
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.applyFromItemInfoWithIcon(data);
widgetsListHeader.setExpanded(data.isWidgetListShown());
widgetsListHeader.setOnExpandChangeListener(isExpanded ->
@@ -52,6 +52,7 @@ public final class WidgetsListTableViewHolderBinder
private final OnClickListener mIconClickListener;
private final OnLongClickListener mIconLongClickListener;
private final WidgetPreviewLoader mWidgetPreviewLoader;
private final WidgetsListAdapter mWidgetsListAdapter;
private boolean mApplyBitmapDeferred = false;
public WidgetsListTableViewHolderBinder(
@@ -59,12 +60,14 @@ public final class WidgetsListTableViewHolderBinder
LayoutInflater layoutInflater,
OnClickListener iconClickListener,
OnLongClickListener iconLongClickListener,
WidgetPreviewLoader widgetPreviewLoader) {
WidgetPreviewLoader widgetPreviewLoader,
WidgetsListAdapter listAdapter) {
mLayoutInflater = layoutInflater;
mIndent = context.getResources().getDimensionPixelSize(R.dimen.widget_section_indent);
mIconClickListener = iconClickListener;
mIconLongClickListener = iconLongClickListener;
mWidgetPreviewLoader = widgetPreviewLoader;
mWidgetsListAdapter = listAdapter;
}
/**
@@ -97,13 +100,22 @@ public final class WidgetsListTableViewHolderBinder
}
@Override
public void bindViewHolder(WidgetsRowViewHolder holder, WidgetsListContentEntry entry) {
public void bindViewHolder(WidgetsRowViewHolder holder, WidgetsListContentEntry entry,
int position) {
TableLayout table = holder.mTableContainer;
if (DEBUG) {
Log.d(TAG, String.format("onBindViewHolder [widget#=%d, table.getChildCount=%d]",
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);
}
List<ArrayList<WidgetItem>> widgetItemsTable =
WidgetsTableUtils.groupWidgetItemsIntoTable(entry.mWidgets, mMaxSpansPerRow);
recycleTableBeforeBinding(table, widgetItemsTable);