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

Commit bd88f396 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Defining a base theme, which can be overriden by derivative projects without

affecting launcher theme

Bug: 70220582
Change-Id: Ie3069686be5e6a42910e90541db2d6b5b79e25c1
parent 53d57998
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -56,7 +56,7 @@
        android:hardwareAccelerated="true"
        android:hardwareAccelerated="true"
        android:icon="@drawable/ic_launcher_home"
        android:icon="@drawable/ic_launcher_home"
        android:label="@string/derived_app_name"
        android:label="@string/derived_app_name"
        android:theme="@style/LauncherTheme"
        android:theme="@style/AppTheme"
        android:largeHeap="@bool/config_largeHeap"
        android:largeHeap="@bool/config_largeHeap"
        android:restoreAnyVersion="true"
        android:restoreAnyVersion="true"
        android:supportsRtl="true" >
        android:supportsRtl="true" >
+1 −1
Original line number Original line Diff line number Diff line
@@ -31,7 +31,7 @@
        android:hardwareAccelerated="true"
        android:hardwareAccelerated="true"
        android:icon="@drawable/ic_launcher_home"
        android:icon="@drawable/ic_launcher_home"
        android:label="@string/derived_app_name"
        android:label="@string/derived_app_name"
        android:theme="@style/LauncherTheme"
        android:theme="@style/AppTheme"
        android:largeHeap="@bool/config_largeHeap"
        android:largeHeap="@bool/config_largeHeap"
        android:restoreAnyVersion="true"
        android:restoreAnyVersion="true"
        android:supportsRtl="true" >
        android:supportsRtl="true" >
+1 −1
Original line number Original line Diff line number Diff line
@@ -21,7 +21,7 @@
    <style name="WidgetContainerTheme" parent="@android:style/Theme.DeviceDefault.Settings">
    <style name="WidgetContainerTheme" parent="@android:style/Theme.DeviceDefault.Settings">
        <item name="android:colorEdgeEffect">?android:attr/textColorSecondary</item>
        <item name="android:colorEdgeEffect">?android:attr/textColorSecondary</item>
    </style>
    </style>
    <style name="WidgetContainerTheme.Dark" parent="LauncherThemeDark">
    <style name="WidgetContainerTheme.Dark" parent="AppTheme.Dark">
        <item name="android:colorEdgeEffect">?android:attr/textColorSecondary</item>
        <item name="android:colorEdgeEffect">?android:attr/textColorSecondary</item>
        <item name="android:colorPrimaryDark">#616161</item> <!-- Gray 700 -->
        <item name="android:colorPrimaryDark">#616161</item> <!-- Gray 700 -->
    </style>
    </style>
+9 −2
Original line number Original line Diff line number Diff line
@@ -56,7 +56,7 @@
        <item name="workspaceStatusBarScrim">@null</item>
        <item name="workspaceStatusBarScrim">@null</item>
    </style>
    </style>


    <style name="LauncherThemeDark" parent="@style/LauncherTheme">
    <style name="LauncherTheme.Dark" parent="@style/LauncherTheme">
        <item name="android:textColorPrimary">#FFFFFFFF</item>
        <item name="android:textColorPrimary">#FFFFFFFF</item>
        <item name="android:textColorSecondary">#FFFFFFFF</item>
        <item name="android:textColorSecondary">#FFFFFFFF</item>
        <item name="android:textColorTertiary">#CCFFFFFF</item>
        <item name="android:textColorTertiary">#CCFFFFFF</item>
@@ -73,7 +73,7 @@
        <item name="isMainColorDark">true</item>
        <item name="isMainColorDark">true</item>
    </style>
    </style>


    <style name="LauncherThemeDark.DarKText" parent="@style/LauncherThemeDark">
    <style name="LauncherTheme.Dark.DarkText" parent="@style/LauncherTheme.Dark">
        <item name="allAppsInterimScrimAlpha">25</item>
        <item name="allAppsInterimScrimAlpha">25</item>
        <item name="workspaceTextColor">#FF212121</item>
        <item name="workspaceTextColor">#FF212121</item>
        <item name="workspaceShadowColor">@android:color/transparent</item>
        <item name="workspaceShadowColor">@android:color/transparent</item>
@@ -83,6 +83,13 @@
        <item name="workspaceStatusBarScrim">@null</item>
        <item name="workspaceStatusBarScrim">@null</item>
    </style>
    </style>


    <!-- A derivative project can extend these themes to customize the application theme without
         affecting the base theme -->
    <style name="AppTheme" parent="@style/LauncherTheme" />
    <style name="AppTheme.DarkText" parent="@style/LauncherTheme.DarkText" />
    <style name="AppTheme.Dark" parent="@style/LauncherTheme.Dark" />
    <style name="AppTheme.Dark.DarkText" parent="@style/LauncherTheme.Dark.DarkText" />

    <!--
    <!--
    Theme overrides to element on homescreen, i.e., which are drawn on top on wallpaper.
    Theme overrides to element on homescreen, i.e., which are drawn on top on wallpaper.
    Various foreground colors are overridden to be workspaceTextColor so that they are properly
    Various foreground colors are overridden to be workspaceTextColor so that they are properly
+3 −3
Original line number Original line Diff line number Diff line
@@ -61,7 +61,7 @@ public abstract class BaseDraggingActivity extends BaseActivity


    private OnStartCallback mOnStartCallback;
    private OnStartCallback mOnStartCallback;


    private int mThemeRes = R.style.LauncherTheme;
    private int mThemeRes = R.style.AppTheme;


    private DisplayRotationListener mRotationListener;
    private DisplayRotationListener mRotationListener;


@@ -91,10 +91,10 @@ public abstract class BaseDraggingActivity extends BaseActivity
    protected int getThemeRes(WallpaperColorInfo wallpaperColorInfo) {
    protected int getThemeRes(WallpaperColorInfo wallpaperColorInfo) {
        if (wallpaperColorInfo.isDark()) {
        if (wallpaperColorInfo.isDark()) {
            return wallpaperColorInfo.supportsDarkText() ?
            return wallpaperColorInfo.supportsDarkText() ?
                    R.style.LauncherThemeDark_DarKText : R.style.LauncherThemeDark;
                    R.style.AppTheme_Dark_DarkText : R.style.AppTheme_Dark;
        } else {
        } else {
            return wallpaperColorInfo.supportsDarkText() ?
            return wallpaperColorInfo.supportsDarkText() ?
                    R.style.LauncherTheme_DarkText : R.style.LauncherTheme;
                    R.style.AppTheme_DarkText : R.style.AppTheme;
        }
        }
    }
    }