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

Commit be8f3574 authored by Winson's avatar Winson
Browse files

Fixing issue with front task dimming when scrolled back.

Change-Id: I30d88796e7af13734c9a33def05b62bed4fb2e96
parent 14991504
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -32,7 +32,7 @@
    <!-- The radius of the rounded corners on a task view. -->
    <!-- The radius of the rounded corners on a task view. -->
    <dimen name="recents_task_view_rounded_corners_radius">3dp</dimen>
    <dimen name="recents_task_view_rounded_corners_radius">3dp</dimen>
    <!-- The radius of the rounded corners on a task view's shadow. -->
    <!-- The radius of the rounded corners on a task view's shadow. -->
    <dimen name="recents_task_view_shadow_rounded_corners_radius">18dp</dimen>
    <dimen name="recents_task_view_shadow_rounded_corners_radius">12dp</dimen>


    <!-- The fraction of the screen height where the clock on the Keyguard has its center. The
    <!-- The fraction of the screen height where the clock on the Keyguard has its center. The
     max value is used when no notifications are displaying, and the min value is when the
     max value is used when no notifications are displaying, and the min value is when the
+12 −5
Original line number Original line Diff line number Diff line
@@ -693,6 +693,11 @@ public class TaskStackLayoutAlgorithm {
        SystemServicesProxy ssp = Recents.getSystemServices();
        SystemServicesProxy ssp = Recents.getSystemServices();


        // Compute the focused and unfocused offset
        // Compute the focused and unfocused offset
        float boundedStackScroll = Utilities.clamp(stackScroll, mMinScrollP, mMaxScrollP);
        mUnfocusedRange.offset(boundedStackScroll);
        mFocusedRange.offset(boundedStackScroll);
        float boundedScrollUnfocusedRangeX = mUnfocusedRange.getNormalizedX(taskProgress);
        float boundedScrollFocusedRangeX = mFocusedRange.getNormalizedX(taskProgress);
        mUnfocusedRange.offset(stackScroll);
        mUnfocusedRange.offset(stackScroll);
        mFocusedRange.offset(stackScroll);
        mFocusedRange.offset(stackScroll);
        boolean unfocusedVisible = mUnfocusedRange.isInRange(taskProgress);
        boolean unfocusedVisible = mUnfocusedRange.isInRange(taskProgress);
@@ -729,15 +734,17 @@ public class TaskStackLayoutAlgorithm {
                    unfocusedRangeX)) * mStackRect.height());
                    unfocusedRangeX)) * mStackRect.height());
            int focusedY = (int) ((1f - mFocusedCurveInterpolator.getInterpolation(
            int focusedY = (int) ((1f - mFocusedCurveInterpolator.getInterpolation(
                    focusedRangeX)) * mStackRect.height());
                    focusedRangeX)) * mStackRect.height());
            float unfocusedDim = 1f - UNFOCUSED_DIM_INTERPOLATOR.getInterpolation(unfocusedRangeX);
            float unfocusedDim = 1f - UNFOCUSED_DIM_INTERPOLATOR.getInterpolation(
            float focusedDim = 1f - FOCUSED_DIM_INTERPOLATOR.getInterpolation(focusedRangeX);
                    boundedScrollUnfocusedRangeX);
            float focusedDim = 1f - FOCUSED_DIM_INTERPOLATOR.getInterpolation(
                    boundedScrollFocusedRangeX);


            y = (mStackRect.top - mTaskRect.top) +
            y = (mStackRect.top - mTaskRect.top) +
                    (int) Utilities.mapRange(focusState, unfocusedY, focusedY);
                    (int) Utilities.mapRange(focusState, unfocusedY, focusedY);
            z = Utilities.mapRange(Utilities.clamp01(unfocusedRangeX), mMinTranslationZ,
            z = Utilities.mapRange(Utilities.clamp01(boundedScrollUnfocusedRangeX),
                    mMaxTranslationZ);
                    mMinTranslationZ, mMaxTranslationZ);
            dimAlpha = DIM_MAX_VALUE * Utilities.mapRange(focusState, unfocusedDim, focusedDim);
            dimAlpha = DIM_MAX_VALUE * Utilities.mapRange(focusState, unfocusedDim, focusedDim);
            viewOutlineAlpha = Utilities.mapRange(Utilities.clamp01(unfocusedRangeX),
            viewOutlineAlpha = Utilities.mapRange(Utilities.clamp01(boundedScrollUnfocusedRangeX),
                    OUTLINE_ALPHA_MIN_VALUE, OUTLINE_ALPHA_MAX_VALUE);
                    OUTLINE_ALPHA_MIN_VALUE, OUTLINE_ALPHA_MAX_VALUE);
        }
        }