Add system label to default theme

This commit is contained in:
Lucas Lima 2020-08-09 22:46:06 -03:00
parent 74f37568a6
commit a37d361ccd
No known key found for this signature in database
GPG key ID: C5EEF4C30BFBF8D7
3 changed files with 31 additions and 2 deletions

View file

@ -57,8 +57,24 @@ class ThemeAdapter(
val theme = themes[position]
val paintSettings = createAreaPaintSettings(holder.itemView.context, areaSize)
holder.itemView.run {
arrayOf(area0, area1, area2, area3, area4, area5, area6, area7, area8)
.forEachIndexed { index, areaView -> areaView.bindTheme(minefield[index], theme, paintSettings) }
val areas = listOf(area0, area1, area2, area3, area4, area5, area6, area7, area8)
areas.forEachIndexed { index, areaView -> areaView.bindTheme(minefield[index], theme, paintSettings) }
if (position == 0) {
areas.forEach { it.alpha = 0.35f }
label.apply {
setTextColor(with(theme.palette.background) {
Color.rgb(255 - Color.red(this), 255 - Color.green(this), 255 - Color.blue(this))
})
setBackgroundResource(android.R.color.transparent)
visibility = View.VISIBLE
}
} else {
label.visibility = View.GONE
}
val color = with(theme.palette.background) {
Color.rgb(Color.red(this), Color.green(this), Color.blue(this))

View file

@ -72,6 +72,18 @@
android:layout_margin="0.5dp" />
</GridLayout>
<TextView
android:id="@+id/label"
android:text="@string/system"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textAllCaps="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/clickTheme"
android:layout_width="0dp"

View file

@ -31,6 +31,7 @@
<string name="settings_accessibility">Accessibility</string>
<string name="settings_large_areas">Use Large Areas</string>
<string name="size">Size</string>
<string name="system">System</string>
<string name="rating">Feedback</string>
<string name="rating_message">If you like this game, please give us a feedback. It will help us a lot.</string>
<string name="used_software_text">This game uses the following third parties software:</string>