diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 97b56971d..a9c47c4ec 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -15,4 +15,82 @@ #-keepclassmembers class fqcn.of.javascript.interface.for.webview { # public *; #} --dontwarn java.lang.invoke.* \ No newline at end of file + +# Retrolambda +-dontwarn java.lang.invoke.* + +# OkHttp +-keepattributes Signature +-keepattributes *Annotation* +-keep class com.squareup.okhttp.** { *; } +-keep interface com.squareup.okhttp.** { *; } +-dontwarn com.squareup.okhttp.** +-dontwarn okio.** + +# Butterknife +-keep class butterknife.** { *; } +-dontwarn butterknife.internal.** +-keep class **$$ViewBinder { *; } + +-keepclasseswithmembernames class * { + @butterknife.* ; +} + +-keepclasseswithmembernames class * { + @butterknife.* ; +} + +#Easy-Adapter v1.5.0 +-keepattributes *Annotation* +-keepclassmembers class * extends uk.co.ribot.easyadapter.ItemViewHolder { + public (...); + } + +## GreenRobot EventBus specific rules ## +# https://github.com/greenrobot/EventBus/blob/master/HOWTO.md#proguard-configuration +-keepclassmembers class ** { + public void onEvent*(***); +} + +# Only required if you use AsyncExecutor +-keepclassmembers class * extends de.greenrobot.event.util.ThrowableFailureEvent { + public (java.lang.Throwable); +} + +# Don't warn for missing support classes +-dontwarn de.greenrobot.event.util.*$Support +-dontwarn de.greenrobot.event.util.*$SupportManagerFragment + +# Glide specific rules # +# https://github.com/bumptech/glide +-keep public class * implements com.bumptech.glide.module.GlideModule +-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** { + **[] $VALUES; + public *; +} + + +# RxJava 0.21 + +-keep class rx.schedulers.Schedulers { + public static ; +} +-keep class rx.schedulers.ImmediateScheduler { + public ; +} +-keep class rx.schedulers.TestScheduler { + public ; +} +-keep class rx.schedulers.Schedulers { + public static ** test(); +} +-dontwarn sun.misc.Unsafe + +# AppCombat +-keep public class android.support.v7.widget.** { *; } +-keep public class android.support.v7.internal.widget.** { *; } +-keep public class android.support.v7.internal.view.menu.** { *; } + +-keep public class * extends android.support.v4.view.ActionProvider { + public (android.content.Context); +} \ No newline at end of file diff --git a/app/src/main/assets/fonts/PTSans-Narrow.ttf b/app/src/main/assets/fonts/PTSans-Narrow.ttf new file mode 100644 index 000000000..df8ba7185 Binary files /dev/null and b/app/src/main/assets/fonts/PTSans-Narrow.ttf differ diff --git a/app/src/main/assets/fonts/PTSans-NarrowBold.ttf b/app/src/main/assets/fonts/PTSans-NarrowBold.ttf new file mode 100644 index 000000000..74494e851 Binary files /dev/null and b/app/src/main/assets/fonts/PTSans-NarrowBold.ttf differ diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/adapter/MangaLibraryHolder.java b/app/src/main/java/eu/kanade/mangafeed/ui/adapter/MangaLibraryHolder.java index 4f5411f35..87112f765 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/adapter/MangaLibraryHolder.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/adapter/MangaLibraryHolder.java @@ -17,22 +17,29 @@ import uk.co.ribot.easyadapter.annotations.ViewId; @LayoutId(R.layout.item_library) public class MangaLibraryHolder extends ItemViewHolder { - @ViewId(R.id.thumbnailImageView) - ImageView mImageView; + @ViewId(R.id.thumbnailImage) + ImageView mThumbImage; - @ViewId(R.id.nameTextView) - TextView mTextView; + @ViewId(R.id.titleText) + TextView mTitleText; + + @ViewId(R.id.unreadText) + TextView mUnreadText; public MangaLibraryHolder(View view) { super(view); } public void onSetValues(Manga manga, PositionInfo positionInfo) { - mTextView.setText(manga.title); + mTitleText.setText(manga.title); + if (manga.unread > 0) { + mUnreadText.setVisibility(View.VISIBLE); + mUnreadText.setText(Integer.toString(manga.unread)); + } Glide.with(getContext()) .load("http://img1.wikia.nocookie.net/__cb20090524204255/starwars/images/thumb/1/1a/R2d2.jpg/400px-R2d2.jpg") .centerCrop() - .into(mImageView); + .into(mThumbImage); } } diff --git a/app/src/main/java/eu/kanade/mangafeed/widget/PTSansTextView.java b/app/src/main/java/eu/kanade/mangafeed/widget/PTSansTextView.java new file mode 100644 index 000000000..2486669e9 --- /dev/null +++ b/app/src/main/java/eu/kanade/mangafeed/widget/PTSansTextView.java @@ -0,0 +1,52 @@ +package eu.kanade.mangafeed.widget; + +import android.content.Context; +import android.content.res.TypedArray; +import android.graphics.Typeface; +import android.util.AttributeSet; +import android.widget.TextView; + +import eu.kanade.mangafeed.R; + + +public class PTSansTextView extends TextView { + private final static int PTSANS_NARROW = 0; + private final static int PTSANS_NARROW_BOLD = 1; + + + public PTSansTextView(Context c) { + super(c); + } + + public PTSansTextView(Context c, AttributeSet attrs) { + super(c, attrs); + parseAttributes(c, attrs); + } + + public PTSansTextView(Context c, AttributeSet attrs, int defStyle) { + super(c, attrs, defStyle); + parseAttributes(c, attrs); + } + + private void parseAttributes(Context c, AttributeSet attrs) { + TypedArray values = c.obtainStyledAttributes(attrs, R.styleable.PTSansTextView); + + //The value 0 is a default, but shouldn't ever be used since the attr is an enum + int typeface = values.getInt(R.styleable.PTSansTextView_typeface, 0); + + switch(typeface) { + case PTSANS_NARROW: + //You can instantiate your typeface anywhere, I would suggest as a + //singleton somewhere to avoid unnecessary copies + setTypeface(Typeface.createFromAsset(c.getAssets(), "fonts/PTSans-Narrow.ttf")); + break; + case PTSANS_NARROW_BOLD: + setTypeface(Typeface.createFromAsset(c.getAssets(), "fonts/PTSans-NarrowBold.ttf")); + break; + default: + throw new IllegalArgumentException("Font not found " + typeface); + } + + values.recycle(); + } +} diff --git a/app/src/main/res/layout/item_library.xml b/app/src/main/res/layout/item_library.xml index e8535d72f..3fcaa31f2 100644 --- a/app/src/main/res/layout/item_library.xml +++ b/app/src/main/res/layout/item_library.xml @@ -2,35 +2,58 @@ - + android:layout_height="wrap_content"> + + + + + + + android:background="@color/md_grey_300"> - diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml new file mode 100644 index 000000000..004e4fc80 --- /dev/null +++ b/app/src/main/res/values/attrs.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + \ No newline at end of file