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

Commit 1cf41c14 authored by Selim Cinek's avatar Selim Cinek
Browse files

Reuse existing TouchHelpers on rotation

Recreating them caused some bugs when touching during
the rotation. Currently there is no need to recreate them.

Bug: 15598792
Change-Id: I7255bd0102427e6847b63ce7f6346248aaa4054f
parent 1584609f
Loading
Loading
Loading
Loading
+9 −10
Original line number Original line Diff line number Diff line
@@ -209,6 +209,15 @@ public class NotificationStackScrollLayout extends ViewGroup
    public NotificationStackScrollLayout(Context context, AttributeSet attrs, int defStyleAttr,
    public NotificationStackScrollLayout(Context context, AttributeSet attrs, int defStyleAttr,
            int defStyleRes) {
            int defStyleRes) {
        super(context, attrs, defStyleAttr, 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);
        initView(context);
        if (DEBUG) {
        if (DEBUG) {
            setWillNotDraw(false);
            setWillNotDraw(false);
@@ -246,10 +255,6 @@ public class NotificationStackScrollLayout extends ViewGroup
        mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
        mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
        mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
        mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
        mOverflingDistance = configuration.getScaledOverflingDistance();
        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()
        mSidePaddings = context.getResources()
                .getDimensionPixelSize(R.dimen.notification_side_padding);
                .getDimensionPixelSize(R.dimen.notification_side_padding);
@@ -264,12 +269,6 @@ public class NotificationStackScrollLayout extends ViewGroup
        mPaddingBetweenElementsNormal = context.getResources()
        mPaddingBetweenElementsNormal = context.getResources()
                .getDimensionPixelSize(R.dimen.notification_padding);
                .getDimensionPixelSize(R.dimen.notification_padding);
        updatePadding(mAmbientState.isDimmed());
        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(
        mMinTopOverScrollToEscape = getResources().getDimensionPixelSize(
                R.dimen.min_top_overscroll_to_qs);
                R.dimen.min_top_overscroll_to_qs);
        mNotificationTopPadding = getResources().getDimensionPixelSize(
        mNotificationTopPadding = getResources().getDimensionPixelSize(