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

Commit abedcab4 authored by Winson Chung's avatar Winson Chung Committed by Dan Sandler
Browse files

Small tweaks to the stack curve and header transition. (Bug 16656169)

Change-Id: I96120063a66f267ad0b6a39b3dd020bc030083b8
parent 1bd805c9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -205,10 +205,10 @@
    <dimen name="recents_task_view_rounded_corners_radius">2dp</dimen>

    <!-- The min translation in the Z index for the last task. -->
    <dimen name="recents_task_view_z_min">5dp</dimen>
    <dimen name="recents_task_view_z_min">25dp</dimen>

    <!-- The max translation in the Z index for the last task. -->
    <dimen name="recents_task_view_z_max">65dp</dimen>
    <dimen name="recents_task_view_z_max">100dp</dimen>

    <!-- The amount to translate when animating the removal of a task. -->
    <dimen name="recents_task_view_remove_anim_translation_x">100dp</dimen>
+13 −1
Original line number Diff line number Diff line
@@ -21,11 +21,23 @@
    </style>

    <!-- Alternate Recents theme -->
    <style name="RecentsTheme" parent="@android:style/Theme.DeviceDefault.Wallpaper.NoTitleBar">
    <style name="RecentsTheme" parent="@android:style/Theme">
        <!-- NoTitle -->
        <item name="android:windowNoTitle">true</item>
        <!-- Wallpaper -->
        <item name="android:windowBackground">@color/transparent</item>
        <item name="android:colorBackgroundCacheHint">@null</item>
        <item name="android:windowShowWallpaper">true</item>
        <!-- Misc -->
        <item name="android:statusBarColor">@android:color/transparent</item>
        <item name="android:navigationBarColor">@android:color/transparent</item>
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
        <item name="android:windowAnimationStyle">@style/Animation.RecentsActivity</item>
        <item name="*android:lightingStyle">@style/RecentsLighting</item>
    </style>

    <style name="RecentsLighting" parent="@*android:style/Lighting">
        <item name="*android:ambientShadowAlpha">0.30</item>
    </style>

    <!-- Animations for a non-full-screen window or activity. -->
+3 −3
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ public class TaskStackViewLayoutAlgorithm {

    // Log function
    static final float XScale = 1.75f;  // The large the XScale, the longer the flat area of the curve
    static final float LogBase = 300;
    static final float LogBase = 3000;
    static final int PrecisionSteps = 250;
    static float[] xp;
    static float[] px;
@@ -84,7 +84,7 @@ public class TaskStackViewLayoutAlgorithm {
                left + size, mStackRect.top + size);

        // Update the affiliation offsets
        float visibleTaskPct = 0.55f;
        float visibleTaskPct = 0.5f;
        mWithinAffiliationOffset = mConfig.taskBarHeight;
        mBetweenAffiliationOffset = (int) (visibleTaskPct * mTaskRect.height());
    }
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
    ObjectAnimator mDimAnimator;
    float mMaxDimScale;
    int mDim;
    AccelerateInterpolator mDimInterpolator = new AccelerateInterpolator(1.25f);
    AccelerateInterpolator mDimInterpolator = new AccelerateInterpolator(1f);
    PorterDuffColorFilter mDimColorFilter = new PorterDuffColorFilter(0, PorterDuff.Mode.MULTIPLY);

    Task mTask;
+7 −5
Original line number Diff line number Diff line
@@ -211,13 +211,14 @@ class TaskViewHeader extends FrameLayout {
    void startEnterRecentsAnimation(int delay, Runnable postAnimRunnable) {
        // Animate the task bar of the first task view
        setVisibility(View.VISIBLE);
        setTranslationY(-getMeasuredHeight());
        setAlpha(0f);
        animate()
                .translationY(0)
                .alpha(1f)
                .setStartDelay(delay)
                .setInterpolator(mConfig.fastOutSlowInInterpolator)
                .setInterpolator(mConfig.linearOutSlowInInterpolator)
                .setDuration(mConfig.taskBarEnterAnimDuration)
                .withEndAction(postAnimRunnable)
                .withLayer()
                .start();
    }

@@ -225,9 +226,9 @@ class TaskViewHeader extends FrameLayout {
    void startLaunchTaskAnimation(Runnable preAnimRunnable, final Runnable postAnimRunnable) {
        // Animate the task bar out of the first task view
        animate()
                .translationY(-getMeasuredHeight())
                .alpha(0f)
                .setStartDelay(0)
                .setInterpolator(mConfig.fastOutLinearInInterpolator)
                .setInterpolator(mConfig.linearOutSlowInInterpolator)
                .setDuration(mConfig.taskBarExitAnimDuration)
                .withStartAction(preAnimRunnable)
                .withEndAction(new Runnable() {
@@ -236,6 +237,7 @@ class TaskViewHeader extends FrameLayout {
                        post(postAnimRunnable);
                    }
                })
                .withLayer()
                .start();
    }