Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08fdf4d2 authored by Brian Isganitis's avatar Brian Isganitis
Browse files

Create settings activity layout with explicit toolbar

This layout will be overridden to have a collapsible toolbar on API 31.

Test: Settings layout unchanged
Bug: 187732263
Change-Id: I0c098dd0a09a1787a10035a3d3f35ecf461cfc20
parent 8d6ca687
Loading
Loading
Loading
Loading
+34 −0
Original line number Diff line number Diff line
<?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>
 No newline at end of file
+2 −0
Original line number Diff line number Diff line
@@ -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>

+3 −1
Original line number Diff line number Diff line
@@ -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);
    }