diff options
-rw-r--r-- | AndroidManifest.xml | 2 | ||||
-rw-r--r-- | WallpaperPicker/res/values-v19/styles.xml | 5 | ||||
-rw-r--r-- | WallpaperPicker/res/values-v21/styles.xml | 8 | ||||
-rw-r--r-- | WallpaperPicker/res/values/colors.xml | 2 | ||||
-rw-r--r-- | WallpaperPicker/res/values/styles.xml | 9 | ||||
-rw-r--r-- | res/layout/all_apps_container.xml | 2 | ||||
-rw-r--r-- | res/layout/widgets_list_row_view.xml | 2 | ||||
-rw-r--r-- | res/layout/widgets_view.xml | 2 | ||||
-rw-r--r-- | res/values-sw720dp/styles.xml | 8 | ||||
-rw-r--r-- | res/values-v19/styles.xml (renamed from WallpaperPicker/res/values-sw720dp/styles.xml) | 16 | ||||
-rw-r--r-- | res/values-v21/styles.xml | 28 | ||||
-rw-r--r-- | res/values/colors.xml | 1 | ||||
-rw-r--r-- | res/values/styles.xml | 18 | ||||
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 3 | ||||
-rw-r--r-- | src/com/android/launcher3/util/WallpaperUtils.java | 2 |
15 files changed, 68 insertions, 40 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 1981b13a2..bce71209d 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -76,7 +76,7 @@ android:launchMode="singleTask" android:clearTaskOnLaunch="true" android:stateNotNeeded="true" - android:theme="@style/Theme" + android:theme="@style/LauncherTheme" android:windowSoftInputMode="adjustPan" android:screenOrientation="nosensor" android:configChanges="keyboard|keyboardHidden|navigation" diff --git a/WallpaperPicker/res/values-v19/styles.xml b/WallpaperPicker/res/values-v19/styles.xml index 15fb0ea2a..b465b4e7a 100644 --- a/WallpaperPicker/res/values-v19/styles.xml +++ b/WallpaperPicker/res/values-v19/styles.xml @@ -24,9 +24,4 @@ <item name="android:windowActionBarOverlay">true</item> <item name="android:windowTranslucentNavigation">true</item> </style> - - <style name="Theme" parent="@style/BaseWallpaperTheme"> - <item name="android:windowTranslucentStatus">true</item> - <item name="android:windowTranslucentNavigation">true</item> - </style> </resources> diff --git a/WallpaperPicker/res/values-v21/styles.xml b/WallpaperPicker/res/values-v21/styles.xml index de4b2f2af..271fc2e4e 100644 --- a/WallpaperPicker/res/values-v21/styles.xml +++ b/WallpaperPicker/res/values-v21/styles.xml @@ -32,12 +32,4 @@ <item name="android:textColor">#ffffffff</item> <item name="android:background">?android:attr/selectableItemBackgroundBorderless</item> </style> - - <style name="Theme" parent="@style/BaseWallpaperTheme"> - <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> - </style> </resources>
\ No newline at end of file diff --git a/WallpaperPicker/res/values/colors.xml b/WallpaperPicker/res/values/colors.xml index 6ba32f06d..adae7cff6 100644 --- a/WallpaperPicker/res/values/colors.xml +++ b/WallpaperPicker/res/values/colors.xml @@ -19,6 +19,4 @@ --> <resources> <color name="wallpaper_picker_translucent_gray">#66000000</color> - - <color name="launcher_accent_color">#ff009688</color> </resources> diff --git a/WallpaperPicker/res/values/styles.xml b/WallpaperPicker/res/values/styles.xml index d1c945a32..6c77d0a16 100644 --- a/WallpaperPicker/res/values/styles.xml +++ b/WallpaperPicker/res/values/styles.xml @@ -35,15 +35,6 @@ <item name="android:background">#88000000</item> </style> - <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> - </style> - - <style name="Theme" parent="@style/BaseWallpaperTheme"></style> - <style name="ActionBarSetWallpaperStyle" parent="@android:style/Widget.DeviceDefault.ActionButton"> <item name="android:textColor">#ffffffff</item> <item name="android:background">?android:attr/selectableItemBackground</item> diff --git a/res/layout/all_apps_container.xml b/res/layout/all_apps_container.xml index 626edafab..c0525ee2b 100644 --- a/res/layout/all_apps_container.xml +++ b/res/layout/all_apps_container.xml @@ -27,7 +27,7 @@ <!-- DO NOT CHANGE THE ID --> <com.android.launcher3.allapps.AllAppsRecyclerView android:id="@+id/apps_list_view" - android:theme="@style/Theme.Light.CustomOverscroll" + android:theme="@style/CustomOverscroll.Light" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center_horizontal|top" diff --git a/res/layout/widgets_list_row_view.xml b/res/layout/widgets_list_row_view.xml index 1d593dfd1..b7f76a66a 100644 --- a/res/layout/widgets_list_row_view.xml +++ b/res/layout/widgets_list_row_view.xml @@ -51,7 +51,7 @@ <HorizontalScrollView android:id="@+id/widgets_scroll_container" - android:theme="@style/Theme.Dark.CustomOverscroll" + android:theme="@style/CustomOverscroll.Dark" android:layout_width="wrap_content" android:layout_height="wrap_content" android:scrollbars="none"> diff --git a/res/layout/widgets_view.xml b/res/layout/widgets_view.xml index e64f83ae1..cc513ab36 100644 --- a/res/layout/widgets_view.xml +++ b/res/layout/widgets_view.xml @@ -36,7 +36,7 @@ <com.android.launcher3.widget.WidgetsRecyclerView android:id="@+id/main_content" - android:theme="@style/Theme.Dark.CustomOverscroll" + android:theme="@style/CustomOverscroll.Dark" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center" diff --git a/res/values-sw720dp/styles.xml b/res/values-sw720dp/styles.xml index b7a16f3a7..1fdb267c7 100644 --- a/res/values-sw720dp/styles.xml +++ b/res/values-sw720dp/styles.xml @@ -19,6 +19,14 @@ <resources> + <style name="BaseLauncherTheme" 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> + <!-- Workspace --> <style name="DropTargetButtonContainer"> <item name="android:layout_width">0dp</item> diff --git a/WallpaperPicker/res/values-sw720dp/styles.xml b/res/values-v19/styles.xml index 0058f7e38..cfc7c0f9c 100644 --- a/WallpaperPicker/res/values-sw720dp/styles.xml +++ b/res/values-v19/styles.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <!-- /* -* Copyright (C) 2013 The Android Open Source Project +* Copyright (C) 2016 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. @@ -16,13 +16,11 @@ * limitations under the License. */ --> - <resources> - <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 name="LauncherTheme" parent="@style/BaseLauncherTheme"> + <item name="android:windowTranslucentStatus">true</item> + <item name="android:windowTranslucentNavigation">true</item> </style> -</resources> + +</resources>
\ No newline at end of file diff --git a/res/values-v21/styles.xml b/res/values-v21/styles.xml new file mode 100644 index 000000000..bc8523ecc --- /dev/null +++ b/res/values-v21/styles.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +* Copyright (C) 2016 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="LauncherTheme" parent="@style/BaseLauncherTheme"> + <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> + </style> +</resources>
\ No newline at end of file diff --git a/res/values/colors.xml b/res/values/colors.xml index 8a7f62743..b6792704a 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -37,6 +37,7 @@ <color name="quantum_panel_bg_color_dark">#FF374248</color> <color name="outline_color">#FFFFFFFF</color> + <color name="launcher_accent_color">#ff009688</color> <!-- Containers --> <color name="container_fastscroll_thumb_inactive_color">#009688</color> diff --git a/res/values/styles.xml b/res/values/styles.xml index c03f08d4e..35a90884a 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -18,14 +18,26 @@ --> <resources> - <style name="Theme.Light.CustomOverscroll" parent="@android:style/Theme.DeviceDefault"> + <!-- Launcher theme --> + <style name="BaseLauncherTheme" 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> + </style> + + <style name="LauncherTheme" parent="@style/BaseLauncherTheme"></style> + + <!-- Overscroll effect --> + <style name="CustomOverscroll.Light" parent="@android:style/Theme.DeviceDefault"> <item name="android:colorEdgeEffect">@color/folder_edge_effect_color</item> </style> - <style name="Theme.Dark.CustomOverscroll" parent="@android:style/Theme.DeviceDefault"> + <style name="CustomOverscroll.Dark" parent="@android:style/Theme.DeviceDefault"> <item name="android:colorEdgeEffect">@color/workspace_edge_effect_color</item> </style> + <!-- Different icons --> <style name="Icon"> <item name="android:layout_width">match_parent</item> <item name="android:layout_height">match_parent</item> @@ -56,6 +68,7 @@ <item name="customShadows">false</item> </style> + <!-- Drop targets --> <style name="DropTargetButtonContainer"> <item name="android:layout_width">0dp</item> <item name="android:layout_height">match_parent</item> @@ -81,6 +94,7 @@ <style name="DropTargetButton" parent="DropTargetButtonBase" /> + <!-- Virtual preloaders --> <style name="PreloadIcon"> <item name="background">@drawable/virtual_preload</item> <item name="indicatorSize">4dp</item> diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 7330712f8..cb2f7d312 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -113,6 +113,7 @@ import com.android.launcher3.util.LongArrayMap; import com.android.launcher3.util.TestingUtils; import com.android.launcher3.util.Thunk; import com.android.launcher3.util.ViewOnDrawExecutor; +import com.android.launcher3.util.WallpaperUtils; import com.android.launcher3.widget.PendingAddWidgetInfo; import com.android.launcher3.widget.WidgetHostViewLoader; import com.android.launcher3.widget.WidgetsContainerView; @@ -2764,7 +2765,7 @@ public class Launcher extends Activity int pageScroll = mWorkspace.getScrollForPage(mWorkspace.getPageNearestToCenterOfScreen()); float offset = mWorkspace.mWallpaperOffset.wallpaperOffsetForScroll(pageScroll); startActivityForResult(new Intent(Intent.ACTION_SET_WALLPAPER).setPackage(getPackageName()) - .putExtra(WallpaperPickerActivity.EXTRA_WALLPAPER_OFFSET, offset), + .putExtra(WallpaperUtils.EXTRA_WALLPAPER_OFFSET, offset), REQUEST_PICK_WALLPAPER); if (mLauncherCallbacks != null) { diff --git a/src/com/android/launcher3/util/WallpaperUtils.java b/src/com/android/launcher3/util/WallpaperUtils.java index a5251e190..45c83bd8c 100644 --- a/src/com/android/launcher3/util/WallpaperUtils.java +++ b/src/com/android/launcher3/util/WallpaperUtils.java @@ -38,6 +38,8 @@ public final class WallpaperUtils { public static final String WALLPAPER_HEIGHT_KEY = "wallpaper.height"; public static final float WALLPAPER_SCREENS_SPAN = 2f; + public static final String EXTRA_WALLPAPER_OFFSET = "com.android.launcher3.WALLPAPER_OFFSET"; + public static void saveWallpaperDimensions(int width, int height, Activity activity) { if (Utilities.ATLEAST_KITKAT) { // From Kitkat onwards, ImageWallpaper does not care about the |