Highlight selected theme
This commit is contained in:
parent
9743e27403
commit
f9fee40c70
2 changed files with 8 additions and 2 deletions
|
@ -58,11 +58,18 @@ class ThemeAdapter(
|
|||
val theme = themes[position]
|
||||
val paintSettings = createAreaPaintSettings(holder.itemView.context, areaSize)
|
||||
holder.itemView.run {
|
||||
val selected = (theme.id == themeViewModel.singleState().current.id)
|
||||
val areas = listOf(area0, area1, area2, area3, area4, area5, area6, area7, area8)
|
||||
|
||||
if (selected) {
|
||||
areas.forEach { it.alpha = 0.25f }
|
||||
} else {
|
||||
areas.forEach { it.alpha = 1.0f }
|
||||
}
|
||||
|
||||
areas.forEachIndexed { index, areaView -> areaView.bindTheme(minefield[index], theme, paintSettings) }
|
||||
|
||||
if (position < 2) {
|
||||
if (position < 2 && !selected) {
|
||||
areas.forEach { it.alpha = 0.35f }
|
||||
|
||||
label.apply {
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:columnCount="3"
|
||||
android:background="#FFFF0000"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
|
|
Loading…
Reference in a new issue