Don't show last chapter number when there are 0 chapters or chapters with no numbers.

This prevents one shots from showing with -1 as last chapter and instead just leaves it blank
This commit is contained in:
Carlos Escobedo 2018-01-24 20:12:47 -05:00
parent b7903023b6
commit 431676acd1

View File

@ -7,7 +7,6 @@ import android.content.ClipboardManager
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.graphics.Bitmap import android.graphics.Bitmap
import android.graphics.Color
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.net.Uri import android.net.Uri
import android.os.Build import android.os.Build
@ -249,8 +248,10 @@ class MangaInfoController : NucleusController<MangaInfoPresenter>(),
* @param count number of chapters. * @param count number of chapters.
*/ */
fun setChapterCount(count: Float) { fun setChapterCount(count: Float) {
if (count > 0f) {
manga_chapters?.text = DecimalFormat("#.#").format(count) manga_chapters?.text = DecimalFormat("#.#").format(count)
} }
}
fun setLastUpdateDate(date: Date) { fun setLastUpdateDate(date: Date) {
manga_last_update?.text = DateFormat.getDateInstance(DateFormat.SHORT).format(date) manga_last_update?.text = DateFormat.getDateInstance(DateFormat.SHORT).format(date)