mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 13:51:50 +01:00
Improve webtoon reader precaching images. Show a badge for the apk.
This commit is contained in:
parent
44ec87f7f1
commit
737d3d4282
@ -1,6 +1,6 @@
|
||||
Mangafeed is a Manga reader for Android that tries to have the same features as Manga Watcher, but being Open Source.
|
||||
|
||||
Latest debug build available [here](http://mangafeed.kanade.eu/latest/app-debug.apk)
|
||||
[![latest debug build](https://img.shields.io/badge/download-latest%20debug%20build-brightgreen.svg)](http://mangafeed.kanade.eu/latest/app-debug.apk)
|
||||
|
||||
## License
|
||||
|
||||
|
@ -2,7 +2,6 @@ package eu.kanade.mangafeed.ui.reader.viewer.webtoon;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.GestureDetector;
|
||||
import android.view.LayoutInflater;
|
||||
@ -14,6 +13,7 @@ import java.util.List;
|
||||
|
||||
import eu.kanade.mangafeed.data.source.model.Page;
|
||||
import eu.kanade.mangafeed.ui.reader.viewer.base.BaseReader;
|
||||
import eu.kanade.mangafeed.widget.PreCachingLayoutManager;
|
||||
import rx.Subscription;
|
||||
import rx.android.schedulers.AndroidSchedulers;
|
||||
import rx.subjects.PublishSubject;
|
||||
@ -24,6 +24,7 @@ import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
public class WebtoonReader extends BaseReader {
|
||||
|
||||
private WebtoonAdapter adapter;
|
||||
private RecyclerView recycler;
|
||||
private Subscription subscription;
|
||||
private GestureDetector gestureDetector;
|
||||
|
||||
@ -31,9 +32,9 @@ public class WebtoonReader extends BaseReader {
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedState) {
|
||||
adapter = new WebtoonAdapter(this);
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
|
||||
PreCachingLayoutManager layoutManager = new PreCachingLayoutManager(getActivity());
|
||||
|
||||
RecyclerView recycler = new RecyclerView(getActivity());
|
||||
recycler = new RecyclerView(getActivity());
|
||||
recycler.setLayoutParams(new ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT));
|
||||
recycler.setLayoutManager(layoutManager);
|
||||
recycler.setItemAnimator(null);
|
||||
@ -70,8 +71,7 @@ public class WebtoonReader extends BaseReader {
|
||||
|
||||
@Override
|
||||
public void setSelectedPage(int pageNumber) {
|
||||
// TODO
|
||||
return;
|
||||
recycler.scrollToPosition(getPositionForPage(pageNumber));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -0,0 +1,28 @@
|
||||
package eu.kanade.mangafeed.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
|
||||
public class PreCachingLayoutManager extends LinearLayoutManager {
|
||||
|
||||
private static final int DEFAULT_EXTRA_LAYOUT_SPACE = 600;
|
||||
private int extraLayoutSpace = -1;
|
||||
|
||||
public PreCachingLayoutManager(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public void setExtraLayoutSpace(int extraLayoutSpace) {
|
||||
this.extraLayoutSpace = extraLayoutSpace;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getExtraLayoutSpace(RecyclerView.State state) {
|
||||
if (extraLayoutSpace > 0) {
|
||||
return extraLayoutSpace;
|
||||
}
|
||||
return DEFAULT_EXTRA_LAYOUT_SPACE;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user