Loading packages/SystemUI/res/layout/keyguard_bottom_area.xml +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ <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" Loading Loading @@ -114,7 +113,8 @@ 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> packages/SystemUI/res/layout/status_bar_expanded.xml +0 −3 Original line number Diff line number Diff line Loading @@ -119,9 +119,6 @@ systemui:layout_constraintEnd_toEndOf="parent" /> <include layout="@layout/ambient_indication" android:id="@+id/ambient_indication_container" /> <include layout="@layout/photo_preview_overlay" /> <include Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +32 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ 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; Loading Loading @@ -150,6 +151,7 @@ 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; Loading Loading @@ -270,6 +272,29 @@ 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 Loading @@ -283,6 +308,7 @@ 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( Loading Loading @@ -901,6 +927,9 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL int burnInYOffset = getBurnInOffset(mBurnInYOffset * 2, false /* xAxis */) - mBurnInYOffset; mIndicationArea.setTranslationY(burnInYOffset * mDarkAmount); if (mAmbientIndicationArea != null) { mAmbientIndicationArea.setTranslationY(burnInYOffset * mDarkAmount); } } public void setAntiBurnInOffsetX(int burnInXOffset) { Loading @@ -909,6 +938,9 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL } mBurnInXOffset = burnInXOffset; mIndicationArea.setTranslationX(burnInXOffset); if (mAmbientIndicationArea != null) { mAmbientIndicationArea.setTranslationX(burnInXOffset); } } /** Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaTest.kt +2 −2 Original line number Diff line number Diff line Loading @@ -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() Loading Loading
packages/SystemUI/res/layout/keyguard_bottom_area.xml +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ <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" Loading Loading @@ -114,7 +113,8 @@ 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>
packages/SystemUI/res/layout/status_bar_expanded.xml +0 −3 Original line number Diff line number Diff line Loading @@ -119,9 +119,6 @@ systemui:layout_constraintEnd_toEndOf="parent" /> <include layout="@layout/ambient_indication" android:id="@+id/ambient_indication_container" /> <include layout="@layout/photo_preview_overlay" /> <include Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +32 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ 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; Loading Loading @@ -150,6 +151,7 @@ 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; Loading Loading @@ -270,6 +272,29 @@ 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 Loading @@ -283,6 +308,7 @@ 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( Loading Loading @@ -901,6 +927,9 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL int burnInYOffset = getBurnInOffset(mBurnInYOffset * 2, false /* xAxis */) - mBurnInYOffset; mIndicationArea.setTranslationY(burnInYOffset * mDarkAmount); if (mAmbientIndicationArea != null) { mAmbientIndicationArea.setTranslationY(burnInYOffset * mDarkAmount); } } public void setAntiBurnInOffsetX(int burnInXOffset) { Loading @@ -909,6 +938,9 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL } mBurnInXOffset = burnInXOffset; mIndicationArea.setTranslationX(burnInXOffset); if (mAmbientIndicationArea != null) { mAmbientIndicationArea.setTranslationX(burnInXOffset); } } /** Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaTest.kt +2 −2 Original line number Diff line number Diff line Loading @@ -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() Loading