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

Commit 270e0e33 authored by Justin Klaassen's avatar Justin Klaassen
Browse files

Material Settings on pre-M devices

Bug: 28848704
Bug: 28870690

- Fixed a crash caused by using getChildFragmentManager() in
  PrefsFragment.
- Fixed an issue where the timer ringtone summary would not update
  immediately.
- Fixed an issue where the back button would remove the PrefsFragment
  instead of closing the SettingsActivity.

Change-Id: I1a82010b975fe159dd40d96fafbdea4a3bb86183
parent d2f209bf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@
        android:layout_height="wrap_content"
        android:ellipsize="marquee"
        android:singleLine="true"
        android:textAppearance="?android:attr/textAppearanceListItem"/>
        android:textAppearance="@style/Preference_TextAppearanceMaterialSubhead"/>

    <LinearLayout
        android:layout_width="match_parent"
+5 −1
Original line number Diff line number Diff line
@@ -16,6 +16,10 @@

<resources xmlns:tools="http://schemas.android.com/tools">

    <style name="SettingsAlertDialogTheme" parent="android:Theme.Material.Dialog.Alert">
        <item name="android:colorAccent">?attr/colorAccent</item>
    </style>

    <!-- Custom notification content styles -->
    <!-- copied TextAppearance.Material.Button -->
    <style name="TextAppearance.StatusBar.EventContent.Action">
@@ -59,7 +63,7 @@
        <item name="android:fontFamily">sans-serif-medium</item>
    </style>

    <style name="CitiesTheme" parent="TranslucentDecorActivityTheme">
    <style name="CitiesTheme" parent="BaseActivityTheme">
        <item name="android:fastScrollThumbDrawable">@drawable/fastscroll_thumb</item>
        <item name="android:fastScrollTrackDrawable">@drawable/fastscroll_track</item>
        <item name="actionBarStyle">@style/CitiesActionBarStyle</item>
+3 −1
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <style name="SettingsAlertDialogTheme" parent="android:ThemeOverlay.Material.Dialog.Alert" />

    <style name="widget_big_thin" parent="big_thin">
        <item name="android:fontFamily">sans-serif-light</item>
        <item name="android:shadowRadius">@dimen/widget_shadow_radius</item>
+3 −0
Original line number Diff line number Diff line
@@ -49,4 +49,7 @@

    <!-- shadowColor for widget text -->
    <color name="widget_shadow_color">#67000000</color>

    <!-- Redefine the fallback color used by preference-v14 to match our accent color. -->
    <color name="preference_fallback_accent_color">@color/color_accent</color>
</resources>
+26 −19
Original line number Diff line number Diff line
@@ -16,8 +16,11 @@

<resources xmlns:tools="http://schemas.android.com/tools">

    <style name="BaseActivityTheme" parent="Theme.AppCompat">
    <style name="BaseActivityTheme" parent="Theme.AppCompat.NoActionBar">
        <item name="android:windowBackground">@color/default_background</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:windowTranslucentStatus">true</item>
        <item name="android:windowTranslucentNavigation">true</item>

        <item name="alertDialogTheme">@style/AlertDialogTheme</item>
        <item name="colorAccent">@color/color_accent</item>
@@ -27,16 +30,6 @@
        <item name="imageButtonStyle">@style/ImageButtonStyle</item>
    </style>

    <style name="TranslucentDecorActivityTheme" parent="BaseActivityTheme">
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:windowTranslucentStatus">true</item>
        <item name="android:windowTranslucentNavigation">true</item>

        <!-- Attributes from support.v7.appcompat -->
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>

    <style name="AlertDialogTheme" parent="Theme.AppCompat.Dialog.Alert">
        <!-- Attributes from support.v7.appcompat -->
        <item name="colorAccent">@color/color_accent</item>
@@ -58,26 +51,40 @@
        <item name="android:gravity">center</item>
    </style>

    <style name="SettingsTheme" parent="TranslucentDecorActivityTheme">
    <style name="SettingsTheme" parent="BaseActivityTheme">
        <item name="android:alertDialogTheme">@style/SettingsAlertDialogTheme</item>
        <item name="android:detailsElementBackground">@null</item>

        <!-- Attributes from support.v7.appcompat -->
        <item name="actionBarStyle">@style/SettingsActionBarStyle</item>
        <item name="alertDialogTheme">@style/AlertDialogTheme</item>
        <item name="colorControlActivated">?attr/colorAccent</item>
        <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
        <item name="preferenceTheme">@style/SettingsPreferenceTheme</item>
        <item name="windowActionBar">true</item>
        <item name="windowNoTitle">false</item>
    </style>

    <style name="SettingsActionBarStyle" parent="@style/Widget.AppCompat.Toolbar">
    <style name="SettingsActionBarStyle" parent="Widget.AppCompat.Toolbar">
        <item name="android:background">@null</item>

        <!-- Attributes from support.v7.appcompat -->
        <item name="displayOptions">showTitle|homeAsUp</item>
    </style>

    <style name="CitiesTheme" parent="TranslucentDecorActivityTheme">
    <style name="SettingsAlertDialogTheme" parent="android:Theme.Holo.Dialog.MinWidth">
        <item name="android:windowBackground">@android:color/transparent</item>
    </style>

    <style name="SettingsPreferenceTheme" parent="PreferenceThemeOverlay.v14.Material">
        <!-- Attributes from support.v7.preference -->
        <item name="preferenceFragmentStyle">@style/SettingsPreferenceFragmentStyle</item>
    </style>

    <style name="SettingsPreferenceFragmentStyle" parent="PreferenceFragment.Material">
        <item name="android:divider">@color/hairline</item>
        <item name="android:dividerHeight">@dimen/hairline_height</item>
    </style>

    <style name="CitiesTheme" parent="BaseActivityTheme">
        <item name="android:fastScrollPreviewBackgroundLeft">@drawable/fastscroll_preview</item>
        <item name="android:fastScrollPreviewBackgroundRight">@drawable/fastscroll_preview</item>
        <item name="android:fastScrollTextColor">@color/white</item>
@@ -96,11 +103,11 @@
        <item name="displayOptions">homeAsUp</item>
    </style>

    <style name="AlarmAlertFullScreenTheme" parent="TranslucentDecorActivityTheme" />
    <style name="AlarmAlertFullScreenTheme" parent="BaseActivityTheme" />

    <style name="DeskClockTheme" parent="TranslucentDecorActivityTheme" />
    <style name="DeskClockTheme" parent="BaseActivityTheme" />

    <style name="ExpiredTimersActivityTheme" parent="TranslucentDecorActivityTheme" />
    <style name="ExpiredTimersActivityTheme" parent="BaseActivityTheme" />

    <style name="ScreensaverActivityTheme" parent="Theme.AppCompat.NoActionBar" />

Loading