Merge pull request #145 from lucasnlm/add-themes-feature

Fix Kitkat themes
This commit is contained in:
Lucas Nunes 2020-08-11 02:26:47 +00:00 committed by GitHub
commit 6e421ca86f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 51 additions and 11 deletions

View file

@ -9,8 +9,8 @@ android {
defaultConfig {
// versionCode and versionName must be hardcoded to support F-droid
versionCode 800001
versionName '8.0.0'
versionCode 800011
versionName '8.0.1'
minSdkVersion 16
targetSdkVersion 30
multiDexEnabled true

View file

@ -13,6 +13,7 @@ import androidx.activity.viewModels
import androidx.appcompat.app.ActionBarDrawerToggle
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.widget.TooltipCompat
import androidx.core.content.ContextCompat
import androidx.core.os.HandlerCompat.postDelayed
import androidx.core.view.GravityCompat
import androidx.drawerlayout.widget.DrawerLayout
@ -229,6 +230,10 @@ class GameActivity : ThematicActivity(R.layout.activity_game), DialogInterface.O
drawer.openDrawer(GravityCompat.START)
}
}
minesCount.setCompoundDrawablesWithIntrinsicBounds(
ContextCompat.getDrawable(this, usingTheme.assets.toolbarMine), null, null, null
)
}
private fun refreshNewGameButton() {

View file

@ -9,8 +9,8 @@ android {
defaultConfig {
// versionCode and versionName must be hardcoded to support F-droid
versionCode 800001
versionName '8.0.0'
versionCode 800011
versionName '8.0.1'
minSdkVersion 16
targetSdkVersion 30
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'

View file

@ -6,6 +6,7 @@ data class Assets(
@DrawableRes val wrongFlag: Int,
@DrawableRes val flag: Int,
@DrawableRes val questionMark: Int,
@DrawableRes val toolbarMine: Int,
@DrawableRes val mine: Int,
@DrawableRes val mineExploded: Int,
@DrawableRes val mineLow: Int

View file

@ -52,6 +52,7 @@ class ThemeRepository(
wrongFlag = R.drawable.red_flag,
flag = R.drawable.flag,
questionMark = R.drawable.question,
toolbarMine = R.drawable.mine,
mine = R.drawable.mine,
mineExploded = R.drawable.mine_exploded_red,
mineLow = R.drawable.mine_low

View file

@ -30,6 +30,7 @@ object Themes {
wrongFlag = R.drawable.red_flag,
flag = R.drawable.flag,
questionMark = R.drawable.question,
toolbarMine = R.drawable.mine,
mine = R.drawable.mine,
mineExploded = R.drawable.mine_exploded_red,
mineLow = R.drawable.mine_low
@ -60,6 +61,7 @@ object Themes {
wrongFlag = R.drawable.flag,
flag = R.drawable.flag,
questionMark = R.drawable.question,
toolbarMine = R.drawable.mine_low,
mine = R.drawable.mine,
mineExploded = R.drawable.mine_exploded_white,
mineLow = R.drawable.mine_low

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="Theme.AppCompat.DayNight.DarkActionBar">
<style name="AppTheme" parent="Theme.AppCompat.DayNight">
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primary_dark</item>
<item name="colorAccent">@color/accent</item>
@ -22,4 +22,35 @@
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.DayNight.ActionBar" />
<style name="CustomLightTheme" parent="ThemeOverlay.AppCompat.Light">
<item name="colorPrimary">#FFFFFF</item>
<item name="colorPrimaryDark">#9E9E9E</item>
<item name="colorAccent">#D32F2F</item>
<item name="android:background">#FFFFFF</item>
</style>
<style name="CustomLightTheme.NoActionBar" parent="ThemeOverlay.AppCompat.Light">
<item name="colorPrimary">#FFFFFF</item>
<item name="colorPrimaryDark">#9E9E9E</item>
<item name="colorAccent">#D32F2F</item>
<item name="android:background">#FFFFFF</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="CustomDarkTheme" parent="ThemeOverlay.AppCompat.Dark">
<item name="colorPrimary">#212121</item>
<item name="colorPrimaryDark">#212121</item>
<item name="colorAccent">#FFFFFF</item>
<item name="android:background">#212121</item>
</style>
<style name="CustomDarkTheme.NoActionBar" parent="ThemeOverlay.AppCompat.Dark">
<item name="colorPrimary">#212121</item>
<item name="colorPrimaryDark">#212121</item>
<item name="colorAccent">#FFFFFF</item>
<item name="android:background">#212121</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
</resources>

View file

@ -6,8 +6,8 @@ android {
compileSdkVersion 30
defaultConfig {
versionCode 800001 // MMmmPPv
versionName '8.0.0'
versionCode 800011 // MMmmPPv
versionName '8.0.1'
minSdkVersion 16
targetSdkVersion 30
}

View file

@ -6,8 +6,8 @@ android {
compileSdkVersion 30
defaultConfig {
versionCode 800001 // MMmmPPv
versionName '8.0.0'
versionCode 800011 // MMmmPPv
versionName '8.0.1'
minSdkVersion 16
targetSdkVersion 30
}

View file

@ -9,8 +9,8 @@ android {
defaultConfig {
// versionCode and versionName must be hardcoded to support F-droid
versionCode 800001
versionName '8.0.0'
versionCode 800011
versionName '8.0.1'
applicationId 'dev.lucasnlm.antimine'
minSdkVersion 23
targetSdkVersion 30