mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-21 20:47:03 -05:00
Remove reflection to show tracking checkmark
Icon now shows up on the left, but code is less fragile.
This commit is contained in:
parent
879d260202
commit
5bad914411
2 changed files with 6 additions and 13 deletions
|
@ -2,18 +2,16 @@ package eu.kanade.tachiyomi.ui.manga
|
||||||
|
|
||||||
import android.Manifest.permission.WRITE_EXTERNAL_STORAGE
|
import android.Manifest.permission.WRITE_EXTERNAL_STORAGE
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import com.google.android.material.tabs.TabLayout
|
|
||||||
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat
|
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.LinearLayout
|
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat
|
||||||
import android.widget.TextView
|
|
||||||
import com.bluelinelabs.conductor.ControllerChangeHandler
|
import com.bluelinelabs.conductor.ControllerChangeHandler
|
||||||
import com.bluelinelabs.conductor.ControllerChangeType
|
import com.bluelinelabs.conductor.ControllerChangeType
|
||||||
import com.bluelinelabs.conductor.Router
|
import com.bluelinelabs.conductor.Router
|
||||||
import com.bluelinelabs.conductor.RouterTransaction
|
import com.bluelinelabs.conductor.RouterTransaction
|
||||||
import com.bluelinelabs.conductor.support.RouterPagerAdapter
|
import com.bluelinelabs.conductor.support.RouterPagerAdapter
|
||||||
|
import com.google.android.material.tabs.TabLayout
|
||||||
import com.jakewharton.rxrelay.BehaviorRelay
|
import com.jakewharton.rxrelay.BehaviorRelay
|
||||||
import com.jakewharton.rxrelay.PublishRelay
|
import com.jakewharton.rxrelay.PublishRelay
|
||||||
import eu.kanade.tachiyomi.R
|
import eu.kanade.tachiyomi.R
|
||||||
|
@ -29,8 +27,8 @@ import eu.kanade.tachiyomi.ui.manga.chapter.ChaptersController
|
||||||
import eu.kanade.tachiyomi.ui.manga.info.MangaInfoController
|
import eu.kanade.tachiyomi.ui.manga.info.MangaInfoController
|
||||||
import eu.kanade.tachiyomi.ui.manga.track.TrackController
|
import eu.kanade.tachiyomi.ui.manga.track.TrackController
|
||||||
import eu.kanade.tachiyomi.util.toast
|
import eu.kanade.tachiyomi.util.toast
|
||||||
import kotlinx.android.synthetic.main.main_activity.*
|
import kotlinx.android.synthetic.main.main_activity.tabs
|
||||||
import kotlinx.android.synthetic.main.manga_controller.*
|
import kotlinx.android.synthetic.main.manga_controller.manga_pager
|
||||||
import rx.Subscription
|
import rx.Subscription
|
||||||
import uy.kohesive.injekt.Injekt
|
import uy.kohesive.injekt.Injekt
|
||||||
import uy.kohesive.injekt.api.get
|
import uy.kohesive.injekt.api.get
|
||||||
|
@ -140,10 +138,7 @@ class MangaController : RxController, TabbedController {
|
||||||
VectorDrawableCompat.create(resources!!, R.drawable.ic_done_white_18dp, null)
|
VectorDrawableCompat.create(resources!!, R.drawable.ic_done_white_18dp, null)
|
||||||
else null
|
else null
|
||||||
|
|
||||||
val view = tabField.get(tab) as LinearLayout
|
tab.icon = drawable
|
||||||
val textView = view.getChildAt(1) as TextView
|
|
||||||
textView.setCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null)
|
|
||||||
textView.compoundDrawablePadding = if (visible) 4 else 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private inner class MangaDetailAdapter : RouterPagerAdapter(this@MangaController) {
|
private inner class MangaDetailAdapter : RouterPagerAdapter(this@MangaController) {
|
||||||
|
@ -185,9 +180,6 @@ class MangaController : RxController, TabbedController {
|
||||||
const val INFO_CONTROLLER = 0
|
const val INFO_CONTROLLER = 0
|
||||||
const val CHAPTERS_CONTROLLER = 1
|
const val CHAPTERS_CONTROLLER = 1
|
||||||
const val TRACK_CONTROLLER = 2
|
const val TRACK_CONTROLLER = 2
|
||||||
|
|
||||||
private val tabField = TabLayout.Tab::class.java.getDeclaredField("view")
|
|
||||||
.apply { isAccessible = true }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:theme="@style/Theme.ActionBar.Tab"
|
android:theme="@style/Theme.ActionBar.Tab"
|
||||||
app:tabIndicatorColor="@android:color/white"
|
app:tabIndicatorColor="@android:color/white"
|
||||||
|
app:tabInlineLabel="true"
|
||||||
app:tabGravity="center"
|
app:tabGravity="center"
|
||||||
app:tabMode="scrollable"
|
app:tabMode="scrollable"
|
||||||
app:tabMinWidth="75dp"/>
|
app:tabMinWidth="75dp"/>
|
||||||
|
|
Loading…
Reference in a new issue