diff options
Diffstat (limited to 'java/com/android/dialer/app')
-rw-r--r-- | java/com/android/dialer/app/list/PhoneFavoriteTileView.java | 8 | ||||
-rw-r--r-- | java/com/android/dialer/app/list/PhoneFavoritesTileAdapter.java | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/java/com/android/dialer/app/list/PhoneFavoriteTileView.java b/java/com/android/dialer/app/list/PhoneFavoriteTileView.java index eb4f8e967..30870eb39 100644 --- a/java/com/android/dialer/app/list/PhoneFavoriteTileView.java +++ b/java/com/android/dialer/app/list/PhoneFavoriteTileView.java @@ -62,6 +62,7 @@ public abstract class PhoneFavoriteTileView extends ContactTileView { private String mPhoneNumberString; private boolean isPinned; private boolean isStarred; + private int position = -1; public PhoneFavoriteTileView(Context context, AttributeSet attrs) { super(context, attrs); @@ -126,8 +127,7 @@ public abstract class PhoneFavoriteTileView extends ContactTileView { CallSpecificAppData.Builder callSpecificAppData = CallSpecificAppData.newBuilder() .setCallInitiationType(CallInitiationType.Type.SPEED_DIAL) - .setSpeedDialContactPosition( - ((PhoneFavoriteListView) v.getParent()).getPositionForView(v)); + .setSpeedDialContactPosition(position); if (isStarred) { callSpecificAppData.addSpeedDialContactType(SpeedDialContactType.Type.STARRED_CONTACT); } else { @@ -182,4 +182,8 @@ public abstract class PhoneFavoriteTileView extends ContactTileView { // Unlike Contacts' tiles, the Dialer's favorites tiles are square. return false; } + + public void setPosition(int position) { + this.position = position; + } } diff --git a/java/com/android/dialer/app/list/PhoneFavoritesTileAdapter.java b/java/com/android/dialer/app/list/PhoneFavoritesTileAdapter.java index 876fbf146..dbd601a7d 100644 --- a/java/com/android/dialer/app/list/PhoneFavoritesTileAdapter.java +++ b/java/com/android/dialer/app/list/PhoneFavoritesTileAdapter.java @@ -440,6 +440,7 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements OnDragDrop tileView.setPhotoManager(mPhotoManager); tileView.setListener(mListener); tileView.loadFromContact(getItem(position)); + tileView.setPosition(position); return tileView; } |