Merge "Add padding to launcher layout" into qt-dev
diff --git a/tests/MultiDisplaySecondaryHomeTestLauncher/AndroidManifest.xml b/tests/MultiDisplaySecondaryHomeTestLauncher/AndroidManifest.xml
index d336672..e4d48ab 100644
--- a/tests/MultiDisplaySecondaryHomeTestLauncher/AndroidManifest.xml
+++ b/tests/MultiDisplaySecondaryHomeTestLauncher/AndroidManifest.xml
@@ -36,6 +36,4 @@
</intent-filter>
</activity>
</application>
-
-
</manifest>
diff --git a/tests/MultiDisplaySecondaryHomeTestLauncher/res/layout/app_picker_layout.xml b/tests/MultiDisplaySecondaryHomeTestLauncher/res/layout/app_picker_layout.xml
index e6c6b1e..bdc7b62 100644
--- a/tests/MultiDisplaySecondaryHomeTestLauncher/res/layout/app_picker_layout.xml
+++ b/tests/MultiDisplaySecondaryHomeTestLauncher/res/layout/app_picker_layout.xml
@@ -27,8 +27,10 @@
android:visibility="invisible">
<LinearLayout
+ android:id="@+id/FloatingSheetHeader"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:layout_marginTop = "@dimen/app_grid_margin_top"
android:layout_marginStart="@dimen/app_grid_margin_left"
android:layout_marginEnd="@dimen/app_grid_margin_right"
android:orientation="vertical">
diff --git a/tests/MultiDisplaySecondaryHomeTestLauncher/src/com/android/car/multidisplay/launcher/LauncherActivity.java b/tests/MultiDisplaySecondaryHomeTestLauncher/src/com/android/car/multidisplay/launcher/LauncherActivity.java
index d106343..5f51817 100644
--- a/tests/MultiDisplaySecondaryHomeTestLauncher/src/com/android/car/multidisplay/launcher/LauncherActivity.java
+++ b/tests/MultiDisplaySecondaryHomeTestLauncher/src/com/android/car/multidisplay/launcher/LauncherActivity.java
@@ -67,7 +67,9 @@
private Spinner mDisplaySpinner;
private ArrayAdapter<DisplayItem> mDisplayAdapter;
private int mSelectedDisplayId = Display.INVALID_DISPLAY;
+ private View mRootView;
private View mScrimView;
+ private View mAppDrawerHeader;
private AppListAdapter mAppListAdapter;
private AppListAdapter mPinnedAppListAdapter;
private CircularRevealCardView mAppDrawerView;
@@ -81,10 +83,21 @@
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
+ mRootView = findViewById(R.id.RootView);
mScrimView = findViewById(R.id.Scrim);
mAppDrawerView = findViewById(R.id.FloatingSheet);
- mFab = findViewById(R.id.FloatingActionButton);
+ // get system insets and apply padding accordingly to the content view
+ mRootView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
+ | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
+ mRootView.setOnApplyWindowInsetsListener((v, insets) -> {
+ mRootView.setPadding(0, 0, 0, insets.getSystemWindowInsetBottom());
+ mAppDrawerHeader = findViewById(R.id.FloatingSheetHeader);
+ mAppDrawerHeader.setPadding(0, insets.getSystemWindowInsetTop(), 0, 0);
+ return insets.consumeSystemWindowInsets();
+ });
+
+ mFab = findViewById(R.id.FloatingActionButton);
mFab.setOnClickListener((View v) -> {
showAppDrawer(true);
});