diff options
Diffstat (limited to 'src/com/android')
4 files changed, 11 insertions, 131 deletions
diff --git a/src/com/android/dialer/list/PhoneFavoriteListView.java b/src/com/android/dialer/list/PhoneFavoriteListView.java index 404802360..67dbf2dba 100644 --- a/src/com/android/dialer/list/PhoneFavoriteListView.java +++ b/src/com/android/dialer/list/PhoneFavoriteListView.java @@ -242,15 +242,10 @@ public class PhoneFavoriteListView extends ListView implements OnDragDropListene return; } - if (tileView instanceof PhoneFavoriteRegularRowView) { - mDragShadowLeft = tileView.getParentRow().getLeft(); - mDragShadowTop = tileView.getParentRow().getTop(); - } else { - // Square tile is relative to the contact tile, - // and contact tile is relative to this list view. - mDragShadowLeft = tileView.getLeft() + tileView.getParentRow().getLeft(); - mDragShadowTop = tileView.getTop() + tileView.getParentRow().getTop(); - } + // Square tile is relative to the contact tile, + // and contact tile is relative to this list view. + mDragShadowLeft = tileView.getLeft() + tileView.getParentRow().getLeft(); + mDragShadowTop = tileView.getTop() + tileView.getParentRow().getTop(); mDragShadowOverlay.setImageBitmap(mDragShadowBitmap); mDragShadowOverlay.setVisibility(VISIBLE); diff --git a/src/com/android/dialer/list/PhoneFavoriteRegularRowView.java b/src/com/android/dialer/list/PhoneFavoriteRegularRowView.java deleted file mode 100644 index 91b09d7d6..000000000 --- a/src/com/android/dialer/list/PhoneFavoriteRegularRowView.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2011 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.dialer.list; - -import android.content.Context; -import android.content.res.Resources; -import android.util.AttributeSet; -import android.view.View; - -import com.android.contacts.common.util.ViewUtil; -import com.android.dialer.R; - -public class PhoneFavoriteRegularRowView extends PhoneFavoriteTileView { - private static final String TAG = PhoneFavoriteRegularRowView.class.getSimpleName(); - private static final boolean DEBUG = false; - - public PhoneFavoriteRegularRowView(Context context, AttributeSet attrs) { - super(context, attrs); - } - - @Override - protected void onFinishInflate() { - super.onFinishInflate(); - - final View favoriteContactCard = findViewById(R.id.contact_favorite_card); - - final int rowPaddingStart; - final int rowPaddingEnd; - final int rowPaddingTop; - final int rowPaddingBottom; - - final Resources resources = getResources(); - rowPaddingStart = resources.getDimensionPixelSize( - R.dimen.favorites_row_start_padding); - rowPaddingEnd = resources.getDimensionPixelSize( - R.dimen.favorites_row_end_padding); - rowPaddingTop = resources.getDimensionPixelSize( - R.dimen.favorites_row_top_padding); - rowPaddingBottom = resources.getDimensionPixelSize( - R.dimen.favorites_row_bottom_padding); - - favoriteContactCard.setBackgroundResource(R.drawable.contact_list_item_background); - - favoriteContactCard.setPaddingRelative(rowPaddingStart, rowPaddingTop, rowPaddingEnd, - rowPaddingBottom); - - final View quickContactBadge = findViewById(R.id.contact_tile_quick); - quickContactBadge.setOnLongClickListener(new OnLongClickListener() { - @Override - public boolean onLongClick(View v) { - return PhoneFavoriteRegularRowView.this.performLongClick(); - } - }); - } - - @Override - protected int getApproximateImageSize() { - return ViewUtil.getConstantPreLayoutWidth(getQuickContact()); - } -} diff --git a/src/com/android/dialer/list/PhoneFavoriteTileView.java b/src/com/android/dialer/list/PhoneFavoriteTileView.java index c05ba1db5..047f381ae 100644 --- a/src/com/android/dialer/list/PhoneFavoriteTileView.java +++ b/src/com/android/dialer/list/PhoneFavoriteTileView.java @@ -16,15 +16,10 @@ */ package com.android.dialer.list; -import android.animation.Animator; -import android.animation.AnimatorListenerAdapter; -import android.animation.AnimatorSet; -import android.animation.ObjectAnimator; import android.content.ClipData; import android.content.Context; import android.text.TextUtils; import android.util.AttributeSet; -import android.view.GestureDetector; import android.view.View; import com.android.contacts.common.ContactPhotoManager; @@ -34,7 +29,6 @@ import com.android.contacts.common.list.ContactEntry; import com.android.contacts.common.list.ContactTileView; import com.android.dialer.R; import com.android.dialer.list.PhoneFavoritesTileAdapter.ContactTileRow; -import com.android.dialer.list.PhoneFavoritesTileAdapter.ViewTypes; /** * A light version of the {@link com.android.contacts.common.list.ContactTileView} that is used in @@ -84,17 +78,7 @@ public abstract class PhoneFavoriteTileView extends ContactTileView { public boolean onLongClick(View v) { final PhoneFavoriteTileView view = (PhoneFavoriteTileView) v; // NOTE The drag shadow is handled in the ListView. - if (view instanceof PhoneFavoriteRegularRowView) { - final ContactTileRow parent = view.getParentRow(); - // If the view is regular row, start drag the row view. - // Drag is not available for the item exceeds the PIN_LIMIT. - if (parent.getRegularRowItemIndex() < PhoneFavoritesTileAdapter.PIN_LIMIT) { - parent.startDrag(EMPTY_CLIP_DATA, new View.DragShadowBuilder(), null, 0); - } - } else { - // If the view is a tile view, start drag the tile. - view.startDrag(EMPTY_CLIP_DATA, new View.DragShadowBuilder(), null, 0); - } + view.startDrag(EMPTY_CLIP_DATA, new View.DragShadowBuilder(), null, 0); return true; } }); 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 |