This commit is contained in:
sathwikcs
2024-10-19 11:46:42 +05:30
parent dfea713a26
commit 7c23d1b493

View File

@@ -29,19 +29,18 @@ import kotlinx.coroutines.launch
@SuppressLint("CoroutineCreationDuringComposition") @SuppressLint("CoroutineCreationDuringComposition")
@Composable @Composable
fun AboutSettings(context: Context) fun AboutSettings(context: Context) {
{
val scope = rememberCoroutineScope() val scope = rememberCoroutineScope()
val dataStore = SettingsData(context) val dataStore = SettingsData(context)
var clickCount by remember { mutableIntStateOf(0) } var clickCount by remember { mutableIntStateOf(0) }
if (clickCount > 5) { if (clickCount > 5) {
scope.launch { scope.launch {
dataStore.setDevMode(true) dataStore.setDevMode(true)
} }
clickCount = 0 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(
text = "About", text = "About",
style = MaterialTheme.typography.labelLarge, style = MaterialTheme.typography.labelLarge,
@@ -51,21 +50,23 @@ fun AboutSettings(context: Context)
.padding(14.dp), .padding(14.dp),
color = MaterialTheme.colorScheme.primary color = MaterialTheme.colorScheme.primary
) )
OutlinedCard{ OutlinedCard {
ClickableCard( ClickableCard(
title = "Version", title = "Version",
subtitle = "1.0.04", subtitle = context.packageManager.getPackageInfo(
context.packageName,
0
).versionName,
onClick = { onClick = {
clickCount++ clickCount++
}, },
icon = ImageVector.vectorResource(id = R.drawable.round_info_24) icon = ImageVector.vectorResource(id = R.drawable.round_info_24)
) )
CombinedClickableCard( CombinedClickableCard(title = "Developer",
title = "Developer",
subtitle = "SM Innovations Pvt Ltd", subtitle = "SM Innovations Pvt Ltd",
onClick = { onClick = {},
}, onDoubleClick={ onDoubleClick = {
}, },
icon = ImageVector.vectorResource(id = R.drawable.round_logo_dev_24) icon = ImageVector.vectorResource(id = R.drawable.round_logo_dev_24)