summaryrefslogtreecommitdiffstats
path: root/src/com/android/dialer/list
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2014-07-25 14:19:29 -0700
committerYorke Lee <yorkelee@google.com>2014-07-25 14:19:29 -0700
commit0a3ad7a81821da5b8f4bde566368f5dbc9889aad (patch)
tree0a8ccc22dd17982dbc31b37c519178da768f5a8f /src/com/android/dialer/list
parenta396b7a4d2f9074b57abd6ebdc6e1654d84383e1 (diff)
downloadandroid_packages_apps_Dialer-0a3ad7a81821da5b8f4bde566368f5dbc9889aad.tar.gz
android_packages_apps_Dialer-0a3ad7a81821da5b8f4bde566368f5dbc9889aad.tar.bz2
android_packages_apps_Dialer-0a3ad7a81821da5b8f4bde566368f5dbc9889aad.zip
Update the value of PinnedPositions.UNPINNED to 0
Update Dialer to handle the new value of UNPINNED Bug: 16403306 Change-Id: Ibbf6dd573de9566f212d6bf6d1396378214ddd36
Diffstat (limited to 'src/com/android/dialer/list')
-rw-r--r--src/com/android/dialer/list/PhoneFavoritesTileAdapter.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java b/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java
index 0c4e23eaa..7814718c2 100644
--- a/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java
+++ b/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java
@@ -107,7 +107,8 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements
/** Indicates whether a drag is in process. */
private boolean mInDragging = false;
- public static final int PIN_LIMIT = 20;
+ // Pinned positions start from 1, so there are a total of 20 maximum pinned contacts
+ public static final int PIN_LIMIT = 21;
/**
* The soft limit on how many contact tiles to show.
@@ -551,7 +552,7 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements
for (int i = 0; i < length; i++) {
final ContactEntry contact = toArrange.get(i);
// Decide whether the contact is hidden(demoted), pinned, or unpinned
- if (contact.pinned > PIN_LIMIT) {
+ if (contact.pinned > PIN_LIMIT || contact.pinned == PinnedPositions.UNPINNED) {
unpinnedContacts.add(contact);
} else if (contact.pinned > PinnedPositions.DEMOTED) {
// Demoted or contacts with negative pinned positions are ignored.
@@ -565,7 +566,7 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements
final int maxToPin = Math.min(PIN_LIMIT, pinnedQueue.size() + unpinnedContacts.size());
toArrange.clear();
- for (int i = 0; i < maxToPin; i++) {
+ for (int i = 1; i < maxToPin + 1; i++) {
if (!pinnedQueue.isEmpty() && pinnedQueue.peek().pinned <= i) {
final ContactEntry toPin = pinnedQueue.poll();
toPin.pinned = i;