From d9ce8d2a399efe65f60bf12173aabf9ec3f5452f Mon Sep 17 00:00:00 2001 From: Carlos Date: Sun, 1 Sep 2019 19:46:50 -0400 Subject: [PATCH] change from spinner to text for now --- .../ui/manga/info/MangaInfoController.kt | 26 +++++++------------ .../res/layout-land/manga_info_controller.xml | 6 +++-- .../main/res/layout/manga_info_controller.xml | 6 +++-- 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt index 4183f42f92..6a31b4dbfe 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt @@ -15,7 +15,6 @@ import android.support.v4.content.pm.ShortcutInfoCompat import android.support.v4.content.pm.ShortcutManagerCompat import android.support.v4.graphics.drawable.IconCompat import android.view.* -import android.widget.ArrayAdapter import android.widget.Toast import com.afollestad.materialdialogs.MaterialDialog import com.bumptech.glide.load.engine.DiskCacheStrategy @@ -30,7 +29,6 @@ import com.mikepenz.iconics.IconicsDrawable import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Category import eu.kanade.tachiyomi.data.database.models.Manga -import eu.kanade.tachiyomi.data.database.models.Manga.Companion.toDatabaseInt import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.data.notification.NotificationReceiver import eu.kanade.tachiyomi.data.preference.PreferencesHelper @@ -125,16 +123,6 @@ class MangaInfoController : NucleusController(), manga_cover.longClicks().subscribeUntilDestroy { copyToClipboard(view.context.getString(R.string.title), presenter.manga.title) } - ArrayAdapter.createFromResource( - this.applicationContext, - R.array.follows_options, - android.R.layout.simple_spinner_item - ).also { adapter -> - // Specify the layout to use when the list of choices appears - adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item) - // Apply the adapter to the spinner - follows_spinner.adapter = adapter - } } override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { @@ -233,10 +221,16 @@ class MangaInfoController : NucleusController(), else -> R.string.unknown }) - manga.follow_status.let { - follows_spinner.setSelection(manga.follow_status!!.toDatabaseInt()) - } - + // Update status TextView. + follows_spinner.setText(when (manga.follow_status) { + SManga.FollowStatus.COMPLETED -> R.string.follows_completed + SManga.FollowStatus.DROPPED -> R.string.follows_dropped + SManga.FollowStatus.ON_HOLD -> R.string.follows_on_hold + SManga.FollowStatus.PLAN_TO_READ -> R.string.follows_plan_to_read + SManga.FollowStatus.READING -> R.string.follows_reading + SManga.FollowStatus.RE_READING -> R.string.follows_re_reading + else -> R.string.follows_unfollowed + }) // Set the favorite drawable to the correct one. setFavoriteDrawable(manga.favorite) diff --git a/app/src/main/res/layout-land/manga_info_controller.xml b/app/src/main/res/layout-land/manga_info_controller.xml index de778ac101..26fd42c78b 100644 --- a/app/src/main/res/layout-land/manga_info_controller.xml +++ b/app/src/main/res/layout-land/manga_info_controller.xml @@ -192,11 +192,13 @@ app:layout_constraintTop_toBottomOf="@+id/manga_status_label" app:layout_constraintLeft_toLeftOf="parent"/> - diff --git a/app/src/main/res/layout/manga_info_controller.xml b/app/src/main/res/layout/manga_info_controller.xml index 52fb0d97c3..5c0b7be614 100644 --- a/app/src/main/res/layout/manga_info_controller.xml +++ b/app/src/main/res/layout/manga_info_controller.xml @@ -216,11 +216,13 @@ app:layout_constraintTop_toBottomOf="@+id/manga_status_label" app:layout_constraintLeft_toLeftOf="parent"/> -