[E2E] Update the Settings Homepage for new E2E rule
This windowOptOutEdgeToEdgeEnforcement attribute doesn't support in 25Q2. Modify Settings Homepage to apply new rule of the Edge-to-Edge. Test: manual test Bug: 333998128 Flag: EXEMPT bugfix Change-Id: Idd3bbc94813d35044814115a7ece6f1787095f67
This commit is contained in:
@@ -69,7 +69,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingTop="@dimen/search_bar_container_top_padding"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
|
||||
|
@@ -87,6 +87,7 @@
|
||||
<dimen name="search_bar_padding_end_two_pane">24dp</dimen>
|
||||
<dimen name="search_bar_title_padding_start">-4dp</dimen>
|
||||
<dimen name="search_bar_title_padding_start_regular_two_pane">8dp</dimen>
|
||||
<dimen name="search_bar_container_top_padding">8dp</dimen>
|
||||
|
||||
<!-- Avatar -->
|
||||
<dimen name="avatar_length">48dp</dimen>
|
||||
|
@@ -190,9 +190,6 @@
|
||||
|
||||
<!-- Define this color for material design -->
|
||||
<item name="colorPrimaryVariant">@android:color/white</item>
|
||||
<!-- Workaround for E2E modification. -->
|
||||
<!-- TODO (b/328622648) waiting for new method instead of this attribute. -->
|
||||
<item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Settings.Home" parent="Theme.Settings.HomeBase">
|
||||
|
@@ -395,9 +395,18 @@ public class SettingsHomepageActivity extends FragmentActivity implements
|
||||
WindowCompat.setDecorFitsSystemWindows(getWindow(), false);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(android.R.id.content),
|
||||
(v, windowInsets) -> {
|
||||
Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()
|
||||
| WindowInsetsCompat.Type.displayCutout());
|
||||
// Apply the insets paddings to the view.
|
||||
v.setPadding(insets.left, insets.top, insets.right, insets.bottom);
|
||||
v.setPadding(insets.left, 0, insets.right, insets.bottom);
|
||||
|
||||
// reset the top padding of search bar container to original top padding
|
||||
// plus insets top.
|
||||
View container = findViewById(R.id.app_bar_container);
|
||||
final int top_padding = getResources().getDimensionPixelSize(
|
||||
R.dimen.search_bar_container_top_padding);
|
||||
container.setPadding(container.getPaddingLeft(), top_padding + insets.top,
|
||||
container.getPaddingRight(), container.getPaddingBottom());
|
||||
|
||||
// Return CONSUMED if you don't want the window insets to keep being
|
||||
// passed down to descendant views.
|
||||
@@ -466,8 +475,7 @@ public class SettingsHomepageActivity extends FragmentActivity implements
|
||||
: Utils.getColorAttrDefaultColor(this, android.R.attr.colorBackground);
|
||||
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
|
||||
// Update status bar color
|
||||
window.setStatusBarColor(color);
|
||||
|
||||
// Update content background.
|
||||
findViewById(android.R.id.content).setBackgroundColor(color);
|
||||
if (Flags.homepageRevamp()) {
|
||||
|
Reference in New Issue
Block a user