mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-30 01:04:55 -05:00
Fix #100
This commit is contained in:
parent
c4ae88a8ff
commit
7944bb8479
3 changed files with 22 additions and 11 deletions
|
@ -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 ?
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue