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

Commit 96b4b4bd authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Clock padding and motion adjustments" into pi-dev

parents dd08f4b9 60661a6d
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@

    <!-- Vertical translation of the shelf during animation that happens after the
    notification panel collapses -->
    <dimen name="shelf_appear_translation">9dp</dimen>
    <dimen name="shelf_appear_translation">42dp</dimen>

    <!-- The amount the content shifts upwards when transforming into the icon -->
    <dimen name="notification_icon_transform_content_shift">32dp</dimen>
@@ -497,9 +497,6 @@
         device. -->
    <dimen name="unlock_move_distance">75dp</dimen>

    <!-- Distance after which the scrim starts fading in when dragging down the quick settings -->
    <dimen name="notification_scrim_wait_distance">100dp</dimen>

    <!-- Move distance for the unlock hint animation on the lockscreen -->
    <dimen name="hint_move_distance">75dp</dimen>

+6 −0
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@
    <item type="id" name="scale_y_animator_tag"/>
    <item type="id" name="top_inset_animator_tag"/>
    <item type="id" name="height_animator_tag"/>
    <item type="id" name="x_animator_tag"/>
    <item type="id" name="y_animator_tag"/>
    <item type="id" name="shadow_alpha_animator_tag"/>
    <item type="id" name="translation_x_animator_end_value_tag"/>
    <item type="id" name="translation_y_animator_end_value_tag"/>
@@ -34,6 +36,8 @@
    <item type="id" name="top_inset_animator_end_value_tag"/>
    <item type="id" name="height_animator_end_value_tag"/>
    <item type="id" name="shadow_alpha_animator_end_value_tag"/>
    <item type="id" name="x_animator_tag_end_value"/>
    <item type="id" name="y_animator_tag_end_value"/>
    <item type="id" name="translation_x_animator_start_value_tag"/>
    <item type="id" name="translation_y_animator_start_value_tag"/>
    <item type="id" name="translation_z_animator_start_value_tag"/>
@@ -43,6 +47,8 @@
    <item type="id" name="top_inset_animator_start_value_tag"/>
    <item type="id" name="height_animator_start_value_tag"/>
    <item type="id" name="shadow_alpha_animator_start_value_tag"/>
    <item type="id" name="x_animator_tag_start_value"/>
    <item type="id" name="y_animator_tag_start_value"/>
    <item type="id" name="doze_saved_filter_tag"/>
    <item type="id" name="qs_icon_tag"/>
    <item type="id" name="qs_slash_tag"/>
+8 −4
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
            = SystemProperties.getBoolean("debug.icon_scroll_animations", true);
    private static final int TAG_CONTINUOUS_CLIPPING = R.id.continuous_clipping_tag;
    private static final String TAG = "NotificationShelf";
    private static final long SHELF_IN_TRANSLATION_DURATION = 220;
    private static final long SHELF_IN_TRANSLATION_DURATION = 200;

    private ViewInvertHelper mViewInvertHelper;
    private boolean mDark;
@@ -157,14 +157,18 @@ public class NotificationShelf extends ActivatableNotificationView implements

    public void fadeInTranslating() {
        float translation = mShelfIcons.getTranslationY();
        mShelfIcons.setTranslationY(translation + mShelfAppearTranslation);
        mShelfIcons.setTranslationY(translation - mShelfAppearTranslation);
        mShelfIcons.setAlpha(0);
        mShelfIcons.animate()
                .alpha(1)
                .setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN)
                .setInterpolator(Interpolators.DECELERATE_QUINT)
                .translationY(translation)
                .setDuration(SHELF_IN_TRANSLATION_DURATION)
                .start();
        mShelfIcons.animate()
                .alpha(1)
                .setInterpolator(Interpolators.LINEAR)
                .setDuration(SHELF_IN_TRANSLATION_DURATION)
                .start();
    }

    @Override
+38 −8
Original line number Diff line number Diff line
@@ -20,25 +20,30 @@ import android.util.FloatProperty;
import android.util.Property;
import android.view.View;

import com.android.systemui.statusbar.stack.AnimationProperties;
import com.android.systemui.R;

import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;

/**
 * An animatable property of a view. Used with {@link PropertyAnimator}
 */
public interface AnimatableProperty {
    int getAnimationStartTag();
public abstract class AnimatableProperty {

    int getAnimationEndTag();
    public static final AnimatableProperty X = AnimatableProperty.from(View.X,
            R.id.x_animator_tag, R.id.x_animator_tag_start_value, R.id.x_animator_tag_end_value);
    public static final AnimatableProperty Y = AnimatableProperty.from(View.Y,
            R.id.y_animator_tag, R.id.y_animator_tag_start_value, R.id.y_animator_tag_end_value);

    int getAnimatorTag();
    public abstract int getAnimationStartTag();

    Property getProperty();
    public abstract int getAnimationEndTag();

    static <T extends View> AnimatableProperty from(String name, BiConsumer<T, Float> setter,
    public abstract int getAnimatorTag();

    public abstract Property getProperty();

    public static <T extends View> AnimatableProperty from(String name, BiConsumer<T, Float> setter,
            Function<T, Float> getter, int animatorTag, int startValueTag, int endValueTag) {
        Property<T, Float> property = new FloatProperty<T>(name) {

@@ -74,4 +79,29 @@ public interface AnimatableProperty {
            }
        };
    }

    public static <T extends View> AnimatableProperty from(Property<T, Float> property,
            int animatorTag, int startValueTag, int endValueTag) {
        return new AnimatableProperty() {
            @Override
            public int getAnimationStartTag() {
                return startValueTag;
            }

            @Override
            public int getAnimationEndTag() {
                return endValueTag;
            }

            @Override
            public int getAnimatorTag() {
                return animatorTag;
            }

            @Override
            public Property getProperty() {
                return property;
            }
        };
    }
}
+4 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.util.Property;
import android.view.View;
import android.view.animation.Interpolator;

import com.android.keyguard.KeyguardStatusView;
import com.android.systemui.Interpolators;
import com.android.systemui.statusbar.stack.AnimationFilter;
import com.android.systemui.statusbar.stack.AnimationProperties;
@@ -115,4 +116,7 @@ public class PropertyAnimator {
        view.setTag(animationEndTag, newEndValue);
    }

    public static <T extends View> boolean isAnimating(T view, AnimatableProperty property) {
        return  view.getTag(property.getAnimatorTag()) != null;
    }
}
Loading