diff --git a/about/build.gradle b/about/build.gradle
index ff0b88537..27f60ee01 100644
--- a/about/build.gradle
+++ b/about/build.gradle
@@ -23,12 +23,8 @@ android {
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_17
- targetCompatibility JavaVersion.VERSION_17
- }
-
- kotlin {
- jvmToolchain(17)
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
}
buildFeatures {
@@ -47,11 +43,11 @@ dependencies {
implementation project(':external')
// Google
- implementation 'com.google.android.material:material:1.9.0'
+ implementation 'com.google.android.material:material:1.10.0'
// AndroidX
implementation 'androidx.appcompat:appcompat:1.6.1'
- implementation 'androidx.activity:activity-ktx:1.7.2'
+ implementation 'androidx.activity:activity-ktx:1.8.0'
implementation 'androidx.fragment:fragment-ktx:1.6.1'
// RecyclerView
diff --git a/about/src/main/java/dev/lucasnlm/antimine/licenses/views/LicensesFragment.kt b/about/src/main/java/dev/lucasnlm/antimine/licenses/views/LicensesFragment.kt
index 0e1226a6e..3414493f4 100644
--- a/about/src/main/java/dev/lucasnlm/antimine/licenses/views/LicensesFragment.kt
+++ b/about/src/main/java/dev/lucasnlm/antimine/licenses/views/LicensesFragment.kt
@@ -11,6 +11,7 @@ import com.google.android.material.divider.MaterialDividerItemDecoration
import dev.lucasnlm.antimine.about.R
import dev.lucasnlm.antimine.about.databinding.FragmentLicensesBinding
import dev.lucasnlm.antimine.licenses.viewmodel.LicenseViewModel
+import kotlinx.coroutines.launch
import org.koin.androidx.viewmodel.ext.android.sharedViewModel
class LicensesFragment : Fragment(R.layout.fragment_licenses) {
@@ -21,7 +22,7 @@ class LicensesFragment : Fragment(R.layout.fragment_licenses) {
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?,
- ): View? {
+ ): View {
binding = FragmentLicensesBinding.inflate(inflater, container, false)
return binding.root
}
@@ -32,7 +33,7 @@ class LicensesFragment : Fragment(R.layout.fragment_licenses) {
) {
super.onViewCreated(view, savedInstanceState)
- lifecycleScope.launchWhenResumed {
+ lifecycleScope.launch {
viewModel
.observeState()
.collect {
diff --git a/app/build.gradle b/app/build.gradle
index 3018fe463..6e0b85a97 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,21 +1,15 @@
-apply plugin: 'com.android.application'
-
-if (System.getenv('IS_GOOGLE_BUILD')) {
- apply plugin: 'com.google.gms.google-services'
- apply plugin: 'com.google.firebase.crashlytics'
- apply plugin: 'com.google.firebase.firebase-perf'
+plugins {
+ id 'com.android.application'
+ id('kotlin-android')
}
-apply plugin: 'kotlin-android'
-apply plugin: 'kotlin-kapt'
-
android {
namespace 'dev.lucasnlm.antimine'
defaultConfig {
// versionCode and versionName must be hardcoded to support F-droid
- versionCode 1705001
- versionName '17.5.0'
+ versionCode 1705011
+ versionName '17.5.1'
minSdk 21
targetSdk 34
compileSdk 34
@@ -56,8 +50,8 @@ android {
}
compileOptions {
- targetCompatibility JavaVersion.VERSION_17
- sourceCompatibility JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
+ sourceCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
@@ -77,6 +71,10 @@ android {
dimension 'version'
applicationId 'dev.lucasnlm.antimine'
versionNameSuffix ' S'
+
+ apply plugin: 'com.google.gms.google-services'
+ apply plugin: 'com.google.firebase.crashlytics'
+ apply plugin: 'com.google.firebase.firebase-perf'
}
googleInstant {
@@ -84,6 +82,10 @@ android {
dimension 'version'
applicationId 'dev.lucasnlm.antimine'
versionNameSuffix ' I'
+
+ apply plugin: 'com.google.gms.google-services'
+ apply plugin: 'com.google.firebase.crashlytics'
+ apply plugin: 'com.google.firebase.firebase-perf'
}
foss {
@@ -95,10 +97,6 @@ android {
}
}
-kapt {
- correctErrorTypes true
-}
-
dependencies {
// Dependencies must be hardcoded to support F-droid
@@ -129,7 +127,7 @@ dependencies {
implementation 'androidx.preference:preference-ktx:1.2.1'
implementation 'androidx.recyclerview:recyclerview:1.3.1'
implementation 'androidx.multidex:multidex:2.0.1'
- implementation 'androidx.activity:activity-ktx:1.7.2'
+ implementation 'androidx.activity:activity-ktx:1.8.0'
implementation 'androidx.fragment:fragment-ktx:1.6.1'
// Lifecycle
@@ -142,7 +140,7 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
// Google
- implementation 'com.google.android.material:material:1.9.0'
+ implementation 'com.google.android.material:material:1.10.0'
// Koin
implementation 'io.insert-koin:koin-android:3.1.2'
@@ -188,3 +186,17 @@ tasks.withType(Test).configureEach {
println "Executing test ${desc.name} [${desc.className}] with result: ${result.resultType}"
}
}
+
+// The following code disables Google Services when building for F-Droid
+if (System.getenv('IS_GOOGLE_BUILD') == null) {
+ android.applicationVariants.configureEach { variant ->
+ if (variant.flavorName == 'foss') {
+ project.tasks.names.findAll { it.contains("Google") }
+ .forEach { taskName ->
+ project.tasks.named(taskName).configure {
+ enabled = false
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
index 35cf08c7b..4e9e75b87 100644
--- a/app/proguard-rules.pro
+++ b/app/proguard-rules.pro
@@ -33,6 +33,8 @@
-dontwarn org.openjsse.**
# For Google Play Services
+-keepattributes Signature
+-keep class com.google.android.gms.** { *; }
-keep class io.grpc.** {*;}
-keep public class com.google.android.gms.ads.** {
public *;
@@ -54,8 +56,11 @@
-dontwarn sun.nio.ch.**
-dontwarn sun.misc.**
-# LibGDX
+# Firebase
+-keep class com.google.android.gms.** { *; }
+-keep class com.google.firebase.** { *; }
+# LibGDX
-keep class com.badlogic.gdx.scenes.** { *; }
-dontwarn com.badlogic.gdx.backends.android.AndroidFragmentApplication
diff --git a/app/src/main/java/dev/lucasnlm/antimine/GameActivity.kt b/app/src/main/java/dev/lucasnlm/antimine/GameActivity.kt
index 8e4db2c37..e6b87d832 100644
--- a/app/src/main/java/dev/lucasnlm/antimine/GameActivity.kt
+++ b/app/src/main/java/dev/lucasnlm/antimine/GameActivity.kt
@@ -118,6 +118,10 @@ class GameActivity :
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
+ themeRepository.getTheme().palette.background.toAndroidColor().let {
+ window.decorView.setBackgroundColor(it)
+ }
+
setContentView(binding.root)
if (!preferencesRepository.isPremiumEnabled()) {
@@ -126,9 +130,15 @@ class GameActivity :
bindViewModel()
bindToolbar()
- loadGameOrTutorial()
bindTapToBegin()
+ lifecycleScope.launch {
+ delay(100)
+ withContext(Dispatchers.Main) {
+ loadGameOrTutorial()
+ }
+ }
+
playGamesManager.showPlayPopUp(this)
playGamesStartUp()
diff --git a/app/src/test/java/dev/lucasnlm/antimine/mocks/MockPreferencesRepository.kt b/app/src/test/java/dev/lucasnlm/antimine/mocks/MockPreferencesRepository.kt
index d9499f6be..cd2e72b3c 100644
--- a/app/src/test/java/dev/lucasnlm/antimine/mocks/MockPreferencesRepository.kt
+++ b/app/src/test/java/dev/lucasnlm/antimine/mocks/MockPreferencesRepository.kt
@@ -1,6 +1,7 @@
package dev.lucasnlm.antimine.mocks
import dev.lucasnlm.antimine.preferences.PreferencesRepository
+import dev.lucasnlm.antimine.preferences.models.Action
import dev.lucasnlm.antimine.preferences.models.ControlStyle
import dev.lucasnlm.antimine.preferences.models.Minefield
@@ -296,4 +297,10 @@ class MockPreferencesRepository : PreferencesRepository {
override fun setLastAppVersion(versionCode: Int) {
// Not implemented
}
+
+ override fun defaultSwitchButton(): Action = Action.SwitchMark
+
+ override fun setDefaultSwitchButton(action: Action) {
+ // Not implemented
+ }
}
diff --git a/audio-low/build.gradle b/audio-low/build.gradle
index 6dc5feed9..fe925d1c8 100644
--- a/audio-low/build.gradle
+++ b/audio-low/build.gradle
@@ -20,13 +20,11 @@ android {
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_17
- targetCompatibility JavaVersion.VERSION_17
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
}
- kotlin {
- jvmToolchain(17)
- }
+
}
dependencies {}
\ No newline at end of file
diff --git a/audio/build.gradle b/audio/build.gradle
index f10ad9c62..28f89f15e 100644
--- a/audio/build.gradle
+++ b/audio/build.gradle
@@ -20,13 +20,11 @@ android {
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_17
- targetCompatibility JavaVersion.VERSION_17
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
}
- kotlin {
- jvmToolchain(17)
- }
+
}
dependencies {}
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index fe4b0db9f..2660e0e8b 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,19 +1,11 @@
-buildscript {
- repositories {
- mavenCentral()
- google()
- }
-
- dependencies {
- classpath 'com.android.tools.build:gradle:8.1.2'
- classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10'
+plugins {
+ id('com.android.application') version '8.1.2' apply false
+ id('com.android.library') version '8.1.2' apply false
+ id('org.jetbrains.kotlin.android') version '1.9.10' apply false
- if (System.getenv('IS_GOOGLE_BUILD')) {
- classpath 'com.google.gms:google-services:4.4.0'
- classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'
- classpath 'com.google.firebase:perf-plugin:1.4.2'
- }
- }
+ id('com.google.gms.google-services') version '4.4.0' apply false
+ id('com.google.firebase.crashlytics') version '2.9.9' apply false
+ id('com.google.firebase.firebase-perf') version '1.4.2' apply false
}
allprojects {
diff --git a/common/build.gradle b/common/build.gradle
index adecbf6c3..da2ee1007 100644
--- a/common/build.gradle
+++ b/common/build.gradle
@@ -1,7 +1,6 @@
plugins {
id 'com.android.library'
id 'kotlin-android'
- id 'kotlin-kapt'
}
android {
@@ -16,8 +15,8 @@ android {
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_17
- targetCompatibility JavaVersion.VERSION_17
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
@@ -30,10 +29,6 @@ android {
}
}
-kapt {
- correctErrorTypes true
-}
-
dependencies {
// Dependencies must be hardcoded to support F-droid
@@ -45,17 +40,17 @@ dependencies {
implementation project(':ui')
implementation project(':gdx')
implementation project(':sgtatham')
- implementation project(':sgtatham')
+ implementation project(':control')
// AndroidX
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.preference:preference-ktx:1.2.1'
implementation 'androidx.recyclerview:recyclerview:1.3.1'
- implementation 'androidx.activity:activity-ktx:1.7.2'
+ implementation 'androidx.activity:activity-ktx:1.8.0'
implementation 'androidx.fragment:fragment-ktx:1.6.1'
// Google
- implementation 'com.google.android.material:material:1.9.0'
+ implementation 'com.google.android.material:material:1.10.0'
// Constraint
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
diff --git a/common/src/main/java/dev/lucasnlm/antimine/common/level/logic/GameController.kt b/common/src/main/java/dev/lucasnlm/antimine/common/level/logic/GameController.kt
index b8b7ce22b..7a3ae21b9 100644
--- a/common/src/main/java/dev/lucasnlm/antimine/common/level/logic/GameController.kt
+++ b/common/src/main/java/dev/lucasnlm/antimine/common/level/logic/GameController.kt
@@ -25,7 +25,7 @@ class GameController {
private var firstOpen: FirstOpen = FirstOpen.Unknown
private var gameControl: GameControl = GameControl.Standard
private var useQuestionMark = true
- private var selectedAction = Action.OpenTile
+ private var selectedAction: Action
private var useClickOnNumbers = true
private var letNumbersPutFlag = true
private var errorTolerance = 0
@@ -47,6 +47,7 @@ class GameController {
minefield: Minefield,
seed: Long,
useSimonTatham: Boolean,
+ selectedAction: Action,
saveId: String? = null,
onCreateUnsafeLevel: (() -> Unit)? = null,
) {
@@ -66,11 +67,13 @@ class GameController {
this.onCreateUnsafeLevel = onCreateUnsafeLevel
this.field = minefieldCreator.createEmpty()
this.useSimonTatham = shouldUseSimonTatham
+ this.selectedAction = selectedAction
}
constructor(
save: Save,
useSimonTatham: Boolean,
+ selectedAction: Action,
) {
this.minefield = save.minefield
this.seed = save.seed
@@ -78,6 +81,7 @@ class GameController {
this.firstOpen = save.firstOpen
this.field = save.field
this.actions = save.actions
+ this.selectedAction = selectedAction
this.fallbackCreator = MinefieldCreatorImpl(minefield, seed)
this.minefieldCreator =
if (useSimonTatham) {
@@ -535,6 +539,8 @@ class GameController {
this.useQuestionMark = useQuestionMark
}
+ fun getSelectedAction() = selectedAction
+
fun useClickOnNumbers(clickNumbers: Boolean) {
this.useClickOnNumbers = clickNumbers
}
diff --git a/common/src/main/java/dev/lucasnlm/antimine/common/level/view/GameRenderFragment.kt b/common/src/main/java/dev/lucasnlm/antimine/common/level/view/GameRenderFragment.kt
index 23c648327..59ebcc930 100644
--- a/common/src/main/java/dev/lucasnlm/antimine/common/level/view/GameRenderFragment.kt
+++ b/common/src/main/java/dev/lucasnlm/antimine/common/level/view/GameRenderFragment.kt
@@ -11,11 +11,13 @@ import android.widget.FrameLayout
import androidx.core.view.isGone
import androidx.core.view.isVisible
import androidx.lifecycle.lifecycleScope
+import com.badlogic.gdx.Gdx
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration
import com.badlogic.gdx.backends.android.AndroidFragmentApplication
import dev.lucasnlm.antimine.common.level.viewmodel.GameEvent
import dev.lucasnlm.antimine.common.level.viewmodel.GameState
import dev.lucasnlm.antimine.common.level.viewmodel.GameViewModel
+import dev.lucasnlm.antimine.control.SwitchButtonView
import dev.lucasnlm.antimine.core.AppVersionManager
import dev.lucasnlm.antimine.core.audio.GameAudioManager
import dev.lucasnlm.antimine.core.dpToPx
@@ -116,12 +118,13 @@ open class GameRenderFragment : AndroidFragmentApplication() {
): View? {
val config =
AndroidApplicationConfiguration().apply {
- numSamples = 0
+ numSamples = 2
useAccelerometer = false
useCompass = false
useGyroscope = false
useWakelock = false
useImmersiveMode = true
+ disableAudio = true
}
return initializeForView(levelApplicationListener, config)
}
@@ -150,6 +153,8 @@ open class GameRenderFragment : AndroidFragmentApplication() {
private fun onEngineReady() {
this.engineReady = true
+ Gdx.graphics.requestRendering()
+
lifecycleScope.launch {
gameViewModel
.singleState()
diff --git a/common/src/main/java/dev/lucasnlm/antimine/common/level/viewmodel/GameViewModel.kt b/common/src/main/java/dev/lucasnlm/antimine/common/level/viewmodel/GameViewModel.kt
index 38e4dc41c..26ee9b3cd 100644
--- a/common/src/main/java/dev/lucasnlm/antimine/common/level/viewmodel/GameViewModel.kt
+++ b/common/src/main/java/dev/lucasnlm/antimine/common/level/viewmodel/GameViewModel.kt
@@ -143,7 +143,7 @@ open class GameViewModel(
emit(
state.copy(
isLoadingMap = false,
- selectedAction = Action.OpenTile,
+ selectedAction = gameController.getSelectedAction(),
),
)
}
@@ -273,6 +273,7 @@ open class GameViewModel(
seed = seed,
useSimonTatham = preferencesRepository.useSimonTathamAlgorithm(),
onCreateUnsafeLevel = ::onCreateUnsafeLevel,
+ selectedAction = preferencesRepository.defaultSwitchButton(),
)
val newGameState =
@@ -315,7 +316,12 @@ open class GameViewModel(
sendEvent(GameEvent.LoadingNewGame)
- gameController = GameController(save, preferencesRepository.useSimonTathamAlgorithm())
+ gameController =
+ GameController(
+ save = save,
+ useSimonTatham = preferencesRepository.useSimonTathamAlgorithm(),
+ selectedAction = preferencesRepository.defaultSwitchButton(),
+ )
initialized = true
refreshUserPreferences()
@@ -362,6 +368,7 @@ open class GameViewModel(
seed = save.seed,
useSimonTatham = preferencesRepository.useSimonTathamAlgorithm(),
onCreateUnsafeLevel = ::onCreateUnsafeLevel,
+ selectedAction = preferencesRepository.defaultSwitchButton(),
)
initialized = true
refreshUserPreferences()
diff --git a/common/src/test/java/dev/lucasnlm/antimine/common/level/logic/GameControllerTest.kt b/common/src/test/java/dev/lucasnlm/antimine/common/level/logic/GameControllerTest.kt
index 80d397f24..b8bc5e3d2 100644
--- a/common/src/test/java/dev/lucasnlm/antimine/common/level/logic/GameControllerTest.kt
+++ b/common/src/test/java/dev/lucasnlm/antimine/common/level/logic/GameControllerTest.kt
@@ -3,6 +3,7 @@ package dev.lucasnlm.antimine.common.level.logic
import dev.lucasnlm.antimine.common.level.logic.MinefieldExt.filterNeighborsOf
import dev.lucasnlm.antimine.core.models.Area
import dev.lucasnlm.antimine.core.models.Score
+import dev.lucasnlm.antimine.preferences.models.Action
import dev.lucasnlm.antimine.preferences.models.ControlStyle
import dev.lucasnlm.antimine.preferences.models.GameControl
import dev.lucasnlm.antimine.preferences.models.Minefield
@@ -28,6 +29,7 @@ class GameControllerTest {
minefield = minefield,
seed = 200L,
useSimonTatham = false,
+ selectedAction = Action.OpenTile,
)
if (clickOnCreate) {
runTest {
diff --git a/control/build.gradle b/control/build.gradle
index 610789514..13b2960c2 100644
--- a/control/build.gradle
+++ b/control/build.gradle
@@ -23,12 +23,8 @@ android {
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_17
- targetCompatibility JavaVersion.VERSION_17
- }
-
- kotlin {
- jvmToolchain(17)
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
}
buildFeatures {
@@ -45,11 +41,11 @@ dependencies {
implementation project(':ui')
// Google
- implementation 'com.google.android.material:material:1.9.0'
+ implementation 'com.google.android.material:material:1.10.0'
// AndroidX
implementation 'androidx.appcompat:appcompat:1.6.1'
- implementation 'androidx.activity:activity-ktx:1.7.2'
+ implementation 'androidx.activity:activity-ktx:1.8.0'
implementation 'androidx.fragment:fragment-ktx:1.6.1'
// RecyclerView
diff --git a/control/src/main/java/dev/lucasnlm/antimine/control/ControlActivity.kt b/control/src/main/java/dev/lucasnlm/antimine/control/ControlActivity.kt
index 2d1df4ba3..94d1a071a 100644
--- a/control/src/main/java/dev/lucasnlm/antimine/control/ControlActivity.kt
+++ b/control/src/main/java/dev/lucasnlm/antimine/control/ControlActivity.kt
@@ -11,6 +11,7 @@ import dev.lucasnlm.antimine.control.viewmodel.ControlEvent
import dev.lucasnlm.antimine.control.viewmodel.ControlViewModel
import dev.lucasnlm.antimine.core.audio.GameAudioManager
import dev.lucasnlm.antimine.preferences.PreferencesRepository
+import dev.lucasnlm.antimine.preferences.models.Action
import dev.lucasnlm.antimine.preferences.models.ControlStyle
import dev.lucasnlm.antimine.ui.ext.ThemedActivity
import dev.lucasnlm.antimine.ui.model.TopBarAction
@@ -19,7 +20,9 @@ import org.koin.android.ext.android.inject
import dev.lucasnlm.antimine.i18n.R as i18n
class ControlActivity : ThemedActivity(), Slider.OnChangeListener {
- private lateinit var binding: ActivityControlBinding
+ private val binding: ActivityControlBinding by lazy {
+ ActivityControlBinding.inflate(layoutInflater)
+ }
private val viewModel: ControlViewModel by inject()
private val preferencesRepository: PreferencesRepository by inject()
@@ -27,7 +30,6 @@ class ControlActivity : ThemedActivity(), Slider.OnChangeListener {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
- binding = ActivityControlBinding.inflate(layoutInflater)
setContentView(binding.root)
val controlAdapter =
@@ -52,6 +54,23 @@ class ControlActivity : ThemedActivity(), Slider.OnChangeListener {
binding.doubleClick.addOnChangeListener(this)
binding.hapticLevel.addOnChangeListener(this)
+ when (preferencesRepository.defaultSwitchButton()) {
+ Action.SwitchMark -> {
+ binding.switchButtonView.selectFlag()
+ }
+ else -> {
+ binding.switchButtonView.selectOpen()
+ }
+ }
+
+ binding.switchButtonView.setOnOpenClickListener {
+ preferencesRepository.setDefaultSwitchButton(Action.OpenTile)
+ }
+
+ binding.switchButtonView.setOnFlagClickListener {
+ preferencesRepository.setDefaultSwitchButton(Action.SwitchMark)
+ }
+
lifecycleScope.launch {
viewModel.observeState().collect {
controlAdapter.bindControlStyleList(it.selected, it.controls)
@@ -96,6 +115,8 @@ class ControlActivity : ThemedActivity(), Slider.OnChangeListener {
} else {
setTopBarAction(null)
}
+
+ binding.controlDefault.isVisible = it.selected == ControlStyle.SwitchMarkOpen
}
}
diff --git a/common/src/main/java/dev/lucasnlm/antimine/common/level/view/SwitchButtonView.kt b/control/src/main/java/dev/lucasnlm/antimine/control/SwitchButtonView.kt
similarity index 97%
rename from common/src/main/java/dev/lucasnlm/antimine/common/level/view/SwitchButtonView.kt
rename to control/src/main/java/dev/lucasnlm/antimine/control/SwitchButtonView.kt
index d7b49d275..84ade835d 100644
--- a/common/src/main/java/dev/lucasnlm/antimine/common/level/view/SwitchButtonView.kt
+++ b/control/src/main/java/dev/lucasnlm/antimine/control/SwitchButtonView.kt
@@ -1,4 +1,4 @@
-package dev.lucasnlm.antimine.common.level.view
+package dev.lucasnlm.antimine.control
import android.content.Context
import android.util.AttributeSet
@@ -8,7 +8,7 @@ import android.widget.LinearLayout
import androidx.core.view.isVisible
import com.google.android.material.button.MaterialButton
import com.google.android.material.color.MaterialColors
-import dev.lucasnlm.antimine.common.databinding.SwitchButtonBinding
+import dev.lucasnlm.antimine.control.databinding.SwitchButtonBinding
import com.google.android.material.R as GR
class SwitchButtonView : FrameLayout {
diff --git a/control/src/main/res/drawable/touch.xml b/control/src/main/res/drawable/touch.xml
new file mode 100644
index 000000000..abf5e5e2b
--- /dev/null
+++ b/control/src/main/res/drawable/touch.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/control/src/main/res/layout/activity_control.xml b/control/src/main/res/layout/activity_control.xml
index f3c73404b..58f9a3e87 100644
--- a/control/src/main/res/layout/activity_control.xml
+++ b/control/src/main/res/layout/activity_control.xml
@@ -219,6 +219,48 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/control_settings" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/common/src/main/res/layout/switch_button.xml b/control/src/main/res/layout/switch_button.xml
similarity index 100%
rename from common/src/main/res/layout/switch_button.xml
rename to control/src/main/res/layout/switch_button.xml
diff --git a/core/build.gradle b/core/build.gradle
index 28e76c5e5..1c8977282 100644
--- a/core/build.gradle
+++ b/core/build.gradle
@@ -23,13 +23,11 @@ android {
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_17
- targetCompatibility JavaVersion.VERSION_17
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
}
- kotlin {
- jvmToolchain(17)
- }
+
}
dependencies {
diff --git a/donation/build.gradle b/donation/build.gradle
index 91377cca0..d44e3feac 100644
--- a/donation/build.gradle
+++ b/donation/build.gradle
@@ -23,12 +23,8 @@ android {
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_17
- targetCompatibility JavaVersion.VERSION_17
- }
-
- kotlin {
- jvmToolchain(17)
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
}
buildFeatures {
@@ -47,11 +43,11 @@ dependencies {
// AndroidX
implementation 'androidx.appcompat:appcompat:1.6.1'
- implementation 'androidx.activity:activity-ktx:1.7.2'
+ implementation 'androidx.activity:activity-ktx:1.8.0'
implementation 'androidx.fragment:fragment-ktx:1.6.1'
// Google
- implementation 'com.google.android.material:material:1.9.0'
+ implementation 'com.google.android.material:material:1.10.0'
// RecyclerView
implementation 'androidx.recyclerview:recyclerview:1.3.1'
diff --git a/external/build.gradle b/external/build.gradle
index e22d16566..501259151 100644
--- a/external/build.gradle
+++ b/external/build.gradle
@@ -20,13 +20,11 @@ android {
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_17
- targetCompatibility JavaVersion.VERSION_17
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
}
- kotlin {
- jvmToolchain(17)
- }
+
}
dependencies {
diff --git a/foss/build.gradle b/foss/build.gradle
index a027c604f..1e828e01e 100644
--- a/foss/build.gradle
+++ b/foss/build.gradle
@@ -20,13 +20,11 @@ android {
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_17
- targetCompatibility JavaVersion.VERSION_17
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
}
- kotlin {
- jvmToolchain(17)
- }
+
}
dependencies {
diff --git a/gdx/build.gradle b/gdx/build.gradle
index 6f40431ec..74b7c5e17 100644
--- a/gdx/build.gradle
+++ b/gdx/build.gradle
@@ -22,12 +22,8 @@ android {
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_17
- targetCompatibility JavaVersion.VERSION_17
- }
-
- kotlin {
- jvmToolchain(17)
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
}
buildFeatures {
@@ -51,7 +47,7 @@ dependencies {
// AndroidX
implementation 'androidx.appcompat:appcompat:1.6.1'
- implementation 'androidx.activity:activity-ktx:1.7.2'
+ implementation 'androidx.activity:activity-ktx:1.8.0'
implementation 'androidx.fragment:fragment-ktx:1.6.1'
// Koin
diff --git a/gdx/src/main/java/dev/lucasnlm/antimine/gdx/GameApplicationListener.kt b/gdx/src/main/java/dev/lucasnlm/antimine/gdx/GameApplicationListener.kt
index 534979243..389fc72f5 100644
--- a/gdx/src/main/java/dev/lucasnlm/antimine/gdx/GameApplicationListener.kt
+++ b/gdx/src/main/java/dev/lucasnlm/antimine/gdx/GameApplicationListener.kt
@@ -123,7 +123,6 @@ class GameApplicationListener(
}
Gdx.input.inputProcessor = InputMultiplexer(GestureDetector(minefieldInputController), minefieldStage)
- Gdx.graphics.isContinuousRendering = false
}
override fun dispose() {
diff --git a/gradle.properties b/gradle.properties
index ddedb62b7..ef67cae03 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -10,7 +10,8 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
-org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
+org.gradle.daemon=true
+org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
@@ -23,6 +24,9 @@ kotlin.code.style=official
# AndroidX
android.useAndroidX=true
android.nonTransitiveRClass=true
+android.suppressUnsupportedCompileSdk=34
+
# Cache
-org.gradle.configureondemand=false
\ No newline at end of file
+org.gradle.caching=true
+org.gradle.configureondemand=true
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index ec5c655fb..633d55f0f 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Tue Aug 29 22:45:39 BRT 2023
+#Sat Oct 07 16:06:38 BRT 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/i18n/build.gradle b/i18n/build.gradle
index 0e9c817b9..96bada1a1 100644
--- a/i18n/build.gradle
+++ b/i18n/build.gradle
@@ -23,20 +23,18 @@ android {
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_17
- targetCompatibility JavaVersion.VERSION_17
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
}
- kotlin {
- jvmToolchain(17)
- }
+
}
dependencies {
// Dependencies must be hardcoded to support F-droid
implementation 'androidx.appcompat:appcompat:1.6.1'
- implementation 'com.google.android.material:material:1.9.0'
+ implementation 'com.google.android.material:material:1.10.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
diff --git a/i18n/src/main/res/values/strings.xml b/i18n/src/main/res/values/strings.xml
index 178f310fa..3c39fa780 100644
--- a/i18n/src/main/res/values/strings.xml
+++ b/i18n/src/main/res/values/strings.xml
@@ -19,6 +19,7 @@
Open
Settings
Control Settings
+ Default Button
Shapes
Animations
Haptic Feedback
diff --git a/instant/build.gradle b/instant/build.gradle
index 4cf4d67d4..58deab4f5 100644
--- a/instant/build.gradle
+++ b/instant/build.gradle
@@ -20,13 +20,11 @@ android {
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_17
- targetCompatibility JavaVersion.VERSION_17
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
}
- kotlin {
- jvmToolchain(17)
- }
+
}
dependencies {
diff --git a/preferences/build.gradle b/preferences/build.gradle
index 58debced3..94ff60bb6 100644
--- a/preferences/build.gradle
+++ b/preferences/build.gradle
@@ -23,13 +23,11 @@ android {
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_17
- targetCompatibility JavaVersion.VERSION_17
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
}
- kotlin {
- jvmToolchain(17)
- }
+
}
dependencies {
diff --git a/preferences/src/main/java/dev/lucasnlm/antimine/preferences/PreferenceKeys.kt b/preferences/src/main/java/dev/lucasnlm/antimine/preferences/PreferenceKeys.kt
index b863a4c4a..c4cf824de 100644
--- a/preferences/src/main/java/dev/lucasnlm/antimine/preferences/PreferenceKeys.kt
+++ b/preferences/src/main/java/dev/lucasnlm/antimine/preferences/PreferenceKeys.kt
@@ -48,4 +48,5 @@ object PreferenceKeys {
const val PREFERENCE_NEW_THEMES_ICON = "preference_new_themes_icon_v2"
const val PREFERENCE_REQUEST_PLAY_GAMES = "preference_play_games"
const val PREFERENCE_LAST_VERSION = "preference_last_version"
+ const val PREFERENCE_DEFAULT_SWITCH_BUTTON = "preference_default_switch_button"
}
diff --git a/preferences/src/main/java/dev/lucasnlm/antimine/preferences/PreferencesRepository.kt b/preferences/src/main/java/dev/lucasnlm/antimine/preferences/PreferencesRepository.kt
index 23daf18ec..c960db0fa 100644
--- a/preferences/src/main/java/dev/lucasnlm/antimine/preferences/PreferencesRepository.kt
+++ b/preferences/src/main/java/dev/lucasnlm/antimine/preferences/PreferencesRepository.kt
@@ -1,5 +1,6 @@
package dev.lucasnlm.antimine.preferences
+import dev.lucasnlm.antimine.preferences.models.Action
import dev.lucasnlm.antimine.preferences.models.ControlStyle
import dev.lucasnlm.antimine.preferences.models.Minefield
@@ -195,4 +196,8 @@ interface PreferencesRepository {
fun lastAppVersion(): Int?
fun setLastAppVersion(versionCode: Int)
+
+ fun defaultSwitchButton(): Action
+
+ fun setDefaultSwitchButton(action: Action)
}
diff --git a/preferences/src/main/java/dev/lucasnlm/antimine/preferences/PreferencesRepositoryImpl.kt b/preferences/src/main/java/dev/lucasnlm/antimine/preferences/PreferencesRepositoryImpl.kt
index 9b0c31b16..256bc6805 100644
--- a/preferences/src/main/java/dev/lucasnlm/antimine/preferences/PreferencesRepositoryImpl.kt
+++ b/preferences/src/main/java/dev/lucasnlm/antimine/preferences/PreferencesRepositoryImpl.kt
@@ -2,6 +2,7 @@ package dev.lucasnlm.antimine.preferences
import android.os.Build
import android.view.ViewConfiguration
+import dev.lucasnlm.antimine.preferences.models.Action
import dev.lucasnlm.antimine.preferences.models.ControlStyle
import dev.lucasnlm.antimine.preferences.models.Minefield
@@ -483,4 +484,14 @@ class PreferencesRepositoryImpl(
preferencesManager.putInt(PreferenceKeys.PREFERENCE_LAST_VERSION, versionCode)
}
}
+
+ override fun defaultSwitchButton(): Action {
+ preferencesManager.getInt(PreferenceKeys.PREFERENCE_DEFAULT_SWITCH_BUTTON, 0).let {
+ return Action.values().getOrNull(it) ?: Action.OpenTile
+ }
+ }
+
+ override fun setDefaultSwitchButton(action: Action) {
+ preferencesManager.putInt(PreferenceKeys.PREFERENCE_DEFAULT_SWITCH_BUTTON, action.ordinal)
+ }
}
diff --git a/proprietary/build.gradle b/proprietary/build.gradle
index 6c4737f88..221628fb9 100644
--- a/proprietary/build.gradle
+++ b/proprietary/build.gradle
@@ -25,12 +25,8 @@ android {
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_17
- targetCompatibility JavaVersion.VERSION_17
- }
-
- kotlin {
- jvmToolchain(17)
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
}
}
diff --git a/proprietary/proguard-rules.pro b/proprietary/proguard-rules.pro
index f1b424510..a163c348d 100644
--- a/proprietary/proguard-rules.pro
+++ b/proprietary/proguard-rules.pro
@@ -19,3 +19,36 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
+
+# The native PGS library wraps the Java PGS SDK using reflection.
+-dontobfuscate
+-keeppackagenames
+
+# Needed for callbacks.
+-keepclasseswithmembernames,includedescriptorclasses class * {
+ native ;
+}
+
+# Needed for helper libraries.
+-keep class com.google.example.games.juihelper.** {
+ public protected *;
+}
+-keep class com.sample.helper.** {
+ public protected *;
+}
+
+# Needed for GoogleApiClient and auth stuff.
+-keep class com.google.android.gms.common.api.** {
+ public protected *;
+}
+
+# Keep all of the "nearby" library, which is needed by the native PGS library
+# at runtime (though deprecated).
+-keep class com.google.android.gms.nearby.** {
+ public protected *;
+}
+
+# Keep all of the public PGS APIs.
+-keep class com.google.android.gms.games.** {
+ public protected *;
+}
diff --git a/settings.gradle b/settings.gradle
index f36ed8d00..e4b603a49 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,3 +1,11 @@
+pluginManagement {
+ repositories {
+ google()
+ mavenCentral()
+ gradlePluginPortal()
+ }
+}
+
include ':app'
include ':common'
include ':proprietary'
diff --git a/sgtatham/build.gradle b/sgtatham/build.gradle
index dfb57e827..81ee839e2 100644
--- a/sgtatham/build.gradle
+++ b/sgtatham/build.gradle
@@ -39,17 +39,15 @@ android {
}
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_17
- targetCompatibility JavaVersion.VERSION_17
- }
- kotlin {
- jvmToolchain(17)
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
}
+
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
- implementation 'com.google.android.material:material:1.9.0'
+ implementation 'com.google.android.material:material:1.10.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
\ No newline at end of file
diff --git a/themes/build.gradle b/themes/build.gradle
index 6e1c77568..024570d28 100644
--- a/themes/build.gradle
+++ b/themes/build.gradle
@@ -23,17 +23,13 @@ android {
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_17
- targetCompatibility JavaVersion.VERSION_17
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
}
buildFeatures {
viewBinding true
}
-
- kotlin {
- jvmToolchain(17)
- }
}
dependencies {
@@ -47,11 +43,11 @@ dependencies {
// AndroidX
implementation 'androidx.appcompat:appcompat:1.6.1'
- implementation 'androidx.activity:activity-ktx:1.7.2'
+ implementation 'androidx.activity:activity-ktx:1.8.0'
implementation 'androidx.fragment:fragment-ktx:1.6.1'
// Google
- implementation 'com.google.android.material:material:1.9.0'
+ implementation 'com.google.android.material:material:1.10.0'
// RecyclerView
implementation 'androidx.recyclerview:recyclerview:1.3.1'
diff --git a/tutorial/build.gradle b/tutorial/build.gradle
index a399e307c..989daab10 100644
--- a/tutorial/build.gradle
+++ b/tutorial/build.gradle
@@ -27,13 +27,11 @@ android {
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_17
- targetCompatibility JavaVersion.VERSION_17
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
}
- kotlin {
- jvmToolchain(17)
- }
+
}
dependencies {
@@ -47,11 +45,11 @@ dependencies {
// AndroidX
implementation 'androidx.appcompat:appcompat:1.6.1'
- implementation 'androidx.activity:activity-ktx:1.7.2'
+ implementation 'androidx.activity:activity-ktx:1.8.0'
implementation 'androidx.fragment:fragment-ktx:1.6.1'
// Google
- implementation 'com.google.android.material:material:1.9.0'
+ implementation 'com.google.android.material:material:1.10.0'
// RecyclerView
implementation 'androidx.recyclerview:recyclerview:1.3.1'
diff --git a/ui/build.gradle b/ui/build.gradle
index 174e9a17a..71cb2221b 100644
--- a/ui/build.gradle
+++ b/ui/build.gradle
@@ -20,7 +20,6 @@ android {
viewBinding true
}
-
buildTypes {
release {
minifyEnabled false
@@ -29,12 +28,8 @@ android {
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_17
- targetCompatibility JavaVersion.VERSION_17
- }
-
- kotlin {
- jvmToolchain(17)
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
}
}
@@ -46,11 +41,11 @@ dependencies {
implementation project(':preferences')
// Google
- implementation 'com.google.android.material:material:1.9.0'
+ implementation 'com.google.android.material:material:1.10.0'
// AndroidX
implementation 'androidx.appcompat:appcompat:1.6.1'
- implementation 'androidx.activity:activity-ktx:1.7.2'
+ implementation 'androidx.activity:activity-ktx:1.8.0'
implementation 'androidx.fragment:fragment-ktx:1.6.1'
// RecyclerView
diff --git a/wear/build.gradle b/wear/build.gradle
index 06094f57c..5a9b5b326 100644
--- a/wear/build.gradle
+++ b/wear/build.gradle
@@ -1,7 +1,6 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
- id 'kotlin-kapt'
}
android {
@@ -51,8 +50,8 @@ android {
}
compileOptions {
- targetCompatibility JavaVersion.VERSION_17
- sourceCompatibility JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
+ sourceCompatibility = JavaVersion.VERSION_17
}
testOptions {
@@ -67,10 +66,6 @@ android {
}
}
-kapt {
- correctErrorTypes true
-}
-
dependencies {
// Dependencies must be hardcoded to support F-droid
@@ -92,7 +87,7 @@ dependencies {
implementation 'androidx.preference:preference-ktx:1.2.1'
implementation 'androidx.recyclerview:recyclerview:1.3.1'
implementation 'androidx.multidex:multidex:2.0.1'
- implementation 'androidx.activity:activity-ktx:1.7.2'
+ implementation 'androidx.activity:activity-ktx:1.8.0'
implementation 'androidx.fragment:fragment-ktx:1.6.1'
// Lifecycle
@@ -105,7 +100,7 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
// Google
- implementation 'com.google.android.material:material:1.9.0'
+ implementation 'com.google.android.material:material:1.10.0'
// Koin
implementation 'io.insert-koin:koin-android:3.1.2'