优化界面显示
This commit is contained in:
9 files changed
+107
-65
No files matched your search
@@ -52,14 +52,14 @@ class LabelsBar @JvmOverloads constructor(
|
||||
addView(chip)
|
||||
}
|
||||
|
||||
fun applyColorScheme(colorPrimaryContainer: Int, colorOnPrimaryContainer: Int) {
|
||||
fun applyColorScheme(backgroundColor: Int, textColor: Int) {
|
||||
usedChips.forEach { chip ->
|
||||
chip.chipBackgroundColor = ColorStateList.valueOf(colorPrimaryContainer)
|
||||
chip.setTextColor(colorOnPrimaryContainer)
|
||||
chip.chipBackgroundColor = ColorStateList.valueOf(backgroundColor)
|
||||
chip.setTextColor(textColor)
|
||||
}
|
||||
unUsedChips.forEach { chip ->
|
||||
chip.chipBackgroundColor = ColorStateList.valueOf(colorPrimaryContainer)
|
||||
chip.setTextColor(colorOnPrimaryContainer)
|
||||
chip.chipBackgroundColor = ColorStateList.valueOf(backgroundColor)
|
||||
chip.setTextColor(textColor)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,12 +5,10 @@ import android.content.res.ColorStateList
|
||||
import android.util.AttributeSet
|
||||
import android.view.Menu
|
||||
import android.view.View
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import com.google.android.material.appbar.AppBarLayout
|
||||
import com.google.android.material.appbar.MaterialToolbar
|
||||
import io.legato.kazusa.R
|
||||
import io.legato.kazusa.help.config.AppConfig
|
||||
//import io.legado.app.lib.theme.primaryColor
|
||||
import io.legato.kazusa.utils.activity
|
||||
import io.legato.kazusa.utils.setOnApplyWindowInsetsListenerCompat
|
||||
import splitties.views.bottomPadding
|
||||
@@ -22,7 +20,7 @@ class TitleBar @JvmOverloads constructor(
|
||||
attrs: AttributeSet? = null
|
||||
) : AppBarLayout(context, attrs) {
|
||||
|
||||
val toolbar: Toolbar
|
||||
val toolbar: MaterialToolbar
|
||||
val menu: Menu
|
||||
get() = toolbar.menu
|
||||
|
||||
|
||||
Reference in new issue
Block a user