Merge "Fix layout issues in suw all set page" into udc-dev am: 8ee4ad6604 am: 1bbeadbdcd

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/23502666

Change-Id: I0897b3686f815a950f66ccb926f4951ed3b06217
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Schneider Victor-tulias
2023-06-08 19:46:43 +00:00
committed by Automerger Merge Worker
4 changed files with 55 additions and 92 deletions
@@ -95,15 +95,11 @@ public class AllSetActivity extends Activity {
private static final float ANIMATION_PAUSE_ALPHA_THRESHOLD = 0.1f;
private final Rect mTempSettingsBounds = new Rect();
private final Rect mTempInclusionBounds = new Rect();
private final Rect mTempExclusionBounds = new Rect();
private TISBindHelper mTISBindHelper;
private final AnimatedFloat mSwipeProgress = new AnimatedFloat(this::onSwipeProgressUpdate);
private BgDrawable mBackground;
private View mContentView;
private View mRootView;
private float mSwipeUpShift;
@Nullable private Vibrator mVibrator;
@@ -116,7 +112,8 @@ public class AllSetActivity extends Activity {
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_allset);
findViewById(R.id.root_view).setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
mRootView = findViewById(R.id.root_view);
mRootView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
@@ -131,8 +128,7 @@ public class AllSetActivity extends Activity {
((ImageView) findViewById(R.id.icon)).getDrawable().mutate().setTint(accentColor);
mBackground = new BgDrawable(this);
findViewById(R.id.root_view).setBackground(mBackground);
mContentView = findViewById(R.id.content_view);
mRootView.setBackground(mBackground);
mSwipeUpShift = resources.getDimension(R.dimen.allset_swipe_up_shift);
TextView subtitle = findViewById(R.id.subtitle);
@@ -160,34 +156,6 @@ public class AllSetActivity extends Activity {
}
hint.setAccessibilityDelegate(new SkipButtonAccessibilityDelegate());
View textContent = findViewById(R.id.text_content_view);
textContent.addOnLayoutChangeListener(
(v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> {
mTempSettingsBounds.set(
settings.getLeft(),
settings.getTop(),
settings.getRight(),
settings.getBottom());
mTempInclusionBounds.set(
0,
// Do not allow overlapping with the subtitle text
subtitle.getBottom(),
textContent.getWidth(),
textContent.getHeight());
mTempExclusionBounds.set(
hint.getLeft(),
hint.getTop(),
hint.getRight(),
hint.getBottom());
Utilities.translateOverlappingView(
settings,
mTempSettingsBounds,
mTempInclusionBounds,
mTempExclusionBounds,
Utilities.TRANSLATE_UP);
});
mTISBindHelper = new TISBindHelper(this, this::onTISConnected);
mVibrator = getSystemService(Vibrator.class);
@@ -356,8 +324,8 @@ public class AllSetActivity extends Activity {
private void onSwipeProgressUpdate() {
mBackground.setProgress(mSwipeProgress.value);
float alpha = getContentViewAlphaForSwipeProgress();
mContentView.setAlpha(alpha);
mContentView.setTranslationY((alpha - 1) * mSwipeUpShift);
mRootView.setAlpha(alpha);
mRootView.setTranslationY((alpha - 1) * mSwipeUpShift);
TaskbarManager taskbarManager = mTISBindHelper.getTaskbarManager();
if (mLauncherStartAnim == null && taskbarManager != null) {