diff options
| -rwxr-xr-x | AndroidManifest.xml | 7 | ||||
| -rwxr-xr-x | res/layout/fragment_individual_picker.xml | 2 | ||||
| -rwxr-xr-x | res/layout/grid_item_category.xml | 2 | ||||
| -rwxr-xr-x | res/layout/grid_item_my_photos.xml | 2 | ||||
| -rwxr-xr-x | res/values/dimens.xml | 2 | ||||
| -rwxr-xr-x | res/values/styles.xml | 2 | ||||
| -rwxr-xr-x | src/com/android/wallpaper/model/PartnerWallpaperInfo.java | 13 | ||||
| -rwxr-xr-x | src/com/android/wallpaper/picker/ImagePreviewFragment.java | 10 |
8 files changed, 33 insertions, 7 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index f0f7024..171d842 100755 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -15,6 +15,9 @@ <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.SET_WALLPAPER" /> + <uses-permission android:name="android.permission.BIND_WALLPAPER"/> + <uses-permission android:name="android.permission.READ_WALLPAPER_INTERNAL"/> + <uses-permission android:name="android.permission.SET_WALLPAPER_COMPONENT"/> <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="com.android.wallpaper.NOTIFY_ROTATING_WALLPAPER_CHANGED" /> @@ -71,7 +74,11 @@ android:targetActivity="com.android.wallpaper.picker.TopLevelPickerActivity" android:label="@string/app_name"> <intent-filter> + <!-- <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER"/> + --> + <category android:name="android.intent.category.DEFAULT"/> </intent-filter> </activity-alias> diff --git a/res/layout/fragment_individual_picker.xml b/res/layout/fragment_individual_picker.xml index e0875c2..bb17407 100755 --- a/res/layout/fragment_individual_picker.xml +++ b/res/layout/fragment_individual_picker.xml @@ -22,7 +22,7 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/individual_picker_background_color" + android:background="?android:colorPrimary" android:orientation="vertical"> <androidx.recyclerview.widget.RecyclerView diff --git a/res/layout/grid_item_category.xml b/res/layout/grid_item_category.xml index 3953153..d2beaab 100755 --- a/res/layout/grid_item_category.xml +++ b/res/layout/grid_item_category.xml @@ -29,7 +29,7 @@ android:layout_height="wrap_content" android:layout_marginTop="@dimen/grid_item_category_label_padding_top" android:layout_marginBottom="@dimen/grid_item_category_label_padding_bottom" - android:background="@color/category_title_scrim_color" + android:background="?android:colorPrimary" android:ellipsize="end" android:gravity="center" android:maxLines="1" diff --git a/res/layout/grid_item_my_photos.xml b/res/layout/grid_item_my_photos.xml index b2f93dd..c1bc001 100755 --- a/res/layout/grid_item_my_photos.xml +++ b/res/layout/grid_item_my_photos.xml @@ -44,7 +44,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" - android:background="@color/translucent_black_90_alpha" + android:background="?android:colorPrimary" android:padding="@dimen/rotation_tile_desktop_label_padding"> <TextView diff --git a/res/values/dimens.xml b/res/values/dimens.xml index f1e8a80..0a065a1 100755 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -203,7 +203,7 @@ <dimen name="preview_pager_height">450dp</dimen> <dimen name="system_rounded_corner">@*android:dimen/rounded_corner_radius_top</dimen> <!-- The maximum height ratio of PreviewPager and its parent view. --> - <item name="preview_pager_maximum_height_ratio" format="float" type="dimen">0.7</item> + <item name="preview_pager_maximum_height_ratio" format="float" type="dimen">0.6</item> <!-- Dimensions for full preview page --> <dimen name="full_preview_page_default_padding_top">24dp</dimen> diff --git a/res/values/styles.xml b/res/values/styles.xml index dc807cb..07803df 100755 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -98,7 +98,7 @@ </style> <style name="RegularToolbarStyle" parent="@style/Widget.AppCompat.Toolbar"> - <item name="android:background">@color/toolbar_color</item> + <item name="android:background">?android:colorPrimary</item> <item name="android:elevation">0dp</item> <item name="android:theme">@style/WallpaperTheme</item> </style> diff --git a/src/com/android/wallpaper/model/PartnerWallpaperInfo.java b/src/com/android/wallpaper/model/PartnerWallpaperInfo.java index 513e3fe..c8dfab2 100755 --- a/src/com/android/wallpaper/model/PartnerWallpaperInfo.java +++ b/src/com/android/wallpaper/model/PartnerWallpaperInfo.java @@ -47,6 +47,7 @@ public class PartnerWallpaperInfo extends WallpaperInfo { return new PartnerWallpaperInfo[size]; } }; + private String mExtra; private int mThumbRes; private int mFullRes; private ResourceAsset mAsset; @@ -54,12 +55,14 @@ public class PartnerWallpaperInfo extends WallpaperInfo { private Resources mPartnerResources; private boolean mFetchedPartnerResources; - public PartnerWallpaperInfo(int thumbRes, int fullRes) { + public PartnerWallpaperInfo(String extra, int thumbRes, int fullRes) { + mExtra = extra; mThumbRes = thumbRes; mFullRes = fullRes; } private PartnerWallpaperInfo(Parcel in) { + mExtra = in.readString(); mThumbRes = in.readInt(); mFullRes = in.readInt(); } @@ -95,7 +98,7 @@ public class PartnerWallpaperInfo extends WallpaperInfo { if (thumbRes != 0) { final int fullRes = partnerRes.getIdentifier(extra, "drawable", packageName); - WallpaperInfo wallpaperInfo = new PartnerWallpaperInfo(thumbRes, fullRes); + WallpaperInfo wallpaperInfo = new PartnerWallpaperInfo(extra, thumbRes, fullRes); wallpaperInfos.add(wallpaperInfo); } } else { @@ -145,6 +148,11 @@ public class PartnerWallpaperInfo extends WallpaperInfo { } @Override + public String getWallpaperId() { + return "partner-wallpaper-" + mExtra; + } + + @Override public void showPreview(Activity srcActivity, InlinePreviewIntentFactory factory, int requestCode) { srcActivity.startActivityForResult(factory.newIntent(srcActivity, this), requestCode); @@ -158,6 +166,7 @@ public class PartnerWallpaperInfo extends WallpaperInfo { @Override public void writeToParcel(Parcel parcel, int i) { + parcel.writeString(mExtra); parcel.writeInt(mThumbRes); parcel.writeInt(mFullRes); } diff --git a/src/com/android/wallpaper/picker/ImagePreviewFragment.java b/src/com/android/wallpaper/picker/ImagePreviewFragment.java index 1ea49f0..9ff7c98 100755 --- a/src/com/android/wallpaper/picker/ImagePreviewFragment.java +++ b/src/com/android/wallpaper/picker/ImagePreviewFragment.java @@ -85,6 +85,7 @@ public class ImagePreviewFragment extends PreviewFragment { private final WallpaperSurfaceCallback mWallpaperSurfaceCallback = new WallpaperSurfaceCallback(); + private boolean mFullResViewInitialized; private SubsamplingScaleImageView mFullResImageView; private Asset mWallpaperAsset; private Point mScreenSize; @@ -277,6 +278,14 @@ public class ImagePreviewFragment extends PreviewFragment { * initializing a zoom-scroll observer and click listener. */ private void initFullResView() { + synchronized (this) { + // Skip init if already initialized or dependencies aren't ready yet + if (mFullResViewInitialized || mFullResImageView == null || mRawWallpaperSize == null) { + return; + } + mFullResViewInitialized = true; + } + // Minimum scale will only be respected under this scale type. mFullResImageView.setMinimumScaleType(SubsamplingScaleImageView.SCALE_TYPE_CUSTOM); // When we set a minimum scale bigger than the scale with which the full image is shown, @@ -514,6 +523,7 @@ public class ImagePreviewFragment extends PreviewFragment { mHost.setView(wallpaperPreviewContainer, wallpaperPreviewContainer.getWidth(), wallpaperPreviewContainer.getHeight()); mWallpaperSurface.setChildSurfacePackage(mHost.getSurfacePackage()); + initFullResView(); } } |
