This repository was archived by the owner on Sep 17, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
app/src/main/java/com/ackee/versionupdatehandler/setup
status-resolver/src/main/java/com/ackee/versioupdatehandler Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ class MainActivity : AppCompatActivity() {
4646 button {
4747 text = " Customized dialog"
4848 onClick {
49- getDefaultStatusResolver().checkVersionStatusAndOpenDefault (8 , supportFragmentManager, DialogSettings .Builder ()
49+ getDefaultStatusResolver().checkVersionStatusAndOpenDialog (8 , supportFragmentManager, DialogSettings .Builder ()
5050 .title(" My custom title" )
5151 .messageRes(R .string.update_dialog_message)
5252 .positiveButton(" Yaay" )
@@ -76,7 +76,7 @@ class MainActivity : AppCompatActivity() {
7676
7777 private suspend fun checkWithVersion (version : Int ) {
7878 // replace fetcher with some real one
79- getDefaultStatusResolver().checkVersionStatusAndOpenDefault (version, supportFragmentManager)
79+ getDefaultStatusResolver().checkVersionStatusAndOpenDialog (version, supportFragmentManager)
8080 }
8181
8282 private fun getDefaultStatusResolver (minimalVersion : Int = 10, currentVersion : Int = 15): VersionStatusResolver {
Original file line number Diff line number Diff line change @@ -12,15 +12,15 @@ The simplest way for use this library is
1212``` kotlin
1313 val versionFetcher = .. .
1414 val versionResolver = VersionStatusResolver (versionFetcher)
15- versionResolver.checkVersionStatusAndOpenDefault (BuildConfig .VERSION_CODE , getSupportFragmentManager())
15+ versionResolver.checkVersionStatusAndOpenDialog (BuildConfig .VERSION_CODE , getSupportFragmentManager())
1616```
1717
1818this will check versions and show update dialog with default texts. If you want to modify strings in dialog and maybe package name, you can via DialogSettings.Builder() class.
1919
2020``` kotlin
2121 val versionFetcher = .. .
2222 val versionResolver = VersionStatusResolver (versionFetcher)
23- versionResolver.checkVersionStatusAndOpenDefault (BuildConfig .VERSION_CODE , getSupportFragmentManager(),
23+ versionResolver.checkVersionStatusAndOpenDialog (BuildConfig .VERSION_CODE , getSupportFragmentManager(),
2424 DialogSettings .Builder ()
2525 .title(" My custom title" )
2626 .messageRes(R .string.update_dialog_message)
Original file line number Diff line number Diff line change @@ -25,10 +25,11 @@ class VersionStatusResolver(private val fetcher: VersionFetcher) {
2525 }
2626 return status
2727 }
28+
2829 /* *
2930 * Check for version and show dialog with visual settings defined within [DialogSettings]
3031 */
31- suspend fun checkVersionStatusAndOpenDefault (
32+ suspend fun checkVersionStatusAndOpenDialog (
3233 version : Int ,
3334 fragmentManager : FragmentManager ,
3435 settings : DialogSettings = DialogSettings .Builder ().build()
You can’t perform that action at this time.
0 commit comments