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

Commit d6cd06fb authored by Darrell Shi's avatar Darrell Shi
Browse files

Override edit mode activity launch animation

This change overrides the glanceable hub edit mode activity launch
animation so that it fades in. It also changes the white background to
transparent so that it doesn't appear as a white flash.

Test: manual
Fix: 425950266
Flag: com.android.systemui.hub_edit_mode_transition
Change-Id: I0ff005bd8b7ae8601e586ae269a7589196584f92
parent b182d2ed
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ class EditWidgetsActivityStarterTest : SysuiTestCase() {
                        eq(true),
                        eq(true),
                        any(),
                        any(),
                        captor.capture(),
                    )

@@ -93,19 +94,19 @@ class EditWidgetsActivityStarterTest : SysuiTestCase() {
            testScope.runTest {
                underTest.startActivity(shouldOpenWidgetPickerOnStart = true)
                verify(activityStarter)
                    .startActivityDismissingKeyguard(any(), eq(true), eq(true), any(), any())
                    .startActivityDismissingKeyguard(any(), eq(true), eq(true), any(), any(), any())

                clearInvocations(activityStarter)

                underTest.startActivity(shouldOpenWidgetPickerOnStart = false)
                verify(activityStarter, never())
                    .startActivityDismissingKeyguard(any(), eq(true), eq(true), any(), any())
                    .startActivityDismissingKeyguard(any(), eq(true), eq(true), any(), any(), any())

                communalSceneInteractor.setEditModeState(null)

                underTest.startActivity(shouldOpenWidgetPickerOnStart = true)
                verify(activityStarter)
                    .startActivityDismissingKeyguard(any(), eq(true), eq(true), any(), any())
                    .startActivityDismissingKeyguard(any(), eq(true), eq(true), any(), any(), any())
            }
        }
    }
@@ -124,6 +125,7 @@ class EditWidgetsActivityStarterTest : SysuiTestCase() {
                        eq(true),
                        any(),
                        any(),
                        any(),
                    )
                assertThat(captor.lastValue.component).isEqualTo(component)
                assertThat(captor.lastValue.flags and Intent.FLAG_ACTIVITY_NEW_TASK).isNotEqualTo(0)
@@ -148,6 +150,7 @@ class EditWidgetsActivityStarterTest : SysuiTestCase() {
                        eq(true),
                        any(),
                        any(),
                        any(),
                    )
                assertThat(captor.lastValue.component).isEqualTo(component)
                assertThat(captor.lastValue.flags and Intent.FLAG_ACTIVITY_NEW_TASK).isNotEqualTo(0)
+9 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
package com.android.systemui.plugins;

import android.annotation.Nullable;
import android.app.ActivityOptions;
import android.app.PendingIntent;
import android.content.ComponentName;
import android.content.Intent;
@@ -184,6 +185,14 @@ public interface ActivityStarter {
            @Nullable String customMessage,
            Callback callback);

    /** Starts an activity with custom ActivityOptions and dismisses keyguard. */
    void startActivityDismissingKeyguard(Intent intent,
            boolean onlyProvisioned,
            boolean dismissShade,
            @Nullable String customMessage,
            ActivityOptions activityOptions,
            Callback callback);

    /** Starts an activity and dismisses keyguard. */
    void startActivityDismissingKeyguard(Intent intent,
            boolean onlyProvisioned,
+24 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>

<!--
  ~ Copyright (C) 2025 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<alpha
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1000"
    android:fromAlpha="0.0"
    android:toAlpha="1.0"
/>
+24 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>

<!--
  ~ Copyright (C) 2025 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<alpha
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1000"
    android:fromAlpha="1.0"
    android:toAlpha="0.0"
/>
+2 −1
Original line number Diff line number Diff line
@@ -1162,7 +1162,8 @@

    <style name="Theme.EditWidgetsActivity"
        parent="@android:style/Theme.DeviceDefault.NoActionBar.Fullscreen">
        <item name="android:windowBackground">@android:color/white</item>
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowBackground">@android:color/transparent</item>
    </style>

    <style name="TextAppearance.Control">
Loading