mirror of
https://github.com/Michatec/Radio.git
synced 2026-05-31 00:42:40 +02:00
chore(app): add IS_DEBUG_ENABLED build config field
Introduce a `IS_DEBUG_ENABLED` boolean flag in `BuildConfig` for both debug and release build types. This flag is used to suppress update notifications in `PlayerFragment` when debugging and before its a version released.
This commit is contained in:
@@ -31,6 +31,7 @@ android {
|
||||
isCrunchPngs = false
|
||||
proguardFiles.addAll(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), file("proguard-rules.pro")))
|
||||
applicationIdSuffix = ".debug"
|
||||
buildConfigField("boolean", "IS_DEBUG_ENABLED", "true")
|
||||
}
|
||||
|
||||
release {
|
||||
@@ -38,6 +39,7 @@ android {
|
||||
isShrinkResources = true
|
||||
isCrunchPngs = true
|
||||
proguardFiles.addAll(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), file("proguard-rules.pro")))
|
||||
buildConfigField("boolean", "IS_DEBUG_ENABLED", "true")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@ import com.michatec.radio.extensions.*
|
||||
import com.michatec.radio.helpers.*
|
||||
import com.michatec.radio.ui.LayoutHolder
|
||||
import com.michatec.radio.ui.PlayerState
|
||||
import com.michatec.radio.BuildConfig
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.Dispatchers.IO
|
||||
import kotlinx.coroutines.Dispatchers.Main
|
||||
@@ -831,7 +832,7 @@ class PlayerFragment : Fragment(),
|
||||
} else {
|
||||
activity?.packageManager?.getPackageInfo(requireActivity().packageName, 0)?.versionName
|
||||
}
|
||||
if (latestVersion != current) {
|
||||
if (latestVersion != current && !BuildConfig.IS_DEBUG_ENABLED) {
|
||||
// We have an update available, tell our user about it
|
||||
view?.let {
|
||||
Snackbar.make(it, getString(R.string.app_name) + " " + latestVersion + " " + getString(R.string.snackbar_update_available), 10000)
|
||||
|
||||
Reference in New Issue
Block a user