Merge "Create settings activity layout with explicit toolbar" into sc-dev am: d9463fbfdd am: dc07ef153c

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

Change-Id: I43757dc5ee9a29d399f2841a3f09e082b54cf23e
This commit is contained in:
Brian Isganitis
2021-06-01 20:42:41 +00:00
committed by Automerger Merge Worker
3 changed files with 39 additions and 1 deletions
+34
View File
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2021 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/content_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Toolbar
android:id="@+id/action_bar"
style="?android:attr/actionBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="?android:attr/actionBarTheme" />
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
+2
View File
@@ -156,6 +156,8 @@
<style name="HomeSettingsTheme" parent="@android:style/Theme.DeviceDefault.Settings">
<item name="android:navigationBarColor">?android:colorPrimaryDark</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="preferenceTheme">@style/HomeSettingsPreferenceTheme</item>
</style>
@@ -80,6 +80,8 @@ public class SettingsActivity extends FragmentActivity
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.settings_activity);
setActionBar(findViewById(R.id.action_bar));
if (savedInstanceState == null) {
Intent intent = getIntent();
@@ -98,7 +100,7 @@ public class SettingsActivity extends FragmentActivity
getPreferenceFragment());
f.setArguments(args);
// Display the fragment as the main content.
fm.beginTransaction().replace(android.R.id.content, f).commit();
fm.beginTransaction().replace(R.id.content_frame, f).commit();
}
Utilities.getPrefs(getApplicationContext()).registerOnSharedPreferenceChangeListener(this);
}