Rename library holder

This commit is contained in:
inorichi 2015-10-13 18:57:10 +02:00
parent 13b4f5c385
commit c88d8f0ded
3 changed files with 13 additions and 5 deletions

View File

@ -1,6 +1,5 @@
package eu.kanade.mangafeed.data.models; package eu.kanade.mangafeed.data.models;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import com.pushtorefresh.storio.sqlite.annotations.StorIOSQLiteColumn; import com.pushtorefresh.storio.sqlite.annotations.StorIOSQLiteColumn;

View File

@ -16,7 +16,7 @@ public class LibraryAdapter<T> extends EasyAdapter<T> implements Filterable {
Filter filter; Filter filter;
public LibraryAdapter(Context context) { public LibraryAdapter(Context context) {
super(context, MangaLibraryHolder.class); super(context, LibraryHolder.class);
filter = new CatalogueFilter(); filter = new CatalogueFilter();
} }

View File

@ -5,6 +5,7 @@ import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import eu.kanade.mangafeed.R; import eu.kanade.mangafeed.R;
import eu.kanade.mangafeed.data.models.Manga; import eu.kanade.mangafeed.data.models.Manga;
@ -15,7 +16,7 @@ import uk.co.ribot.easyadapter.annotations.ViewId;
@LayoutId(R.layout.item_library) @LayoutId(R.layout.item_library)
public class MangaLibraryHolder extends ItemViewHolder<Manga> { public class LibraryHolder extends ItemViewHolder<Manga> {
@ViewId(R.id.thumbnailImage) @ViewId(R.id.thumbnailImage)
ImageView mThumbImage; ImageView mThumbImage;
@ -26,7 +27,7 @@ public class MangaLibraryHolder extends ItemViewHolder<Manga> {
@ViewId(R.id.unreadText) @ViewId(R.id.unreadText)
TextView mUnreadText; TextView mUnreadText;
public MangaLibraryHolder(View view) { public LibraryHolder(View view) {
super(view); super(view);
} }
@ -39,8 +40,16 @@ public class MangaLibraryHolder extends ItemViewHolder<Manga> {
else { else {
mUnreadText.setVisibility(View.GONE); mUnreadText.setVisibility(View.GONE);
} }
String thumbnail;
if (manga.thumbnail_url != null)
thumbnail = manga.thumbnail_url;
else
thumbnail = "http://img1.wikia.nocookie.net/__cb20090524204255/starwars/images/thumb/1/1a/R2d2.jpg/400px-R2d2.jpg";
Glide.with(getContext()) Glide.with(getContext())
.load("http://img1.wikia.nocookie.net/__cb20090524204255/starwars/images/thumb/1/1a/R2d2.jpg/400px-R2d2.jpg") .load(thumbnail)
.diskCacheStrategy(DiskCacheStrategy.RESULT)
.centerCrop() .centerCrop()
.into(mThumbImage); .into(mThumbImage);
} }