Merge "Remove some dead code"
This commit is contained in:
committed by
Android (Google) Code Review
commit
edaf453a33
@@ -293,10 +293,6 @@ public class DashboardAdapter extends RecyclerView.Adapter<DashboardAdapter.Dash
|
||||
case R.layout.dashboard_header_spacer:
|
||||
onBindHeaderSpacer(holder, position);
|
||||
break;
|
||||
case R.layout.dashboard_category:
|
||||
onBindCategory(holder,
|
||||
(DashboardCategory) mDashboardData.getItemEntityByPosition(position));
|
||||
break;
|
||||
case R.layout.dashboard_tile:
|
||||
final Tile tile = (Tile) mDashboardData.getItemEntityByPosition(position);
|
||||
onBindTile(holder, tile);
|
||||
|
@@ -18,7 +18,6 @@ package com.android.settings.dashboard;
|
||||
import android.annotation.IntDef;
|
||||
import android.graphics.drawable.Icon;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.annotation.VisibleForTesting;
|
||||
import android.support.v7.util.DiffUtil;
|
||||
import android.text.TextUtils;
|
||||
|
||||
@@ -272,8 +271,7 @@ public class DashboardData {
|
||||
tile.remoteViews != null
|
||||
? R.layout.suggestion_tile_card
|
||||
: R.layout.suggestion_tile,
|
||||
Objects.hash(tile.title),
|
||||
false));
|
||||
Objects.hash(tile.title)));
|
||||
}
|
||||
mId++;
|
||||
}
|
||||
@@ -358,8 +356,6 @@ public class DashboardData {
|
||||
resetCount();
|
||||
for (int i = 0; mCategories != null && i < mCategories.size(); i++) {
|
||||
DashboardCategory category = mCategories.get(i);
|
||||
countItem(category, R.layout.dashboard_category,
|
||||
!TextUtils.isEmpty(category.title), NS_ITEMS);
|
||||
for (int j = 0; j < category.tiles.size(); j++) {
|
||||
Tile tile = category.tiles.get(j);
|
||||
countItem(tile, R.layout.dashboard_tile, true, NS_ITEMS);
|
||||
@@ -534,7 +530,6 @@ public class DashboardData {
|
||||
*/
|
||||
private static class Item {
|
||||
// valid types in field type
|
||||
private static final int TYPE_DASHBOARD_CATEGORY = R.layout.dashboard_category;
|
||||
private static final int TYPE_DASHBOARD_TILE = R.layout.dashboard_tile;
|
||||
@Deprecated
|
||||
private static final int TYPE_SUGGESTION_HEADER = R.layout.suggestion_header;
|
||||
@@ -550,7 +545,7 @@ public class DashboardData {
|
||||
R.layout.suggestion_condition_footer;
|
||||
private static final int TYPE_DASHBOARD_SPACER = R.layout.dashboard_spacer;
|
||||
|
||||
@IntDef({TYPE_DASHBOARD_CATEGORY, TYPE_DASHBOARD_TILE, TYPE_SUGGESTION_HEADER,
|
||||
@IntDef({TYPE_DASHBOARD_TILE, TYPE_SUGGESTION_HEADER,
|
||||
TYPE_SUGGESTION_TILE, TYPE_SUGGESTION_CONDITION_CONTAINER,
|
||||
TYPE_SUGGESTION_CONDITION_HEADER, TYPE_CONDITION_CARD,
|
||||
TYPE_SUGGESTION_CONDITION_FOOTER, TYPE_DASHBOARD_SPACER})
|
||||
@@ -558,8 +553,8 @@ public class DashboardData {
|
||||
public @interface ItemTypes{}
|
||||
|
||||
/**
|
||||
* The main data object in item, usually is a {@link Tile}, {@link Condition} or
|
||||
* {@link DashboardCategory} object. This object can also be null when the
|
||||
* The main data object in item, usually is a {@link Tile}, {@link Condition}
|
||||
* object. This object can also be null when the
|
||||
* item is an divider line. Please refer to {@link #buildItemsData()} for
|
||||
* detail usage of the Item.
|
||||
*/
|
||||
@@ -615,10 +610,6 @@ public class DashboardData {
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case TYPE_DASHBOARD_CATEGORY:
|
||||
// Only check title for dashboard category
|
||||
return TextUtils.equals(((DashboardCategory) entity).title,
|
||||
((DashboardCategory) targetItem.entity).title);
|
||||
case TYPE_DASHBOARD_TILE:
|
||||
final Tile localTile = (Tile) entity;
|
||||
final Tile targetTile = (Tile) targetItem.entity;
|
||||
|
@@ -23,6 +23,7 @@ import android.support.v7.widget.RecyclerView.State;
|
||||
import android.support.v7.widget.RecyclerView.ViewHolder;
|
||||
import android.util.TypedValue;
|
||||
import android.view.View;
|
||||
|
||||
import com.android.settings.R;
|
||||
|
||||
public class DashboardDecorator extends RecyclerView.ItemDecoration {
|
||||
@@ -43,12 +44,7 @@ public class DashboardDecorator extends RecyclerView.ItemDecoration {
|
||||
for (int i = 1; i < childCount; i++) {
|
||||
final View child = parent.getChildAt(i);
|
||||
final ViewHolder holder = parent.getChildViewHolder(child);
|
||||
if (holder.getItemViewType() == R.layout.dashboard_category) {
|
||||
if (parent.getChildViewHolder(parent.getChildAt(i - 1)).getItemViewType()
|
||||
!= R.layout.dashboard_tile) {
|
||||
continue;
|
||||
}
|
||||
} else if (holder.getItemViewType() != R.layout.condition_card) {
|
||||
if (holder.getItemViewType() != R.layout.condition_card) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user