add PhotoView for pinch zooming fullscreen images

This commit is contained in:
tibbi 2016-02-21 17:48:16 +01:00
parent ef241a1c5d
commit a32de3c5ca
2 changed files with 3 additions and 0 deletions

View file

@ -24,4 +24,5 @@ dependencies {
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.commit451:PhotoView:1.2.4'
}

View file

@ -12,6 +12,7 @@ import com.bumptech.glide.Glide;
import java.util.List;
import gallery.simplemobiletools.com.R;
import uk.co.senab.photoview.PhotoViewAttacher;
public class MyPagerAdapter extends PagerAdapter {
private final Context context;
@ -40,6 +41,7 @@ public class MyPagerAdapter extends PagerAdapter {
final ImageView imageView = (ImageView) view.findViewById(R.id.photo);
Glide.with(context).load(paths.get(position)).fitCenter().crossFade().into(imageView);
container.addView(view);
new PhotoViewAttacher(imageView);
return view;
}