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

Commit 7f1f8d0b authored by Selim Cinek's avatar Selim Cinek Committed by Android (Google) Code Review
Browse files

Merge changes from topic "lockscreen_shade_transition" into sc-dev

* changes:
  Implemented Lockscreen to shade transition
  Convert DragDownHelper to Kotlin
parents d3a796c6 8304b95f
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.animation;

import android.util.MathUtils;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.BounceInterpolator;
@@ -71,6 +72,27 @@ public class Interpolators {
    public static final Interpolator TOUCH_RESPONSE_REVERSE =
            new PathInterpolator(0.9f, 0f, 0.7f, 1f);

    /**
     * Calculate the amount of overshoot using an exponential falloff function with desired
     * properties, where the overshoot smoothly transitions at the 1.0f boundary into the
     * overshoot, retaining its acceleration.
     *
     * @param progress a progress value going from 0 to 1
     * @param overshootAmount the amount > 0 of overshoot desired. A value of 0.1 means the max
     *                        value of the overall progress will be at 1.1.
     * @param overshootStart the point in (0,1] where the result should reach 1
     * @return the interpolated overshoot
     */
    public static float getOvershootInterpolation(float progress, float overshootAmount,
            float overshootStart) {
        if (overshootAmount == 0.0f || overshootStart == 0.0f) {
            throw new IllegalArgumentException("Invalid values for overshoot");
        }
        float b = MathUtils.log((overshootAmount + 1) / (overshootAmount)) / overshootStart;
        return MathUtils.max(0.0f,
                (float) (1.0f - Math.exp(-b * progress)) * (overshootAmount + 1.0f));
    }

    /**
     * Interpolate alpha for notifications background scrim during shade expansion.
     * @param fraction Shade expansion fraction
+21 −3
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ public interface QS extends FragmentBase {

    String ACTION = "com.android.systemui.action.PLUGIN_QS";

    int VERSION = 8;
    int VERSION = 9;

    String TAG = "QS";

@@ -50,8 +50,13 @@ public interface QS extends FragmentBase {
    void setListening(boolean listening);
    boolean isShowingDetail();
    void closeDetail();
    default void setShowCollapsedOnKeyguard(boolean showCollapsedOnKeyguard) {}
    void animateHeaderSlidingIn(long delay);

    /**
     * Set that we're currently pulse expanding
     *
     * @param pulseExpanding if we're currently expanding during pulsing
     */
    default void setPulseExpanding(boolean pulseExpanding) {}
    void animateHeaderSlidingOut();
    void setQsExpansion(float qsExpansionFraction, float headerTranslation);
    void setHeaderListening(boolean listening);
@@ -78,11 +83,24 @@ public interface QS extends FragmentBase {
     */
    void setTranslateWhileExpanding(boolean shouldTranslate);

    /**
     * Set the amount of pixels we have currently dragged down if we're transitioning to the full
     * shade. 0.0f means we're not transitioning yet.
     */
    default void setTransitionToFullShadeAmount(float pxAmount, boolean animated) {}

    /**
     * A rounded corner clipping that makes QS feel as if it were behind everything.
     */
    void setFancyClipping(int top, int bottom, int cornerRadius, boolean visible);

    /**
     * @return if quick settings is fully collapsed currently
     */
    default boolean isFullyCollapsed() {
        return true;
    }

    @ProvidesInterface(version = HeightListener.VERSION)
    interface HeightListener {
        int VERSION = 1;
+1 −8
Original line number Diff line number Diff line
@@ -21,8 +21,7 @@
    android:id="@+id/keyguard_bottom_area"
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:outlineProvider="none"
    android:elevation="5dp" > <!-- Put it above the status bar header -->
    android:outlineProvider="none" > <!-- Put it above the status bar header -->

    <LinearLayout
        android:id="@+id/keyguard_indication_area"
@@ -58,12 +57,6 @@

    </LinearLayout>

    <FrameLayout
        android:id="@+id/preview_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    </FrameLayout>

    <com.android.systemui.statusbar.KeyguardAffordanceView
        android:id="@+id/camera_button"
        android:layout_height="@dimen/keyguard_affordance_height"
+36 −18
Original line number Diff line number Diff line
@@ -37,6 +37,25 @@
        android:layout_height="match_parent"
        android:layout_width="match_parent" />

    <include
        layout="@layout/keyguard_bottom_area"
        android:visibility="gone" />

    <ViewStub
        android:id="@+id/keyguard_user_switcher_stub"
        android:layout="@layout/keyguard_user_switcher"
        android:layout_height="match_parent"
        android:layout_width="match_parent" />

    <include layout="@layout/status_bar_expanded_plugin_frame"/>

    <include layout="@layout/dock_info_bottom_area_overlay" />

    <com.android.keyguard.LockIconView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/lock_icon_view" />

    <com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer
        android:layout_width="match_parent"
        android:layout_height="match_parent"
@@ -49,6 +68,18 @@
            layout="@layout/keyguard_status_view"
            android:visibility="gone"/>

        <com.android.systemui.scrim.ScrimView
            android:id="@+id/scrim_notifications"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:importantForAccessibility="no"
            systemui:ignoreRightInset="true"
            systemui:layout_constraintStart_toStartOf="parent"
            systemui:layout_constraintEnd_toEndOf="parent"
            systemui:layout_constraintTop_toTopOf="parent"
            systemui:layout_constraintBottom_toBottomOf="parent"
            />

        <include layout="@layout/dock_info_overlay" />

        <FrameLayout
@@ -101,22 +132,9 @@

    </com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer>

    <include layout="@layout/dock_info_bottom_area_overlay" />

    <include
        layout="@layout/keyguard_bottom_area"
        android:visibility="gone" />

    <ViewStub
        android:id="@+id/keyguard_user_switcher_stub"
        android:layout="@layout/keyguard_user_switcher"
        android:layout_height="match_parent"
        android:layout_width="match_parent" />

    <include layout="@layout/status_bar_expanded_plugin_frame"/>

    <com.android.keyguard.LockIconView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/lock_icon_view" />
    <FrameLayout
        android:id="@+id/preview_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    </FrameLayout>
</com.android.systemui.statusbar.phone.NotificationPanelView>
+0 −8
Original line number Diff line number Diff line
@@ -51,14 +51,6 @@
        sysui:ignoreRightInset="true"
        />

    <com.android.systemui.scrim.ScrimView
        android:id="@+id/scrim_notifications"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:importantForAccessibility="no"
        sysui:ignoreRightInset="true"
        />

    <com.android.systemui.statusbar.LightRevealScrim
            android:id="@+id/light_reveal_scrim"
            android:layout_width="match_parent"
Loading