Skip to content
This repository has been archived by the owner on Sep 8, 2019. It is now read-only.

Commit

Permalink
- Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kollerlukas committed Mar 11, 2017
1 parent 6a5a8fa commit bfad1a3
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand All @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
15 changes: 14 additions & 1 deletion app/src/main/java/us/koller/cameraroll/util/ItemViewUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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()) :
Expand All @@ -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()
Expand All @@ -103,6 +112,10 @@ public boolean onResourceReady(Bitmap resource, String model,
((ItemActivity) imageView.getContext())
.startPostponedEnterTransition();
}

if (callback != null) {
callback.onImageReady();
}
return false;
}
})
Expand Down
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bfad1a3

Please sign in to comment.