浏览代码

Rename pager adapter and horizontal view pager

inorichi 9 年之前
父节点
当前提交
95581007df

+ 2 - 2
app/src/main/java/eu/kanade/mangafeed/ui/adapter/ReaderPageAdapter.java → 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<Page> pages;
 
-    public ReaderPageAdapter(FragmentManager fragmentManager) {
+    public ViewerPagerAdapter(FragmentManager fragmentManager) {
         super(fragmentManager);
     }
 

+ 1 - 1
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);
     }
 

+ 5 - 5
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) {
 

+ 9 - 8
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;
     }
 

+ 2 - 2
app/src/main/java/eu/kanade/mangafeed/widget/ReaderViewPager.java → 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());
     }

+ 2 - 2
app/src/main/res/layout/viewer_viewpager.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
-<eu.kanade.mangafeed.widget.ReaderViewPager
+<eu.kanade.mangafeed.widget.HorizontalViewPager
     android:id="@+id/view_pager"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     xmlns:android="http://schemas.android.com/apk/res/android">
-</eu.kanade.mangafeed.widget.ReaderViewPager>
+</eu.kanade.mangafeed.widget.HorizontalViewPager>