Skip to content

Commit d9ee588

Browse files
committed
version upgrade and Android 6 compatibility
1 parent 28a858f commit d9ee588

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

app/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ android {
1212

1313
defaultConfig {
1414
applicationId = "com.sameerasw.essentials"
15-
minSdk = 30
15+
minSdk = 23
1616
targetSdk = 36
17-
versionCode = 1
18-
versionName = "1.0"
17+
versionCode = 2
18+
versionName = "2.0"
1919

2020
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2121
}

app/src/main/java/com/sameerasw/essentials/MainActivity.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import androidx.compose.material3.rememberTopAppBarState
1515
import androidx.compose.runtime.*
1616
import androidx.compose.ui.input.nestedscroll.nestedScroll
1717
import androidx.compose.ui.Modifier
18+
import androidx.compose.ui.platform.LocalContext
1819
import com.sameerasw.essentials.ui.components.ReusableTopAppBar
1920
import com.sameerasw.essentials.ui.composables.SetupFeatures
2021
import com.sameerasw.essentials.ui.theme.EssentialsTheme
@@ -35,6 +36,13 @@ class MainActivity : ComponentActivity() {
3536
viewModel.check(this)
3637
setContent {
3738
EssentialsTheme {
39+
val context = LocalContext.current
40+
val versionName = try {
41+
context.packageManager.getPackageInfo(context.packageName, 0).versionName
42+
} catch (_: Exception) {
43+
"Unknown"
44+
}
45+
3846
var searchRequested by remember { mutableStateOf(false) }
3947
val scrollBehavior = TopAppBarDefaults.enterAlwaysScrollBehavior(rememberTopAppBarState())
4048
Scaffold(
@@ -49,7 +57,7 @@ class MainActivity : ComponentActivity() {
4957
onSearchClick = { searchRequested = true },
5058
onSettingsClick = { startActivity(Intent(this, SettingsActivity::class.java)) },
5159
scrollBehavior = scrollBehavior,
52-
subtitle = "V1.0"
60+
subtitle = "V$versionName"
5361
)
5462
}
5563
) { innerPadding ->

0 commit comments

Comments
 (0)