dont do anything if the fragment gets hidden
This commit is contained in:
parent
e7e31e25f6
commit
4e3efeb9ff
|
@ -33,10 +33,6 @@ public class MyPagerAdapter extends FragmentStatePagerAdapter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Fragment getItem(int position) {
|
public Fragment getItem(int position) {
|
||||||
if (fragment != null) {
|
|
||||||
fragment.fragmentHidden();
|
|
||||||
}
|
|
||||||
|
|
||||||
final Medium medium = media.get(position);
|
final Medium medium = media.get(position);
|
||||||
final Bundle bundle = new Bundle();
|
final Bundle bundle = new Bundle();
|
||||||
bundle.putSerializable(Constants.MEDIUM, medium);
|
bundle.putSerializable(Constants.MEDIUM, medium);
|
||||||
|
|
|
@ -8,9 +8,9 @@ import android.view.ViewGroup;
|
||||||
import com.davemorrissey.labs.subscaleview.ImageSource;
|
import com.davemorrissey.labs.subscaleview.ImageSource;
|
||||||
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView;
|
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView;
|
||||||
import com.simplemobiletools.gallery.Constants;
|
import com.simplemobiletools.gallery.Constants;
|
||||||
import com.simplemobiletools.gallery.models.Medium;
|
|
||||||
import com.simplemobiletools.gallery.R;
|
import com.simplemobiletools.gallery.R;
|
||||||
import com.simplemobiletools.gallery.activities.ViewPagerActivity;
|
import com.simplemobiletools.gallery.activities.ViewPagerActivity;
|
||||||
|
import com.simplemobiletools.gallery.models.Medium;
|
||||||
|
|
||||||
public class PhotoFragment extends ViewPagerFragment implements View.OnClickListener {
|
public class PhotoFragment extends ViewPagerFragment implements View.OnClickListener {
|
||||||
|
|
||||||
|
@ -45,9 +45,4 @@ public class PhotoFragment extends ViewPagerFragment implements View.OnClickList
|
||||||
public void itemDragged() {
|
public void itemDragged() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void fragmentHidden() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,10 +77,6 @@ public class VideoFragment extends ViewPagerFragment
|
||||||
pauseVideo();
|
pauseVideo();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void fragmentHidden() {
|
|
||||||
cleanup();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initTimeHolder(View view) {
|
private void initTimeHolder(View view) {
|
||||||
RelativeLayout timeHolder = (RelativeLayout) view.findViewById(R.id.video_time_holder);
|
RelativeLayout timeHolder = (RelativeLayout) view.findViewById(R.id.video_time_holder);
|
||||||
final Resources res = getResources();
|
final Resources res = getResources();
|
||||||
|
|
|
@ -4,6 +4,4 @@ import android.support.v4.app.Fragment;
|
||||||
|
|
||||||
public abstract class ViewPagerFragment extends Fragment {
|
public abstract class ViewPagerFragment extends Fragment {
|
||||||
public abstract void itemDragged();
|
public abstract void itemDragged();
|
||||||
|
|
||||||
public abstract void fragmentHidden();
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue