Changed library used to display fullscreen images.

parent d0bbe213
......@@ -37,7 +37,7 @@ dependencies {
compile 'com.github.bumptech.glide:glide:4.2.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.2.0'
compile 'com.github.chrisbanes:PhotoView:2.1.3'
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.7.2'
compile 'com.google.android.exoplayer:exoplayer:r2.5.4'
}
......@@ -20,14 +20,12 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.github.chrisbanes.photoview.PhotoView;
import com.davemorrissey.labs.subscaleview.ImageSource;
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView;
import java.io.File;
import java.util.ArrayList;
import static com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions.withCrossFade;
public class ImageActivity extends AppCompatActivity {
ArrayList<String> list_of_images = new ArrayList<>();
......@@ -189,10 +187,13 @@ public class ImageActivity extends AppCompatActivity {
// Inflate layout
LayoutInflater inflater = getLayoutInflater();
View layout = inflater.inflate(R.layout.view_pager_item, container, false);
// Get view
PhotoView photoView = layout.findViewById(R.id.inside_imageview);
// Get views
SubsamplingScaleImageView imageView = findViewById(R.id.inside_imageview);
ImageView overlay = layout.findViewById(R.id.outside_imageview);
//Set image
imageView.setImage(ImageSource.uri(Uri.fromFile(image)));
// If it's a video, add overlay
if(Utils.isVideo(image.getName())){
overlay.setVisibility(View.VISIBLE);
......@@ -200,17 +201,17 @@ public class ImageActivity extends AppCompatActivity {
overlay.setVisibility(View.INVISIBLE);
}
GlideApp
.with(getApplicationContext())
.load(image)
.transition(withCrossFade())
.diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
.into(photoView);
//GlideApp
// .with(getApplicationContext())
// .load(image)
// .transition(withCrossFade())
// .diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
// .into(imageView);
container.addView(layout);
// Set up the user interaction to manually show or hide the system UI.
photoView.setOnClickListener(new View.OnClickListener() {
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
toggle();
......
......@@ -3,7 +3,7 @@
android:layout_height="wrap_content"
android:orientation="vertical">
<com.github.chrisbanes.photoview.PhotoView
<com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView
android:id="@+id/inside_imageview"
android:layout_width="match_parent"
android:layout_height="match_parent"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment