diff options
author | Yorke Lee <yorkelee@google.com> | 2014-03-07 17:36:47 -0800 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2014-03-24 16:30:38 -0700 |
commit | 64f9593c85ac00dbcdbc99d2d18c457c0bd0f68e (patch) | |
tree | 0a8a3a73400f407d15475314b54b6aa3c98fdeb6 /src/com/android/dialer/list/PhoneFavoritesTileAdapter.java | |
parent | 6720273a04f940de2b383128b7596f33d781f231 (diff) |
Remove layout and logic for unused non-tiled favorites
Change-Id: I26caea4e47da8ae8420ef35e8006ee3f968d0630
Diffstat (limited to 'src/com/android/dialer/list/PhoneFavoritesTileAdapter.java')
-rw-r--r-- | src/com/android/dialer/list/PhoneFavoritesTileAdapter.java | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java b/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java index 503c506c1..1b5123d2e 100644 --- a/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java +++ b/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java @@ -50,9 +50,6 @@ import java.util.PriorityQueue; /** * Also allows for a configurable number of columns as well as a maximum row of tiled contacts. - * - * This adapter has been rewritten to only support a maximum of one row for favorites. - * */ public class PhoneFavoritesTileAdapter extends BaseAdapter implements OnDragDropListener { @@ -461,11 +458,7 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements */ @Override public long getItemId(int position) { - if (getItemViewType(position) == ViewTypes.FREQUENT) { - return getAdjustedItemId(getItem(position).get(0).id); - } else { - return position; - } + return position; } /** @@ -531,9 +524,7 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements private int getLayoutResourceId(int viewType) { switch (viewType) { - case ViewTypes.FREQUENT: - return R.layout.phone_favorite_regular_row_view; - case ViewTypes.TOP: + case ViewTypes.TOP: return R.layout.phone_favorite_tile_view; default: throw new IllegalArgumentException("Unrecognized viewType " + viewType); @@ -546,11 +537,7 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements @Override public int getItemViewType(int position) { - if (position < getMaxContactsInTiles()) { - return ViewTypes.TOP; - } else { - return ViewTypes.FREQUENT; - } + return ViewTypes.TOP; } /** @@ -710,7 +697,7 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements * Configures the row to add {@link ContactEntry}s information to the views */ public void configureRow(ArrayList<ContactEntry> list, int position, boolean isLastRow) { - int columnCount = mItemViewType == ViewTypes.FREQUENT ? 1 : mColumnCount; + final int columnCount = mColumnCount; mPosition = position; // Adding tiles to row and filling in contact information @@ -719,13 +706,6 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements columnCounter < list.size() ? list.get(columnCounter) : null; addTileFromEntry(entry, columnCounter, isLastRow); } - if (columnCount == 1) { - if (list.get(0) == ContactEntry.BLANK_ENTRY) { - setVisibility(View.INVISIBLE); - } else { - setVisibility(View.VISIBLE); - } - } } private void addTileFromEntry(ContactEntry entry, int childIndex, boolean isLastRow) { @@ -761,11 +741,6 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements childIndex >= mColumnCount - 1 ? 0 : mPaddingInPixels, 0); entryIndex = getFirstContactEntryIndexForPosition(mPosition) + childIndex; break; - case ViewTypes.FREQUENT: - contactTile.setHorizontalDividerVisibility( - isLastRow ? View.GONE : View.VISIBLE); - entryIndex = getFirstContactEntryIndexForPosition(mPosition); - break; default: break; } @@ -1026,9 +1001,8 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements } protected static class ViewTypes { - public static final int FREQUENT = 0; - public static final int TOP = 1; - public static final int COUNT = 2; + public static final int TOP = 0; + public static final int COUNT = 1; } @Override |