From 4e3efeb9ff8cf9fc56068ba35a276fb4795cc22a Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 9 Jun 2016 14:50:42 +0200 Subject: [PATCH] dont do anything if the fragment gets hidden --- .../simplemobiletools/gallery/adapters/MyPagerAdapter.java | 4 ---- .../simplemobiletools/gallery/fragments/PhotoFragment.java | 7 +------ .../simplemobiletools/gallery/fragments/VideoFragment.java | 4 ---- .../gallery/fragments/ViewPagerFragment.java | 2 -- 4 files changed, 1 insertion(+), 16 deletions(-) diff --git a/app/src/main/java/com/simplemobiletools/gallery/adapters/MyPagerAdapter.java b/app/src/main/java/com/simplemobiletools/gallery/adapters/MyPagerAdapter.java index 09aee6741..7f73710a5 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/adapters/MyPagerAdapter.java +++ b/app/src/main/java/com/simplemobiletools/gallery/adapters/MyPagerAdapter.java @@ -33,10 +33,6 @@ public class MyPagerAdapter extends FragmentStatePagerAdapter { @Override public Fragment getItem(int position) { - if (fragment != null) { - fragment.fragmentHidden(); - } - final Medium medium = media.get(position); final Bundle bundle = new Bundle(); bundle.putSerializable(Constants.MEDIUM, medium); diff --git a/app/src/main/java/com/simplemobiletools/gallery/fragments/PhotoFragment.java b/app/src/main/java/com/simplemobiletools/gallery/fragments/PhotoFragment.java index ba7a43d62..90a3a760b 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/fragments/PhotoFragment.java +++ b/app/src/main/java/com/simplemobiletools/gallery/fragments/PhotoFragment.java @@ -8,9 +8,9 @@ import android.view.ViewGroup; import com.davemorrissey.labs.subscaleview.ImageSource; import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView; import com.simplemobiletools.gallery.Constants; -import com.simplemobiletools.gallery.models.Medium; import com.simplemobiletools.gallery.R; import com.simplemobiletools.gallery.activities.ViewPagerActivity; +import com.simplemobiletools.gallery.models.Medium; public class PhotoFragment extends ViewPagerFragment implements View.OnClickListener { @@ -45,9 +45,4 @@ public class PhotoFragment extends ViewPagerFragment implements View.OnClickList public void itemDragged() { } - - @Override - public void fragmentHidden() { - - } } diff --git a/app/src/main/java/com/simplemobiletools/gallery/fragments/VideoFragment.java b/app/src/main/java/com/simplemobiletools/gallery/fragments/VideoFragment.java index 120b0db55..8493643b3 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/fragments/VideoFragment.java +++ b/app/src/main/java/com/simplemobiletools/gallery/fragments/VideoFragment.java @@ -77,10 +77,6 @@ public class VideoFragment extends ViewPagerFragment pauseVideo(); } - public void fragmentHidden() { - cleanup(); - } - private void initTimeHolder(View view) { RelativeLayout timeHolder = (RelativeLayout) view.findViewById(R.id.video_time_holder); final Resources res = getResources(); diff --git a/app/src/main/java/com/simplemobiletools/gallery/fragments/ViewPagerFragment.java b/app/src/main/java/com/simplemobiletools/gallery/fragments/ViewPagerFragment.java index b16ee5525..53bf8c617 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/fragments/ViewPagerFragment.java +++ b/app/src/main/java/com/simplemobiletools/gallery/fragments/ViewPagerFragment.java @@ -4,6 +4,4 @@ import android.support.v4.app.Fragment; public abstract class ViewPagerFragment extends Fragment { public abstract void itemDragged(); - - public abstract void fragmentHidden(); }