diff --git a/app/build.gradle b/app/build.gradle index 98f4ce5f..ba7ddc3b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "us.koller.cameraroll" minSdkVersion 19 targetSdkVersion 25 - versionCode 13 - versionName "v1.2.1 Beta" + versionCode 15 + versionName "v1.3 Beta" renderscriptTargetApi 25 vectorDrawables.useSupportLibrary = true renderscriptSupportModeEnabled true diff --git a/app/src/main/java/us/koller/cameraroll/adapter/item/ViewHolder/GifViewHolder.java b/app/src/main/java/us/koller/cameraroll/adapter/item/ViewHolder/GifViewHolder.java index b393eaf9..7b458914 100644 --- a/app/src/main/java/us/koller/cameraroll/adapter/item/ViewHolder/GifViewHolder.java +++ b/app/src/main/java/us/koller/cameraroll/adapter/item/ViewHolder/GifViewHolder.java @@ -30,7 +30,7 @@ public View getView(ViewGroup container) { ItemViewUtil.bindGif(this, (ImageView) view, albumItem); }*/ - ItemViewUtil.bindTransitionView((ImageView) view, albumItem); + ItemViewUtil.bindTransitionView((ImageView) view, albumItem, null); return v; } diff --git a/app/src/main/java/us/koller/cameraroll/adapter/item/ViewHolder/PhotoViewHolder.java b/app/src/main/java/us/koller/cameraroll/adapter/item/ViewHolder/PhotoViewHolder.java index 753f736d..b7eedd5e 100644 --- a/app/src/main/java/us/koller/cameraroll/adapter/item/ViewHolder/PhotoViewHolder.java +++ b/app/src/main/java/us/koller/cameraroll/adapter/item/ViewHolder/PhotoViewHolder.java @@ -9,6 +9,8 @@ import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView; +import uk.co.senab.photoview.PhotoViewAttacher; + import us.koller.cameraroll.R; import us.koller.cameraroll.data.AlbumItem; import us.koller.cameraroll.data.Photo; @@ -32,7 +34,7 @@ public View getView(ViewGroup container) { && ((Photo) albumItem).getImageViewSavedState() != null) { transitionView.setVisibility(View.INVISIBLE); } - ItemViewUtil.bindTransitionView((ImageView) transitionView, albumItem); + ItemViewUtil.bindTransitionView((ImageView) transitionView, albumItem, null); /*if (albumItem.isSharedElement) { view.setVisibility(View.INVISIBLE); } else { @@ -57,7 +59,7 @@ public void swapView(final boolean isReturning) { private void bindImageView(View view, final View transitionView) { if (albumItem.error) { transitionView.setVisibility(View.VISIBLE); - ItemViewUtil.bindTransitionView((ImageView) transitionView, albumItem); + ItemViewUtil.bindTransitionView((ImageView) transitionView, albumItem, null); return; } diff --git a/app/src/main/java/us/koller/cameraroll/adapter/item/ViewHolder/VideoViewHolder.java b/app/src/main/java/us/koller/cameraroll/adapter/item/ViewHolder/VideoViewHolder.java index ff69ac98..a5c5dd50 100644 --- a/app/src/main/java/us/koller/cameraroll/adapter/item/ViewHolder/VideoViewHolder.java +++ b/app/src/main/java/us/koller/cameraroll/adapter/item/ViewHolder/VideoViewHolder.java @@ -83,7 +83,7 @@ public void onClick(View view) { hideVideoControls(true, null); handleVideoControlsBottomInset(); - ItemViewUtil.bindTransitionView((ImageView) transitionView, albumItem); + ItemViewUtil.bindTransitionView((ImageView) transitionView, albumItem, null); /*if (albumItem.isSharedElement) { //emVideoView.setVisibility(View.INVISIBLE); emVideoView.setAlpha(0.0f); diff --git a/app/src/main/java/us/koller/cameraroll/util/ItemViewUtil.java b/app/src/main/java/us/koller/cameraroll/util/ItemViewUtil.java index fd171e16..21fe8072 100644 --- a/app/src/main/java/us/koller/cameraroll/util/ItemViewUtil.java +++ b/app/src/main/java/us/koller/cameraroll/util/ItemViewUtil.java @@ -28,6 +28,10 @@ public class ItemViewUtil { + public interface Callback { + public void onImageReady(); + } + public static ViewGroup inflatePhotoView(ViewGroup container) { return (ViewGroup) LayoutInflater.from(container.getContext()) .inflate(R.layout.photo_view, container, false); @@ -59,7 +63,8 @@ public static View bindSubsamplingImageView(SubsamplingScaleImageView imageView, } public static View bindTransitionView(final ImageView imageView, - final AlbumItem albumItem) { + final AlbumItem albumItem, + final ItemViewUtil.Callback callback) { int[] imageDimens = albumItem instanceof Video ? Util.getVideoDimensions(albumItem.getPath()) : @@ -80,6 +85,10 @@ public static View bindTransitionView(final ImageView imageView, imageDimens[1] = imageDimens[1] / 2; } + if (imageDimens[0] == 1 || imageDimens[1] == 1) { + return imageView; + } + Glide.with(imageView.getContext()) .load(albumItem.getPath()) .asBitmap() @@ -103,6 +112,10 @@ public boolean onResourceReady(Bitmap resource, String model, ((ItemActivity) imageView.getContext()) .startPostponedEnterTransition(); } + + if (callback != null) { + callback.onImageReady(); + } return false; } }) diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png index 780a5d41..1db25d42 100644 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png index dfe6e152..53393e11 100644 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png index bf4d5d71..fe96aa8b 100644 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png index 67a1a464..c88f97e5 100644 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 9f7c9f20..7619146e 100644 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png index 934134d7..5cafb4b5 100644 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index b4c3da08..ae19b0fa 100644 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png index ebca5c77..99906817 100644 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index f7efa0c9..be55f435 100644 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png index ea8707d3..4bd33437 100644 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ