feat: Implement back button handling in ProfileScreen to navigate to chat list
This commit is contained in:
@@ -6,6 +6,7 @@ import android.content.ClipboardManager
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import android.util.Log
|
||||
import androidx.activity.compose.BackHandler
|
||||
import androidx.activity.compose.rememberLauncherForActivityResult
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.compose.animation.*
|
||||
@@ -343,6 +344,11 @@ fun ProfileScreen(
|
||||
LaunchedEffect(editedName, editedUsername) {
|
||||
hasChanges = editedName != accountName || editedUsername != accountUsername
|
||||
}
|
||||
|
||||
// Handle back button press - navigate to chat list instead of closing app
|
||||
BackHandler {
|
||||
onBack()
|
||||
}
|
||||
|
||||
Box(
|
||||
modifier = Modifier
|
||||
@@ -1067,22 +1073,12 @@ private fun TelegramBiometricItem(
|
||||
|
||||
Spacer(modifier = Modifier.width(20.dp))
|
||||
|
||||
Column(modifier = Modifier.weight(1f)) {
|
||||
Text(
|
||||
text = "Biometric Authentication",
|
||||
fontSize = 16.sp,
|
||||
color = textColor
|
||||
)
|
||||
|
||||
if (isEnabled) {
|
||||
Text(
|
||||
text = "Face ID / Touch ID",
|
||||
fontSize = 13.sp,
|
||||
color = textColor.copy(alpha = 0.5f),
|
||||
modifier = Modifier.padding(top = 2.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
Text(
|
||||
text = "Biometric Authentication",
|
||||
fontSize = 16.sp,
|
||||
color = textColor,
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
|
||||
// iOS-style animated switch
|
||||
val animatedThumbOffset by animateFloatAsState(
|
||||
|
||||
Reference in New Issue
Block a user