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

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

Adjusting the notification header appearance on the lock screen

Now the notification looks like a regular heads up and can
transform through the unlock without any change.

Bug: 130327302
Test: add hun on lockscreen, pull down
Change-Id: Id59188130eb5b01376c868874c24afdef9a694fa
parent d21232ee
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -94,6 +94,10 @@
    <item type="id" name="top_roundess_animator_start_tag"/>
    <item type="id" name="top_roundess_animator_start_tag"/>
    <item type="id" name="top_roundess_animator_end_tag"/>
    <item type="id" name="top_roundess_animator_end_tag"/>


    <item type="id" name="keyguard_hun_animator_tag"/>
    <item type="id" name="keyguard_hun_animator_start_tag"/>
    <item type="id" name="keyguard_hun_animator_end_tag"/>

    <!-- Accessibility actions for the notification menu -->
    <!-- Accessibility actions for the notification menu -->
    <item type="id" name="action_snooze_undo"/>
    <item type="id" name="action_snooze_undo"/>
    <item type="id" name="action_snooze_shorter"/>
    <item type="id" name="action_snooze_shorter"/>
+16 −6
Original line number Original line Diff line number Diff line
@@ -36,6 +36,7 @@ import com.android.systemui.plugins.FalsingManager
import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator
import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
import com.android.systemui.statusbar.notification.row.ExpandableView
import com.android.systemui.statusbar.notification.row.ExpandableView
import com.android.systemui.statusbar.notification.stack.NotificationRoundnessManager
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout
import com.android.systemui.statusbar.phone.HeadsUpManagerPhone
import com.android.systemui.statusbar.phone.HeadsUpManagerPhone
import com.android.systemui.statusbar.phone.KeyguardBypassController
import com.android.systemui.statusbar.phone.KeyguardBypassController
@@ -54,7 +55,8 @@ class PulseExpansionHandler @Inject
constructor(context: Context,
constructor(context: Context,
            private val wakeUpCoordinator: NotificationWakeUpCoordinator,
            private val wakeUpCoordinator: NotificationWakeUpCoordinator,
            private val bypassController: KeyguardBypassController,
            private val bypassController: KeyguardBypassController,
            private val headsUpManager: HeadsUpManagerPhone) : Gefingerpoken {
            private val headsUpManager: HeadsUpManagerPhone,
            private val roundnessManager: NotificationRoundnessManager) : Gefingerpoken {
    companion object {
    companion object {
        private val RUBBERBAND_FACTOR_STATIC = 0.25f
        private val RUBBERBAND_FACTOR_STATIC = 0.25f
        private val SPRING_BACK_ANIMATION_LENGTH_MS = 375
        private val SPRING_BACK_ANIMATION_LENGTH_MS = 375
@@ -71,12 +73,20 @@ constructor(context: Context,
            field = value
            field = value
            bypassController.isPulseExpanding = value
            bypassController.isPulseExpanding = value
            if (changed) {
            if (changed) {
                headsUpManager.unpinAll(true /* userUnPinned */)
                if (value) {
                if (!value && !leavingLockscreen) {
                    val topEntry = headsUpManager.topEntry
                    topEntry?.let {
                        roundnessManager.setTrackingHeadsUp(it.row)
                    }
                } else {
                    roundnessManager.setTrackingHeadsUp(null)
                    if (!leavingLockscreen) {
                        bypassController.maybePerformPendingUnlock()
                        bypassController.maybePerformPendingUnlock()
                        pulseExpandAbortListener?.run()
                        pulseExpandAbortListener?.run()
                    }
                    }
                }
                }
                headsUpManager.unpinAll(true /* userUnPinned */)
            }
        }
        }
    var leavingLockscreen: Boolean = false
    var leavingLockscreen: Boolean = false
        private set
        private set
@@ -237,7 +247,7 @@ constructor(context: Context,
    }
    }


    private fun captureStartingChild(x: Float, y: Float) {
    private fun captureStartingChild(x: Float, y: Float) {
        if (mStartingChild == null) {
        if (mStartingChild == null && !bypassController.bypassEnabled) {
            mStartingChild = findView(x, y)
            mStartingChild = findView(x, y)
            if (mStartingChild != null) {
            if (mStartingChild != null) {
                setUserLocked(mStartingChild!!, true)
                setUserLocked(mStartingChild!!, true)
+15 −2
Original line number Original line Diff line number Diff line
@@ -115,7 +115,20 @@ public class PropertyAnimator {
        view.setTag(animationEndTag, newEndValue);
        view.setTag(animationEndTag, newEndValue);
    }
    }


    public static <T extends View> boolean isAnimating(T view, AnimatableProperty property) {
    public static <T extends View> void applyImmediately(T view, AnimatableProperty property,
            float newValue) {
        cancelAnimation(view, property);
        property.getProperty().set(view, newValue);
    }

    public static void cancelAnimation(View view, AnimatableProperty property) {
        ValueAnimator animator = (ValueAnimator) view.getTag(property.getAnimatorTag());
        if (animator != null) {
            animator.cancel();
        }
    }

    public static boolean isAnimating(View view, AnimatableProperty property) {
        return view.getTag(property.getAnimatorTag()) != null;
        return view.getTag(property.getAnimatorTag()) != null;
    }
    }
}
}
+4 −0
Original line number Original line Diff line number Diff line
@@ -1040,6 +1040,10 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        return false;
        return false;
    }
    }


    public int getHeadsUpHeightWithoutHeader() {
        return getHeight();
    }

    public interface OnActivatedListener {
    public interface OnActivatedListener {
        void onActivated(ActivatableNotificationView view);
        void onActivated(ActivatableNotificationView view);
        void onActivationReset(ActivatableNotificationView view);
        void onActivationReset(ActivatableNotificationView view);
+12 −1
Original line number Original line Diff line number Diff line
@@ -2637,7 +2637,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView




    private int getHeadsUpHeight() {
    private int getHeadsUpHeight() {
        return getShowingLayout().getHeadsUpHeight();
        return getShowingLayout().getHeadsUpHeight(false /* forceNoHeader */);
    }
    }


    public boolean areGutsExposed() {
    public boolean areGutsExposed() {
@@ -2774,6 +2774,17 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        return getMinHeight();
        return getMinHeight();
    }
    }


    @Override
    public int getHeadsUpHeightWithoutHeader() {
        if (!canShowHeadsUp() || !mIsHeadsUp) {
            return getCollapsedHeight();
        }
        if (mIsSummaryWithChildren && !shouldShowPublic()) {
            return mChildrenContainer.getCollapsedHeightWithoutHeader();
        }
        return getShowingLayout().getHeadsUpHeight(true /* forceNoHeader */);
    }

    @Override
    @Override
    public void setClipTopAmount(int clipTopAmount) {
    public void setClipTopAmount(int clipTopAmount) {
        super.setClipTopAmount(clipTopAmount);
        super.setClipTopAmount(clipTopAmount);
Loading