From 2b1752de0947c2a27450f4925b4b637e1ba12cad Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 19 Jan 2020 16:26:38 -0500 Subject: [PATCH] Remove reflection to show tracking checkmark --- .../kanade/tachiyomi/ui/manga/MangaController.kt | 16 ++++------------ app/src/main/res/layout/main_activity.xml | 1 + 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt index 1e736621eb..39d996b6b4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt @@ -5,8 +5,6 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import android.widget.LinearLayout -import android.widget.TextView import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat import com.bluelinelabs.conductor.ControllerChangeHandler import com.bluelinelabs.conductor.ControllerChangeType @@ -32,9 +30,9 @@ import eu.kanade.tachiyomi.ui.manga.chapter.ChaptersController import eu.kanade.tachiyomi.ui.manga.info.MangaInfoController import eu.kanade.tachiyomi.ui.manga.track.TrackController import eu.kanade.tachiyomi.util.toast -import kotlinx.android.synthetic.main.main_activity.* -import kotlinx.android.synthetic.main.manga_controller.* -import kotlinx.android.synthetic.main.search_activity.* +import kotlinx.android.synthetic.main.search_activity.sTabs +import kotlinx.android.synthetic.main.main_activity.tabs +import kotlinx.android.synthetic.main.manga_controller.manga_pager import rx.Subscription import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get @@ -190,10 +188,7 @@ class MangaController : RxController, TabbedController { VectorDrawableCompat.create(resources!!, R.drawable.ic_done_white_18dp, null) else null - val view = tabField.get(tab) as LinearLayout - val textView = view.getChildAt(1) as TextView - textView.setCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null) - textView.compoundDrawablePadding = if (visible) 4 else 0 + tab.icon = drawable } private inner class MangaDetailAdapter : RouterPagerAdapter(this@MangaController) { @@ -240,9 +235,6 @@ class MangaController : RxController, TabbedController { const val INFO_CONTROLLER = 0 const val CHAPTERS_CONTROLLER = 1 const val TRACK_CONTROLLER = 2 - - private val tabField = TabLayout.Tab::class.java.getDeclaredField("view") - .apply { isAccessible = true } } } diff --git a/app/src/main/res/layout/main_activity.xml b/app/src/main/res/layout/main_activity.xml index 54f1f22952..dcf56075b1 100644 --- a/app/src/main/res/layout/main_activity.xml +++ b/app/src/main/res/layout/main_activity.xml @@ -39,6 +39,7 @@ android:layout_height="wrap_content" android:theme="@style/Theme.ActionBar.Tab" app:tabIndicatorColor="@android:color/white" + app:tabInlineLabel="true" app:tabGravity="center" app:tabMode="scrollable" app:tabMinWidth="75dp"/>