feat: update version to 1.4.0 and display app version in ImportantInfo and Settings screens
This commit is contained in:
@@ -17,8 +17,8 @@ android {
|
||||
applicationId = "com.aistudio.gestaoparadaos.xvyzwt"
|
||||
minSdk = 24
|
||||
targetSdk = 36
|
||||
versionCode = 4
|
||||
versionName = "1.3.0"
|
||||
versionCode = 5
|
||||
versionName = "1.4.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
@@ -210,6 +210,22 @@ fun ImportantInfoScreen(
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
item {
|
||||
Spacer(modifier = Modifier.height(12.dp))
|
||||
Box(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Text(
|
||||
text = "Versão do aplicativo: ${com.example.util.DeviceUtils.getAppVersion(context)}",
|
||||
fontSize = 12.sp,
|
||||
color = Color.Gray,
|
||||
fontWeight = FontWeight.Medium
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,6 +236,21 @@ fun SettingsScreen(
|
||||
viewModel.clearDateSimulation()
|
||||
}
|
||||
)
|
||||
|
||||
// Rodapé com exibição da versão do aplicativo
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(vertical = 12.dp),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Text(
|
||||
text = "Versão do aplicativo: ${com.example.util.DeviceUtils.getAppVersion(context)}",
|
||||
fontSize = 12.sp,
|
||||
color = Color.Gray,
|
||||
fontWeight = FontWeight.Medium
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ object DeviceUtils {
|
||||
fun getAppVersion(context: Context): String {
|
||||
return try {
|
||||
val packageInfo = context.packageManager.getPackageInfo(context.packageName, 0)
|
||||
val versionName = packageInfo.versionName ?: "1.3.0"
|
||||
val versionName = packageInfo.versionName ?: "1.4.0"
|
||||
@Suppress("DEPRECATION")
|
||||
val versionCode = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
packageInfo.longVersionCode
|
||||
@@ -55,7 +55,7 @@ object DeviceUtils {
|
||||
}
|
||||
"$versionName (v$versionCode)"
|
||||
} catch (e: Exception) {
|
||||
"1.3.0"
|
||||
"1.4.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user