diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-10-28 14:29:14 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2015-10-28 14:30:01 -0700 |
commit | 097db343a47df5e70692f485a034e179f9a32fe7 (patch) | |
tree | 00061773a341d4f63c35cde854f4059bc2f67548 | |
parent | c3d76582b656fdabc92a470ebe0d986b58c44751 (diff) | |
download | android_packages_apps_Trebuchet-097db343a47df5e70692f485a034e179f9a32fe7.tar.gz android_packages_apps_Trebuchet-097db343a47df5e70692f485a034e179f9a32fe7.tar.bz2 android_packages_apps_Trebuchet-097db343a47df5e70692f485a034e179f9a32fe7.zip |
Setting statusbar and nav bar colors in theme instead of code
Change-Id: I4da50809d14f5fa4e47df47fcfd99df7b713950d
-rw-r--r-- | WallpaperPicker/res/values-sw720dp-v19/styles.xml | 26 | ||||
-rw-r--r-- | WallpaperPicker/res/values-sw720dp/styles.xml | 6 | ||||
-rw-r--r-- | WallpaperPicker/res/values-v21/styles.xml | 4 | ||||
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 22 |
4 files changed, 7 insertions, 51 deletions
diff --git a/WallpaperPicker/res/values-sw720dp-v19/styles.xml b/WallpaperPicker/res/values-sw720dp-v19/styles.xml deleted file mode 100644 index d8dab223a..000000000 --- a/WallpaperPicker/res/values-sw720dp-v19/styles.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/* -* Copyright (C) 2013 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. -*/ ---> - -<resources> - <style name="Theme" parent="@android:style/Theme.DeviceDefault.Wallpaper.NoTitleBar"> - <item name="android:windowActionModeOverlay">true</item> - <item name="android:windowTranslucentStatus">true</item> - <item name="android:windowTranslucentNavigation">true</item> - </style> -</resources> diff --git a/WallpaperPicker/res/values-sw720dp/styles.xml b/WallpaperPicker/res/values-sw720dp/styles.xml index 12f8884f1..0058f7e38 100644 --- a/WallpaperPicker/res/values-sw720dp/styles.xml +++ b/WallpaperPicker/res/values-sw720dp/styles.xml @@ -18,7 +18,11 @@ --> <resources> - <style name="Theme" parent="@android:style/Theme.DeviceDefault.Wallpaper.NoTitleBar"> + <style name="BaseWallpaperTheme" parent="@android:style/Theme.DeviceDefault.Light.NoActionBar"> + <item name="android:windowBackground">@android:color/transparent</item> + <item name="android:colorBackgroundCacheHint">@null</item> + <item name="android:windowShowWallpaper">true</item> + <item name="android:windowNoTitle">true</item> <item name="android:windowActionModeOverlay">true</item> </style> </resources> diff --git a/WallpaperPicker/res/values-v21/styles.xml b/WallpaperPicker/res/values-v21/styles.xml index 70220edb9..de4b2f2af 100644 --- a/WallpaperPicker/res/values-v21/styles.xml +++ b/WallpaperPicker/res/values-v21/styles.xml @@ -34,8 +34,8 @@ </style> <style name="Theme" parent="@style/BaseWallpaperTheme"> - <item name="android:windowTranslucentStatus">true</item> - <item name="android:windowTranslucentNavigation">true</item> + <item name="android:statusBarColor">#00000000</item> + <item name="android:navigationBarColor">#00000000</item> <item name="android:colorControlActivated">@color/launcher_accent_color</item> <item name="android:colorAccent">@color/launcher_accent_color</item> <item name="android:colorPrimary">@color/launcher_accent_color</item> diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index d2581414d..d3934e6bc 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -84,7 +84,6 @@ import android.view.View.OnLongClickListener; import android.view.ViewGroup; import android.view.ViewStub; import android.view.ViewTreeObserver; -import android.view.Window; import android.view.WindowManager; import android.view.accessibility.AccessibilityEvent; import android.view.animation.OvershootInterpolator; @@ -1683,31 +1682,10 @@ public class Launcher extends Activity } registerReceiver(mReceiver, filter); FirstFrameAnimatorHelper.initializeDrawListener(getWindow().getDecorView()); - setupTransparentSystemBarsForLollipop(); mAttached = true; mVisible = true; } - /** - * Sets up transparent navigation and status bars in Lollipop. - * This method is a no-op for other platform versions. - */ - @TargetApi(Build.VERSION_CODES.LOLLIPOP) - private void setupTransparentSystemBarsForLollipop() { - if (Utilities.ATLEAST_LOLLIPOP) { - Window window = getWindow(); - window.getAttributes().systemUiVisibility |= - (View.SYSTEM_UI_FLAG_LAYOUT_STABLE - | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN - | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION); - window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS - | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); - window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); - window.setStatusBarColor(Color.TRANSPARENT); - window.setNavigationBarColor(Color.TRANSPARENT); - } - } - @Override public void onDetachedFromWindow() { super.onDetachedFromWindow(); |