summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2014-09-23 04:44:56 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-09-23 04:44:56 +0000
commit87c71a6a2c1ffd40dffe4e6020cf604f62ce9e76 (patch)
treeb618761f2ca586a7a831de5cf0c613d593601019
parent7cf2a87c90766a7596c488f9597ffcb3d7441c98 (diff)
parent66c729a48bd79ee9e7ee45df1380f601a3263ee2 (diff)
am 66c729a4: am 764bd1f2: Merge "Add null check when auto-scrolling listView" into lmp-dev
* commit '66c729a48bd79ee9e7ee45df1380f601a3263ee2': Add null check when auto-scrolling listView
-rw-r--r--src/com/android/dialer/calllog/CallLogFragment.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/com/android/dialer/calllog/CallLogFragment.java b/src/com/android/dialer/calllog/CallLogFragment.java
index 2f0ee5370..e5c3c58a5 100644
--- a/src/com/android/dialer/calllog/CallLogFragment.java
+++ b/src/com/android/dialer/calllog/CallLogFragment.java
@@ -601,7 +601,7 @@ public class CallLogFragment extends AnalyticsListFragment
view.getLocalVisibleRect(localVisibleRect);
final int scrollingNeeded = localVisibleRect.top > 0 ? -localVisibleRect.top
: view.getMeasuredHeight() - localVisibleRect.height();
-
+ final ListView listView = getListView();
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
private int mCurrentScroll = 0;
@@ -618,9 +618,11 @@ public class CallLogFragment extends AnalyticsListFragment
view.requestLayout();
if (isExpand) {
- int scrollBy = (int) (value * scrollingNeeded) - mCurrentScroll;
- getListView().smoothScrollBy(scrollBy, /* duration = */ 0);
- mCurrentScroll += scrollBy;
+ if (listView != null) {
+ int scrollBy = (int) (value * scrollingNeeded) - mCurrentScroll;
+ listView.smoothScrollBy(scrollBy, /* duration = */ 0);
+ mCurrentScroll += scrollBy;
+ }
}
}
});