diff options
| author | 2021-11-30 20:33:51 +0000 | |
|---|---|---|
| committer | 2021-11-30 20:33:51 +0000 | |
| commit | a77c86905ab616f77360d6dbca148be39eaab15a (patch) | |
| tree | 480fe058828db56bc9fd11872836960fa45f6b08 | |
| parent | 6f556491e4b9f4709abf65a168744201172b0a57 (diff) | |
| parent | 300d2286c114aa5ffcff236b953f769a1703d396 (diff) | |
Merge "Revert "Update the ambient indication container"" into sc-v2-dev am: 300d2286c1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16366081
Change-Id: Idc07f93430ab702e256919a53bf07d523d373652
4 files changed, 7 insertions, 32 deletions
diff --git a/packages/SystemUI/res/layout/keyguard_bottom_area.xml b/packages/SystemUI/res/layout/keyguard_bottom_area.xml index 759670e01e71..8dbd59d42ab7 100644 --- a/packages/SystemUI/res/layout/keyguard_bottom_area.xml +++ b/packages/SystemUI/res/layout/keyguard_bottom_area.xml @@ -17,6 +17,7 @@ <com.android.systemui.statusbar.phone.KeyguardBottomAreaView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui" android:id="@+id/keyguard_bottom_area" android:layout_height="match_parent" android:layout_width="match_parent" @@ -113,8 +114,7 @@ android:layout_height="match_parent"> <include layout="@layout/keyguard_bottom_area_overlay" /> + </FrameLayout> - <include layout="@layout/ambient_indication" - android:id="@+id/ambient_indication_container" /> </com.android.systemui.statusbar.phone.KeyguardBottomAreaView> diff --git a/packages/SystemUI/res/layout/status_bar_expanded.xml b/packages/SystemUI/res/layout/status_bar_expanded.xml index 591d8f52c4be..82186c13394e 100644 --- a/packages/SystemUI/res/layout/status_bar_expanded.xml +++ b/packages/SystemUI/res/layout/status_bar_expanded.xml @@ -119,6 +119,9 @@ systemui:layout_constraintEnd_toEndOf="parent" /> + <include layout="@layout/ambient_indication" + android:id="@+id/ambient_indication_container" /> + <include layout="@layout/photo_preview_overlay" /> <include diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java index d27b5fcf598a..e26f75f7ce40 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java @@ -71,7 +71,6 @@ import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.widget.LockPatternUtils; @@ -151,7 +150,6 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL private ControlsComponent mControlsComponent; private boolean mControlServicesAvailable = false; - @Nullable private View mAmbientIndicationArea; private ViewGroup mIndicationArea; private TextView mIndicationText; private TextView mIndicationTextBottom; @@ -272,29 +270,6 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL public void initFrom(KeyguardBottomAreaView oldBottomArea) { setStatusBar(oldBottomArea.mStatusBar); - - // if it exists, continue to use the original ambient indication container - // instead of the newly inflated one - if (mAmbientIndicationArea != null) { - // remove old ambient indication from its parent - View originalAmbientIndicationView = - oldBottomArea.findViewById(R.id.ambient_indication_container); - ((ViewGroup) originalAmbientIndicationView.getParent()) - .removeView(originalAmbientIndicationView); - - // remove current ambient indication from its parent (discard) - ViewGroup ambientIndicationParent = (ViewGroup) mAmbientIndicationArea.getParent(); - int ambientIndicationIndex = - ambientIndicationParent.indexOfChild(mAmbientIndicationArea); - ambientIndicationParent.removeView(mAmbientIndicationArea); - - // add the old ambient indication to this view - ambientIndicationParent.addView(originalAmbientIndicationView, ambientIndicationIndex); - mAmbientIndicationArea = originalAmbientIndicationView; - - // update burn-in offsets - dozeTimeTick(); - } } @Override @@ -308,7 +283,6 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL mWalletButton = findViewById(R.id.wallet_button); mControlsButton = findViewById(R.id.controls_button); mIndicationArea = findViewById(R.id.keyguard_indication_area); - mAmbientIndicationArea = findViewById(R.id.ambient_indication_container); mIndicationText = findViewById(R.id.keyguard_indication_text); mIndicationTextBottom = findViewById(R.id.keyguard_indication_text_bottom); mIndicationBottomMargin = getResources().getDimensionPixelSize( @@ -927,7 +901,6 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL int burnInYOffset = getBurnInOffset(mBurnInYOffset * 2, false /* xAxis */) - mBurnInYOffset; mIndicationArea.setTranslationY(burnInYOffset * mDarkAmount); - mAmbientIndicationArea.setTranslationY(burnInYOffset * mDarkAmount); } public void setAntiBurnInOffsetX(int burnInXOffset) { @@ -936,7 +909,6 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL } mBurnInXOffset = burnInXOffset; mIndicationArea.setTranslationX(burnInXOffset); - mAmbientIndicationArea.setTranslationX(burnInXOffset); } /** diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaTest.kt index 3257a84f14d6..210744eb30cf 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaTest.kt @@ -47,8 +47,8 @@ class KeyguardBottomAreaTest : SysuiTestCase() { @Test fun initFrom_doesntCrash() { - val other = LayoutInflater.from(mContext).inflate(R.layout.keyguard_bottom_area, - null, false) as KeyguardBottomAreaView + val other = LayoutInflater.from(mContext).inflate( + R.layout.keyguard_bottom_area, null, false) as KeyguardBottomAreaView other.initFrom(mKeyguardBottomArea) other.launchVoiceAssist() |