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

Commit a02fe523 authored by Selim Cinek's avatar Selim Cinek
Browse files

Reduced overexpansion when expanding the panel

Bug: 14486987
Change-Id: Ic1546e1661e3afe842b044abf636421d2620bddd
parent 79525b2f
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -48,6 +48,8 @@ public class NotificationPanelView extends PanelView implements
        ExpandableView.OnHeightChangedListener, ObservableScrollView.Listener,
        View.OnClickListener, KeyguardPageSwipeHelper.Callback {

    private static float EXPANSION_RUBBER_BAND_EXTRA_FACTOR = 0.4f;

    private KeyguardPageSwipeHelper mPageSwiper;
    PhoneStatusBar mStatusBar;
    private StatusBarHeaderView mHeader;
@@ -743,8 +745,11 @@ public class NotificationPanelView extends PanelView implements
    @Override
    protected void onOverExpansionChanged(float overExpansion) {
        float currentOverScroll = mNotificationStackScroller.getCurrentOverScrolledPixels(true);
        mNotificationStackScroller.setOverScrolledPixels(currentOverScroll + overExpansion
                        - mOverExpansion, true /* onTop */, false /* animate */);
        float expansionChange = overExpansion - mOverExpansion;
        expansionChange *= EXPANSION_RUBBER_BAND_EXTRA_FACTOR;
        mNotificationStackScroller.setOverScrolledPixels(currentOverScroll + expansionChange,
                true /* onTop */,
                false /* animate */);
        super.onOverExpansionChanged(overExpansion);
    }