Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 764bd1f2 authored by Yorke Lee's avatar Yorke Lee Committed by Android (Google) Code Review
Browse files

Merge "Add null check when auto-scrolling listView" into lmp-dev

parents eb21b034 0a3c7a19
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -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,11 +618,13 @@ public class CallLogFragment extends AnalyticsListFragment
                        view.requestLayout();

                        if (isExpand) {
                            if (listView != null) {
                                int scrollBy = (int) (value * scrollingNeeded) - mCurrentScroll;
                            getListView().smoothScrollBy(scrollBy, /* duration = */ 0);
                                listView.smoothScrollBy(scrollBy, /* duration = */ 0);
                                mCurrentScroll += scrollBy;
                            }
                        }
                    }
                });
                // Set everything to their final values when the animation's done.
                animator.addListener(new AnimatorListenerAdapter() {