mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 23:36:47 +00:00
Merge "Create settings activity layout with explicit toolbar" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
d9463fbfdd
34
res/layout/settings_activity.xml
Normal file
34
res/layout/settings_activity.xml
Normal 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>
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user