diff options
Diffstat (limited to 'WallpaperPicker')
20 files changed, 114 insertions, 21 deletions
diff --git a/WallpaperPicker/res/drawable-hdpi/tile_picker_focused.9.png b/WallpaperPicker/res/drawable-hdpi/tile_picker_focused.9.png Binary files differdeleted file mode 100644 index c72d6a2c6..000000000 --- a/WallpaperPicker/res/drawable-hdpi/tile_picker_focused.9.png +++ /dev/null diff --git a/WallpaperPicker/res/drawable-hdpi/tile_picker_pressed.9.png b/WallpaperPicker/res/drawable-hdpi/tile_picker_pressed.9.png Binary files differdeleted file mode 100644 index 44c65ac3c..000000000 --- a/WallpaperPicker/res/drawable-hdpi/tile_picker_pressed.9.png +++ /dev/null diff --git a/WallpaperPicker/res/drawable-hdpi/tile_picker_selected.9.png b/WallpaperPicker/res/drawable-hdpi/tile_picker_selected.9.png Binary files differdeleted file mode 100644 index 461bacbcb..000000000 --- a/WallpaperPicker/res/drawable-hdpi/tile_picker_selected.9.png +++ /dev/null diff --git a/WallpaperPicker/res/drawable-mdpi/tile_picker_focused.9.png b/WallpaperPicker/res/drawable-mdpi/tile_picker_focused.9.png Binary files differdeleted file mode 100644 index 13b325b87..000000000 --- a/WallpaperPicker/res/drawable-mdpi/tile_picker_focused.9.png +++ /dev/null diff --git a/WallpaperPicker/res/drawable-mdpi/tile_picker_pressed.9.png b/WallpaperPicker/res/drawable-mdpi/tile_picker_pressed.9.png Binary files differdeleted file mode 100644 index 4e8196d36..000000000 --- a/WallpaperPicker/res/drawable-mdpi/tile_picker_pressed.9.png +++ /dev/null diff --git a/WallpaperPicker/res/drawable-mdpi/tile_picker_selected.9.png b/WallpaperPicker/res/drawable-mdpi/tile_picker_selected.9.png Binary files differdeleted file mode 100644 index eee69ec6d..000000000 --- a/WallpaperPicker/res/drawable-mdpi/tile_picker_selected.9.png +++ /dev/null diff --git a/WallpaperPicker/res/drawable-v21/ic_tick.xml b/WallpaperPicker/res/drawable-v21/ic_tick.xml new file mode 100644 index 000000000..5b270279d --- /dev/null +++ b/WallpaperPicker/res/drawable-v21/ic_tick.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2014 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. +--> + +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:height="48dp" + android:viewportHeight="48" + android:viewportWidth="48" + android:width="48dp" > + + <group> + <path + android:name="tick" + android:fillColor="#FFFFFFFF" + android:pathData="M18 32.34l-8.34-8.34-2.83 2.83 11.17 11.17 24-24-2.83-2.83z" /> + </group> + +</vector>
\ No newline at end of file diff --git a/WallpaperPicker/res/drawable-v21/wallpaper_tile_fg.xml b/WallpaperPicker/res/drawable-v21/wallpaper_tile_fg.xml new file mode 100644 index 000000000..97cdcd637 --- /dev/null +++ b/WallpaperPicker/res/drawable-v21/wallpaper_tile_fg.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2014 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. +--> + +<ripple xmlns:android="http://schemas.android.com/apk/res/android" + android:color="#66FFFFFF" > + + <item + android:id="@android:id/mask" + android:drawable="@android:color/white"/> + <item + android:bottom="23.25dp" + android:left="29.25dp" + android:right="29.25dp" + android:top="23.25dp"> + <selector> + <item + android:drawable="@drawable/ic_tick" + android:state_selected="true"/> + <item + android:drawable="@drawable/ic_tick" + android:state_checked="true"/> + </selector> + </item> + +</ripple>
\ No newline at end of file diff --git a/WallpaperPicker/res/drawable-xhdpi/tile_picker_focused.9.png b/WallpaperPicker/res/drawable-xhdpi/tile_picker_focused.9.png Binary files differdeleted file mode 100644 index 279e85963..000000000 --- a/WallpaperPicker/res/drawable-xhdpi/tile_picker_focused.9.png +++ /dev/null diff --git a/WallpaperPicker/res/drawable-xhdpi/tile_picker_pressed.9.png b/WallpaperPicker/res/drawable-xhdpi/tile_picker_pressed.9.png Binary files differdeleted file mode 100644 index abe0e0080..000000000 --- a/WallpaperPicker/res/drawable-xhdpi/tile_picker_pressed.9.png +++ /dev/null diff --git a/WallpaperPicker/res/drawable-xhdpi/tile_picker_selected.9.png b/WallpaperPicker/res/drawable-xhdpi/tile_picker_selected.9.png Binary files differdeleted file mode 100644 index b047591ac..000000000 --- a/WallpaperPicker/res/drawable-xhdpi/tile_picker_selected.9.png +++ /dev/null diff --git a/WallpaperPicker/res/drawable-xxhdpi/tile_picker_focused.9.png b/WallpaperPicker/res/drawable-xxhdpi/tile_picker_focused.9.png Binary files differdeleted file mode 100644 index 1004c14b8..000000000 --- a/WallpaperPicker/res/drawable-xxhdpi/tile_picker_focused.9.png +++ /dev/null diff --git a/WallpaperPicker/res/drawable-xxhdpi/tile_picker_pressed.9.png b/WallpaperPicker/res/drawable-xxhdpi/tile_picker_pressed.9.png Binary files differdeleted file mode 100644 index 9658444a1..000000000 --- a/WallpaperPicker/res/drawable-xxhdpi/tile_picker_pressed.9.png +++ /dev/null diff --git a/WallpaperPicker/res/drawable-xxhdpi/tile_picker_selected.9.png b/WallpaperPicker/res/drawable-xxhdpi/tile_picker_selected.9.png Binary files differdeleted file mode 100644 index a3cd30369..000000000 --- a/WallpaperPicker/res/drawable-xxhdpi/tile_picker_selected.9.png +++ /dev/null diff --git a/WallpaperPicker/res/drawable/wallpaper_tile_fg.xml b/WallpaperPicker/res/drawable/wallpaper_tile_fg.xml index c299f32c6..c66fa50ad 100644 --- a/WallpaperPicker/res/drawable/wallpaper_tile_fg.xml +++ b/WallpaperPicker/res/drawable/wallpaper_tile_fg.xml @@ -15,9 +15,33 @@ --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_checked="true" android:drawable="@drawable/tile_picker_selected" /> - <item android:state_focused="true" android:drawable="@drawable/tile_picker_focused" /> - <item android:state_pressed="true" android:drawable="@drawable/tile_picker_pressed" /> - <item android:state_selected="true" android:drawable="@drawable/tile_picker_selected" /> + <item android:state_checked="true" > + <shape> + <stroke + android:width="2dp" + android:color="#FFFFFFFF" /> + <solid android:color="#33FFFFFF"/> + </shape> + </item> + <item android:state_focused="true" > + <shape> + <stroke + android:width="2dp" + android:color="#FFFFFFFF" /> + </shape> + </item> + <item android:state_pressed="true"> + <shape android:shape="rectangle"> + <solid android:color="#33FFFFFF"/> + </shape> + </item> + <item android:state_selected="true" > + <shape> + <stroke + android:width="2dp" + android:color="#FFFFFFFF" /> + <solid android:color="#33FFFFFF"/> + </shape> + </item> <item android:drawable="@android:color/transparent" /> </selector> diff --git a/WallpaperPicker/res/values-v19/styles.xml b/WallpaperPicker/res/values-v19/styles.xml index 85a989d55..136cf012c 100644 --- a/WallpaperPicker/res/values-v19/styles.xml +++ b/WallpaperPicker/res/values-v19/styles.xml @@ -18,14 +18,14 @@ --> <resources> - <style name="Theme.WallpaperCropper" parent="@android:style/Theme.Holo"> + <style name="Theme.WallpaperCropper" parent="@android:style/Theme.DeviceDefault"> <item name="android:actionBarStyle">@style/WallpaperCropperActionBar</item> <item name="android:windowFullscreen">true</item> <item name="android:windowActionBarOverlay">true</item> <item name="android:windowTranslucentNavigation">true</item> </style> - <style name="Theme" parent="@android:style/Theme.Holo.Wallpaper.NoTitleBar"> + <style name="Theme" parent="@android:style/Theme.DeviceDefault.Wallpaper.NoTitleBar"> <item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentNavigation">true</item> </style> diff --git a/WallpaperPicker/res/values/styles.xml b/WallpaperPicker/res/values/styles.xml index 16b11f279..f4008f159 100644 --- a/WallpaperPicker/res/values/styles.xml +++ b/WallpaperPicker/res/values/styles.xml @@ -18,7 +18,7 @@ --> <resources> - <style name="Theme.WallpaperCropper" parent="@android:style/Theme.Holo"> + <style name="Theme.WallpaperCropper" parent="@android:style/Theme.DeviceDefault"> <item name="android:actionBarStyle">@style/WallpaperCropperActionBar</item> <item name="android:windowFullscreen">true</item> <item name="android:windowActionBarOverlay">true</item> @@ -30,15 +30,15 @@ <item name="android:windowShowWallpaper">true</item> </style> - <style name="WallpaperCropperActionBar" parent="android:style/Widget.Holo.ActionBar"> + <style name="WallpaperCropperActionBar" parent="@android:style/Widget.DeviceDefault.ActionBar"> <item name="android:displayOptions">showCustom</item> <item name="android:background">#88000000</item> </style> - <style name="Theme" parent="@android:style/Theme.Holo.Wallpaper.NoTitleBar"> + <style name="Theme" parent="@android:style/Theme.DeviceDefault.Wallpaper.NoTitleBar"> </style> - <style name="ActionBarSetWallpaperStyle" parent="@android:style/Widget.Holo.ActionButton"> + <style name="ActionBarSetWallpaperStyle" parent="@android:style/Widget.DeviceDefault.ActionButton"> <item name="android:textColor">#ffffffff</item> </style> </resources> diff --git a/WallpaperPicker/src/com/android/launcher3/SavedWallpaperImages.java b/WallpaperPicker/src/com/android/launcher3/SavedWallpaperImages.java index 2bdf8f1cd..9f92bc105 100644 --- a/WallpaperPicker/src/com/android/launcher3/SavedWallpaperImages.java +++ b/WallpaperPicker/src/com/android/launcher3/SavedWallpaperImages.java @@ -180,7 +180,6 @@ public class SavedWallpaperImages extends BaseAdapter implements ListAdapter { static class ImageDb extends SQLiteOpenHelper { final static int DB_VERSION = 1; - final static String DB_NAME = "saved_wallpaper_images.db"; final static String TABLE_NAME = "saved_wallpaper_images"; final static String COLUMN_ID = "id"; final static String COLUMN_IMAGE_THUMBNAIL_FILENAME = "image_thumbnail"; @@ -189,7 +188,8 @@ public class SavedWallpaperImages extends BaseAdapter implements ListAdapter { Context mContext; public ImageDb(Context context) { - super(context, context.getDatabasePath(DB_NAME).getPath(), null, DB_VERSION); + super(context, context.getDatabasePath(LauncherFiles.WALLPAPER_IMAGES_DB).getPath(), + null, DB_VERSION); // Store the context for later use mContext = context; } @@ -197,8 +197,9 @@ public class SavedWallpaperImages extends BaseAdapter implements ListAdapter { public static void moveFromCacheDirectoryIfNecessary(Context context) { // We used to store the saved images in the cache directory, but that meant they'd get // deleted sometimes-- move them to the data directory - File oldSavedImagesFile = new File(context.getCacheDir(), ImageDb.DB_NAME); - File savedImagesFile = context.getDatabasePath(ImageDb.DB_NAME); + File oldSavedImagesFile = new File(context.getCacheDir(), + LauncherFiles.WALLPAPER_IMAGES_DB); + File savedImagesFile = context.getDatabasePath(LauncherFiles.WALLPAPER_IMAGES_DB); if (oldSavedImagesFile.exists()) { oldSavedImagesFile.renameTo(savedImagesFile); } diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java index d5c7cd93d..fa8ec64c2 100644 --- a/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java +++ b/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java @@ -202,7 +202,7 @@ public class WallpaperCropActivity extends Activity { } public static String getSharedPreferencesKey() { - return WallpaperCropActivity.class.getName(); + return LauncherFiles.WALLPAPER_CROP_PREFERENCES_KEY; } // As a ratio of screen height, the total distance we want the parallax effect to span diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java index 07285372e..09e096396 100644 --- a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java +++ b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java @@ -86,8 +86,6 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { public static final int PICK_LIVE_WALLPAPER = 7; private static final String TEMP_WALLPAPER_TILES = "TEMP_WALLPAPER_TILES"; private static final String SELECTED_INDEX = "SELECTED_INDEX"; - private static final String OLD_DEFAULT_WALLPAPER_THUMBNAIL_FILENAME = "default_thumb.jpg"; - private static final String DEFAULT_WALLPAPER_THUMBNAIL_FILENAME = "default_thumb2.jpg"; private static final int FLAG_POST_DELAY_MILLIS = 200; private View mSelectedTile; @@ -999,16 +997,16 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { private File getDefaultThumbFile() { return new File(getFilesDir(), Build.VERSION.SDK_INT - + "_" + DEFAULT_WALLPAPER_THUMBNAIL_FILENAME); + + "_" + LauncherFiles.DEFAULT_WALLPAPER_THUMBNAIL); } private boolean saveDefaultWallpaperThumb(Bitmap b) { // Delete old thumbnails. - new File(getFilesDir(), OLD_DEFAULT_WALLPAPER_THUMBNAIL_FILENAME).delete(); - new File(getFilesDir(), DEFAULT_WALLPAPER_THUMBNAIL_FILENAME).delete(); + new File(getFilesDir(), LauncherFiles.DEFAULT_WALLPAPER_THUMBNAIL_OLD).delete(); + new File(getFilesDir(), LauncherFiles.DEFAULT_WALLPAPER_THUMBNAIL).delete(); for (int i = Build.VERSION_CODES.JELLY_BEAN; i < Build.VERSION.SDK_INT; i++) { - new File(getFilesDir(), i + "_" + DEFAULT_WALLPAPER_THUMBNAIL_FILENAME).delete(); + new File(getFilesDir(), i + "_" + LauncherFiles.DEFAULT_WALLPAPER_THUMBNAIL).delete(); } return writeImageToFileAsJpeg(getDefaultThumbFile(), b); } |