diff options
author | Selim Cinek <cinek@google.com> | 2014-08-13 13:58:37 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-12 23:14:49 +0000 |
commit | f7fc6f75822bd4baa9dbd9f8610b963de239af76 (patch) | |
tree | 7d56c849933695a8073048ad19e10eff3f7fa9b3 /packages | |
parent | 059a49f8345f4717f48bab21dd04a7af8f9d27ad (diff) | |
parent | 1cf41c14aae685a76af0a140e5bf2563a8372e1c (diff) | |
download | frameworks_base-f7fc6f75822bd4baa9dbd9f8610b963de239af76.zip frameworks_base-f7fc6f75822bd4baa9dbd9f8610b963de239af76.tar.gz frameworks_base-f7fc6f75822bd4baa9dbd9f8610b963de239af76.tar.bz2 |
Merge "Reuse existing TouchHelpers on rotation" into lmp-dev
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index d25dda1..462452b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -211,6 +211,15 @@ public class NotificationStackScrollLayout extends ViewGroup public NotificationStackScrollLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); + int minHeight = getResources().getDimensionPixelSize(R.dimen.notification_min_height); + int maxHeight = getResources().getDimensionPixelSize(R.dimen.notification_max_height); + mExpandHelper = new ExpandHelper(getContext(), this, + minHeight, maxHeight); + mExpandHelper.setEventSource(this); + mExpandHelper.setScrollAdapter(this); + + mSwipeHelper = new SwipeHelper(SwipeHelper.X, this, getContext()); + mSwipeHelper.setLongPressListener(mLongPressListener); initView(context); if (DEBUG) { setWillNotDraw(false); @@ -248,10 +257,6 @@ public class NotificationStackScrollLayout extends ViewGroup mMinimumVelocity = configuration.getScaledMinimumFlingVelocity(); mMaximumVelocity = configuration.getScaledMaximumFlingVelocity(); mOverflingDistance = configuration.getScaledOverflingDistance(); - float densityScale = getResources().getDisplayMetrics().density; - float pagingTouchSlop = ViewConfiguration.get(getContext()).getScaledPagingTouchSlop(); - mSwipeHelper = new SwipeHelper(SwipeHelper.X, this, getContext()); - mSwipeHelper.setLongPressListener(mLongPressListener); mSidePaddings = context.getResources() .getDimensionPixelSize(R.dimen.notification_side_padding); @@ -266,12 +271,6 @@ public class NotificationStackScrollLayout extends ViewGroup mPaddingBetweenElementsNormal = context.getResources() .getDimensionPixelSize(R.dimen.notification_padding); updatePadding(mAmbientState.isDimmed()); - int minHeight = getResources().getDimensionPixelSize(R.dimen.notification_min_height); - int maxHeight = getResources().getDimensionPixelSize(R.dimen.notification_max_height); - mExpandHelper = new ExpandHelper(getContext(), this, - minHeight, maxHeight); - mExpandHelper.setEventSource(this); - mExpandHelper.setScrollAdapter(this); mMinTopOverScrollToEscape = getResources().getDimensionPixelSize( R.dimen.min_top_overscroll_to_qs); mNotificationTopPadding = getResources().getDimensionPixelSize( |