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