Rename AppTheme to Theme

This commit is contained in:
Lucas Lima 2020-08-07 15:22:18 -03:00
parent 3c7f50d079
commit be20ad9172
No known key found for this signature in database
GPG key ID: 049CCC5A365B00D2
5 changed files with 23 additions and 23 deletions

View file

@ -72,7 +72,7 @@ class ShareBuilder(
area.paintOnCanvas(
context,
canvas,
appTheme = DarkTheme,
theme = DarkTheme,
isAmbientMode = false,
isLowBitAmbient = false,
isFocused = false,

View file

@ -64,10 +64,10 @@ class ThemeAdapter(
}
}
private fun AreaView.bindTheme(area: Area, appTheme: AppTheme, paintSettings: AreaPaintSettings) {
private fun AreaView.bindTheme(area: Area, theme: AppTheme, paintSettings: AreaPaintSettings) {
bindField(
area,
appTheme,
area = area,
theme = theme,
isAmbientMode = false,
isLowBitAmbient = false,
paintSettings = paintSettings

View file

@ -13,9 +13,9 @@ class ThemeViewModel @ViewModelInject constructor(
fun getThemes(): List<AppTheme> = themeRepository.getAllThemes()
fun setTheme(appTheme: AppTheme) {
themeRepository.setTheme(appTheme)
theme.postValue(appTheme)
fun setTheme(theme: AppTheme) {
themeRepository.setTheme(theme)
this.theme.postValue(theme)
}
}

View file

@ -48,7 +48,7 @@ class AreaScreenshot {
isLowBitAmbient = false,
isFocused = false,
paintSettings = paintSettings,
appTheme = LightTheme
theme = LightTheme
)
canvas.restore()

View file

@ -19,7 +19,7 @@ fun Area.paintOnCanvas(
isLowBitAmbient: Boolean,
isFocused: Boolean,
paintSettings: AreaPaintSettings,
appTheme: AppTheme,
theme: AppTheme,
markPadding: Int? = null,
minePadding: Int? = null
) {
@ -30,14 +30,14 @@ fun Area.paintOnCanvas(
style = Paint.Style.STROKE
strokeWidth = 2.0f
isAntiAlias = !isLowBitAmbient
color = appTheme.palette.border
color = theme.palette.border
alpha = 0xff
}
} else {
painter.apply {
style = Paint.Style.FILL
isAntiAlias = !isLowBitAmbient
color = appTheme.palette.covered
color = theme.palette.covered
alpha = if (highlighted) 155 else 255
}
}
@ -83,14 +83,14 @@ fun Area.paintOnCanvas(
style = Paint.Style.STROKE
strokeWidth = 0.5f
isAntiAlias = !isLowBitAmbient
color = appTheme.palette.border
color = theme.palette.border
alpha = 0xff
}
} else {
painter.apply {
style = Paint.Style.FILL
isAntiAlias = !isLowBitAmbient
color = appTheme.palette.uncovered
color = theme.palette.uncovered
alpha = 0xff
}
}
@ -118,14 +118,14 @@ fun Area.paintOnCanvas(
} else if (minesAround > 0) {
painter.apply {
color = when (minesAround) {
1 -> appTheme.palette.minesAround1
2 -> appTheme.palette.minesAround2
3 -> appTheme.palette.minesAround3
4 -> appTheme.palette.minesAround4
5 -> appTheme.palette.minesAround5
6 -> appTheme.palette.minesAround6
7 -> appTheme.palette.minesAround7
8 -> appTheme.palette.minesAround8
1 -> theme.palette.minesAround1
2 -> theme.palette.minesAround2
3 -> theme.palette.minesAround3
4 -> theme.palette.minesAround4
5 -> theme.palette.minesAround5
6 -> theme.palette.minesAround6
7 -> theme.palette.minesAround7
8 -> theme.palette.minesAround8
else -> 0x00
}
alpha = 0xff
@ -141,7 +141,7 @@ fun Area.paintOnCanvas(
style = Paint.Style.STROKE
strokeWidth = highlightWidth
isAntiAlias = !isLowBitAmbient
color = appTheme.palette.highlight
color = theme.palette.highlight
alpha = 0xff
val rect = RectF(
@ -164,7 +164,7 @@ fun Area.paintOnCanvas(
style = Paint.Style.STROKE
strokeWidth = highlightWidth
isAntiAlias = !isLowBitAmbient
color = appTheme.palette.focus
color = theme.palette.focus
alpha = 0xff
}