From 7c23d1b4930e24e2037b0ab2b8e7d1d2af1ab357 Mon Sep 17 00:00:00 2001 From: sathwikcs <85106054+sathwikcs@users.noreply.github.com> Date: Sat, 19 Oct 2024 11:46:42 +0530 Subject: [PATCH] About --- .../ui/components/subSetting/AboutCard.kt | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/in/sminnovations/attendanceapp/screens/settings/ui/components/subSetting/AboutCard.kt b/app/src/main/java/in/sminnovations/attendanceapp/screens/settings/ui/components/subSetting/AboutCard.kt index 64f73dd..f4485cc 100644 --- a/app/src/main/java/in/sminnovations/attendanceapp/screens/settings/ui/components/subSetting/AboutCard.kt +++ b/app/src/main/java/in/sminnovations/attendanceapp/screens/settings/ui/components/subSetting/AboutCard.kt @@ -29,19 +29,18 @@ import kotlinx.coroutines.launch @SuppressLint("CoroutineCreationDuringComposition") @Composable -fun AboutSettings(context: Context) -{ +fun AboutSettings(context: Context) { val scope = rememberCoroutineScope() val dataStore = SettingsData(context) var clickCount by remember { mutableIntStateOf(0) } if (clickCount > 5) { scope.launch { dataStore.setDevMode(true) - } + } clickCount = 0 - Toast.makeText(context, "Developer mode is On : Scroll Down", Toast.LENGTH_SHORT).show() + Toast.makeText(context, "Developer mode is On : Scroll Down", Toast.LENGTH_SHORT).show() } - Column(modifier = Modifier.padding(10.dp,0.dp,10.dp,10.dp)) { + Column(modifier = Modifier.padding(10.dp, 0.dp, 10.dp, 10.dp)) { Text( text = "About", style = MaterialTheme.typography.labelLarge, @@ -51,21 +50,23 @@ fun AboutSettings(context: Context) .padding(14.dp), color = MaterialTheme.colorScheme.primary ) - OutlinedCard{ + OutlinedCard { ClickableCard( title = "Version", - subtitle = "1.0.04", + subtitle = context.packageManager.getPackageInfo( + context.packageName, + 0 + ).versionName, onClick = { clickCount++ }, - icon = ImageVector.vectorResource(id = R.drawable.round_info_24) + icon = ImageVector.vectorResource(id = R.drawable.round_info_24) ) - CombinedClickableCard( - title = "Developer", + CombinedClickableCard(title = "Developer", subtitle = "SM Innovations Pvt Ltd", - onClick = { - }, onDoubleClick={ + onClick = {}, + onDoubleClick = { }, icon = ImageVector.vectorResource(id = R.drawable.round_logo_dev_24)