summaryrefslogtreecommitdiff
path: root/src/com/android/dialer/list/ListsFragment.java
diff options
context:
space:
mode:
authorJay Shrauner <shrauner@google.com>2014-07-02 10:00:16 -0700
committerJay Shrauner <shrauner@google.com>2014-07-02 10:40:55 -0700
commit59b2f65c33118ac3f17e9700d079f2852b30a486 (patch)
treea09be68898104048c87e1dd487d1076166870ae6 /src/com/android/dialer/list/ListsFragment.java
parente9b9290142e0e0e767536bc0e8f89f80f7ad3926 (diff)
Fix NPE in onPanelSlide
Check for null SwipeableShortcutCard returned by getChildAt(0). Bug:16036815 Change-Id: I1e81a535e493427a694fdfd1e20429c4d01b477f
Diffstat (limited to 'src/com/android/dialer/list/ListsFragment.java')
-rw-r--r--src/com/android/dialer/list/ListsFragment.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/com/android/dialer/list/ListsFragment.java b/src/com/android/dialer/list/ListsFragment.java
index b50f94e62..e94555e2f 100644
--- a/src/com/android/dialer/list/ListsFragment.java
+++ b/src/com/android/dialer/list/ListsFragment.java
@@ -141,8 +141,8 @@ public class ListsFragment extends Fragment implements CallLogQueryHandler.Liste
// slideOffset is 1 when the shortcut card is fully exposed, and 0 when completely
// hidden.
float ratioCardHidden = (1 - slideOffset) * 1.5f;
- if (mShortcutCardsListView.getCount() > 0) {
- SwipeableShortcutCard v =
+ if (mShortcutCardsListView.getChildCount() > 0) {
+ final SwipeableShortcutCard v =
(SwipeableShortcutCard) mShortcutCardsListView.getChildAt(0);
v.clipCard(ratioCardHidden);
}
@@ -348,7 +348,7 @@ public class ListsFragment extends Fragment implements CallLogQueryHandler.Liste
mRemoveView.setAlpha(show ? 0 : 1);
mRemoveView.animate().alpha(show ? 1 : 0).start();
- if (mShortcutCardsListView.getCount() > 0) {
+ if (mShortcutCardsListView.getChildCount() > 0) {
View v = mShortcutCardsListView.getChildAt(0);
v.animate().withLayer()
.alpha(show ? REMOVE_VIEW_SHOWN_ALPHA : REMOVE_VIEW_HIDDEN_ALPHA)