diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/adapter/ReaderPageAdapter.java b/app/src/main/java/eu/kanade/mangafeed/ui/adapter/ViewerPagerAdapter.java similarity index 84% rename from app/src/main/java/eu/kanade/mangafeed/ui/adapter/ReaderPageAdapter.java rename to app/src/main/java/eu/kanade/mangafeed/ui/adapter/ViewerPagerAdapter.java index 2df97cf70..1035bca87 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/adapter/ReaderPageAdapter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/adapter/ViewerPagerAdapter.java @@ -8,11 +8,11 @@ import java.util.List; import eu.kanade.mangafeed.data.models.Page; import eu.kanade.mangafeed.ui.fragment.ReaderPageFragment; -public class ReaderPageAdapter extends SmartFragmentStatePagerAdapter { +public class ViewerPagerAdapter extends SmartFragmentStatePagerAdapter { private List pages; - public ReaderPageAdapter(FragmentManager fragmentManager) { + public ViewerPagerAdapter(FragmentManager fragmentManager) { super(fragmentManager); } diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/ReaderPageFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/fragment/ReaderPageFragment.java index f3535a599..baae29f88 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/ReaderPageFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/fragment/ReaderPageFragment.java @@ -84,7 +84,7 @@ public class ReaderPageFragment extends Fragment { if (page == null || page.getImagePath() == null) return; - imageView.setImage(ImageSource.uri(page.getImagePath())); + imageView.setImage(ImageSource.uri(page.getImagePath()).tilingDisabled()); progressContainer.setVisibility(View.GONE); } diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/viewer/VerticalViewer.java b/app/src/main/java/eu/kanade/mangafeed/ui/viewer/VerticalViewer.java index b3081a1e7..161e6aa03 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/viewer/VerticalViewer.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/viewer/VerticalViewer.java @@ -10,25 +10,25 @@ import butterknife.ButterKnife; import eu.kanade.mangafeed.R; import eu.kanade.mangafeed.data.models.Page; import eu.kanade.mangafeed.ui.activity.ReaderActivity; -import eu.kanade.mangafeed.ui.adapter.ReaderPageAdapter; +import eu.kanade.mangafeed.ui.adapter.ViewerPagerAdapter; import eu.kanade.mangafeed.ui.viewer.base.BaseViewer; -import eu.kanade.mangafeed.widget.ReaderViewPager; +import eu.kanade.mangafeed.widget.HorizontalViewPager; import fr.castorflex.android.verticalviewpager.VerticalViewPager; public class VerticalViewer extends BaseViewer { @Bind(R.id.view_pager) VerticalViewPager viewPager; - private ReaderPageAdapter adapter; + private ViewerPagerAdapter adapter; public VerticalViewer(ReaderActivity activity, FrameLayout container) { super(activity, container); activity.getLayoutInflater().inflate(R.layout.viewer_verticalviewpager, container); ButterKnife.bind(this, container); - adapter = new ReaderPageAdapter(activity.getSupportFragmentManager()); + adapter = new ViewerPagerAdapter(activity.getSupportFragmentManager()); viewPager.setAdapter(adapter); viewPager.setOffscreenPageLimit(3); - viewPager.setOnPageChangeListener(new ReaderViewPager.OnPageChangeListener() { + viewPager.setOnPageChangeListener(new HorizontalViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/viewer/base/ViewPagerViewer.java b/app/src/main/java/eu/kanade/mangafeed/ui/viewer/base/ViewPagerViewer.java index 2ebdbaab0..42cd7b39a 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/viewer/base/ViewPagerViewer.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/viewer/base/ViewPagerViewer.java @@ -10,23 +10,24 @@ import butterknife.ButterKnife; import eu.kanade.mangafeed.R; import eu.kanade.mangafeed.data.models.Page; import eu.kanade.mangafeed.ui.activity.ReaderActivity; -import eu.kanade.mangafeed.ui.adapter.ReaderPageAdapter; -import eu.kanade.mangafeed.widget.ReaderViewPager; +import eu.kanade.mangafeed.ui.adapter.ViewerPagerAdapter; +import eu.kanade.mangafeed.widget.HorizontalViewPager; public abstract class ViewPagerViewer extends BaseViewer { - @Bind(R.id.view_pager) ReaderViewPager viewPager; - protected ReaderPageAdapter adapter; + @Bind(R.id.view_pager) + HorizontalViewPager viewPager; + protected ViewerPagerAdapter adapter; public ViewPagerViewer(ReaderActivity activity, FrameLayout container) { super(activity, container); activity.getLayoutInflater().inflate(R.layout.viewer_viewpager, container); ButterKnife.bind(this, container); - adapter = new ReaderPageAdapter(activity.getSupportFragmentManager()); + adapter = new ViewerPagerAdapter(activity.getSupportFragmentManager()); viewPager.setAdapter(adapter); viewPager.setOffscreenPageLimit(3); - viewPager.addOnPageChangeListener(new ReaderViewPager.OnPageChangeListener() { + viewPager.addOnPageChangeListener(new HorizontalViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { @@ -43,7 +44,7 @@ public abstract class ViewPagerViewer extends BaseViewer { } }); - viewPager.setOnChapterBoundariesOutListener(new ReaderViewPager.OnChapterBoundariesOutListener() { + viewPager.setOnChapterBoundariesOutListener(new HorizontalViewPager.OnChapterBoundariesOutListener() { @Override public void onFirstPageOutEvent() { onFirstPageOut(); @@ -57,7 +58,7 @@ public abstract class ViewPagerViewer extends BaseViewer { viewPager.setOnChapterSingleTapListener(activity::onCenterSingleTap); } - public ReaderViewPager getViewPager() { + public HorizontalViewPager getViewPager() { return viewPager; } diff --git a/app/src/main/java/eu/kanade/mangafeed/widget/ReaderViewPager.java b/app/src/main/java/eu/kanade/mangafeed/widget/HorizontalViewPager.java similarity index 97% rename from app/src/main/java/eu/kanade/mangafeed/widget/ReaderViewPager.java rename to app/src/main/java/eu/kanade/mangafeed/widget/HorizontalViewPager.java index e5988c8b7..5054f0b26 100644 --- a/app/src/main/java/eu/kanade/mangafeed/widget/ReaderViewPager.java +++ b/app/src/main/java/eu/kanade/mangafeed/widget/HorizontalViewPager.java @@ -6,7 +6,7 @@ import android.util.AttributeSet; import android.view.GestureDetector; import android.view.MotionEvent; -public class ReaderViewPager extends ViewPager { +public class HorizontalViewPager extends ViewPager { private GestureDetector gestureDetector; @@ -18,7 +18,7 @@ public class ReaderViewPager extends ViewPager { private static final float SWIPE_TOLERANCE = 0.25f; private float startDragX; - public ReaderViewPager(Context context, AttributeSet attrs) { + public HorizontalViewPager(Context context, AttributeSet attrs) { super(context, attrs); gestureDetector = new GestureDetector(getContext(), new ReaderViewGestureListener()); } diff --git a/app/src/main/res/layout/viewer_viewpager.xml b/app/src/main/res/layout/viewer_viewpager.xml index ceef0ae9c..819cfb5e7 100644 --- a/app/src/main/res/layout/viewer_viewpager.xml +++ b/app/src/main/res/layout/viewer_viewpager.xml @@ -1,7 +1,7 @@ - - \ No newline at end of file + \ No newline at end of file