AboutCard.kt
This commit is contained in:
@@ -1,19 +1,12 @@
|
||||
package `in`.sminnovations.attendanceapp.screens.settings.ui.components.subSetting
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.widget.Toast
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.OutlinedCard
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableIntStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.rememberCoroutineScope
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
@@ -21,25 +14,12 @@ import androidx.compose.ui.res.vectorResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
import `in`.sminnovations.attendanceapp.R
|
||||
import `in`.sminnovations.attendanceapp.screens.settings.data.SettingsData
|
||||
import `in`.sminnovations.attendanceapp.screens.settings.ui.components.settingsComponents.ClickableCard
|
||||
import `in`.sminnovations.attendanceapp.screens.settings.ui.components.settingsComponents.CombinedClickableCard
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
|
||||
@SuppressLint("CoroutineCreationDuringComposition")
|
||||
@Composable
|
||||
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()
|
||||
}
|
||||
Column(modifier = Modifier.padding(10.dp, 0.dp, 10.dp, 10.dp)) {
|
||||
Text(
|
||||
text = "About",
|
||||
@@ -57,14 +37,19 @@ fun AboutSettings(context: Context) {
|
||||
context.packageName,
|
||||
0
|
||||
).versionName,
|
||||
onClick = {
|
||||
clickCount++
|
||||
},
|
||||
onClick = {},
|
||||
icon = ImageVector.vectorResource(id = R.drawable.round_info_24)
|
||||
|
||||
)
|
||||
ClickableCard(
|
||||
title = "Check For Update",
|
||||
subtitle = "Check For latest update",
|
||||
onClick = {},
|
||||
icon = ImageVector.vectorResource(id = R.drawable.round_info_24)
|
||||
|
||||
)
|
||||
CombinedClickableCard(title = "Developer",
|
||||
subtitle = "SM Innovations Pvt Ltd",
|
||||
subtitle = "ShanMukha Innovations Pvt Ltd",
|
||||
onClick = {},
|
||||
onDoubleClick = {
|
||||
|
||||
@@ -74,6 +59,5 @@ fun AboutSettings(context: Context) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user