mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-18 15:07:30 +01:00
Almost showing a chapter reader
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package eu.kanade.mangafeed.util;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
|
||||
import com.bumptech.glide.request.animation.GlideAnimation;
|
||||
import com.bumptech.glide.request.target.ViewTarget;
|
||||
import com.davemorrissey.labs.subscaleview.ImageSource;
|
||||
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import eu.kanade.mangafeed.R;
|
||||
|
||||
public class PageFileTarget extends ViewTarget<SubsamplingScaleImageView, File> {
|
||||
public static final String TAG = PageFileTarget.class.getSimpleName();
|
||||
|
||||
public PageFileTarget(SubsamplingScaleImageView view) {
|
||||
super(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadCleared(Drawable placeholder) {
|
||||
view.setImage(ImageSource.resource(R.drawable.ic_action_refresh));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadStarted(Drawable placeholder) {
|
||||
view.setImage(ImageSource.resource(R.drawable.ic_action_refresh));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResourceReady(File resource, GlideAnimation<? super File> glideAnimation) {
|
||||
view.setImage(ImageSource.uri(Uri.fromFile(resource)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package eu.kanade.mangafeed.util.events;
|
||||
|
||||
import eu.kanade.mangafeed.data.models.Chapter;
|
||||
import eu.kanade.mangafeed.sources.Source;
|
||||
|
||||
public class SourceChapterEvent {
|
||||
|
||||
private Source source;
|
||||
private Chapter chapter;
|
||||
|
||||
public SourceChapterEvent(Source source, Chapter chapter) {
|
||||
this.source = source;
|
||||
this.chapter = chapter;
|
||||
}
|
||||
|
||||
public Source getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public Chapter getChapter() {
|
||||
return chapter;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user