This commit is contained in:
inorichi 2016-02-01 20:53:06 +01:00
parent c4ae88a8ff
commit 7944bb8479
3 changed files with 22 additions and 11 deletions

View file

@ -147,8 +147,8 @@ public class ReaderMenu {
// Set initial values
totalPages.setText("" + numPages);
currentPage.setText("" + (currentPageIndex + 1));
seekBar.setProgress(currentPageIndex);
seekBar.setMax(numPages - 1);
seekBar.setProgress(currentPageIndex);
activity.setToolbarTitle(manga.title);
activity.setToolbarSubtitle(chapter.chapter_number != -1 ?

View file

@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.ui.reader.viewer.pager;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.view.ViewGroup;
import java.util.List;
@ -23,7 +24,19 @@ public class PagerReaderAdapter extends FragmentStatePagerAdapter {
@Override
public Fragment getItem(int position) {
return PagerReaderFragment.newInstance(pages.get(position));
return PagerReaderFragment.newInstance();
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
PagerReaderFragment f = (PagerReaderFragment) super.instantiateItem(container, position);
f.setPage(pages.get(position));
return f;
}
@Override
public int getItemPosition(Object object) {
return POSITION_NONE;
}
public List<Page> getPages() {
@ -35,9 +48,4 @@ public class PagerReaderAdapter extends FragmentStatePagerAdapter {
notifyDataSetChanged();
}
@Override
public int getItemPosition(Object object) {
return POSITION_NONE;
}
}

View file

@ -41,13 +41,12 @@ public class PagerReaderFragment extends BaseFragment {
@Bind(R.id.retry_button) Button retryButton;
private Page page;
private boolean isReady;
private Subscription progressSubscription;
private Subscription statusSubscription;
public static PagerReaderFragment newInstance(Page page) {
PagerReaderFragment fragment = new PagerReaderFragment();
fragment.setPage(page);
return fragment;
public static PagerReaderFragment newInstance() {
return new PagerReaderFragment();
}
@Override
@ -86,6 +85,7 @@ public class PagerReaderFragment extends BaseFragment {
});
observeStatus();
isReady = true;
return view;
}
@ -99,6 +99,9 @@ public class PagerReaderFragment extends BaseFragment {
public void setPage(Page page) {
this.page = page;
if (isReady) {
observeStatus();
}
}
private void showImage() {