feat: Implement crash reporting system with CrashLogsScreen and integration in ProfileScreen
This commit is contained in:
@@ -48,6 +48,7 @@ import com.rosetta.messenger.ui.settings.ProfileScreen
|
||||
import com.rosetta.messenger.ui.settings.SafetyScreen
|
||||
import com.rosetta.messenger.ui.settings.ThemeScreen
|
||||
import com.rosetta.messenger.ui.settings.UpdatesScreen
|
||||
import com.rosetta.messenger.ui.crashlogs.CrashLogsScreen
|
||||
import com.rosetta.messenger.ui.splash.SplashScreen
|
||||
import com.rosetta.messenger.ui.theme.RosettaAndroidTheme
|
||||
import java.text.SimpleDateFormat
|
||||
@@ -510,6 +511,7 @@ fun MainScreen(
|
||||
var showSafetyScreen by remember { mutableStateOf(false) }
|
||||
var showBackupScreen by remember { mutableStateOf(false) }
|
||||
var showLogsScreen by remember { mutableStateOf(false) }
|
||||
var showCrashLogsScreen by remember { mutableStateOf(false) }
|
||||
|
||||
// ProfileViewModel для логов
|
||||
val profileViewModel: com.rosetta.messenger.ui.settings.ProfileViewModel = androidx.lifecycle.viewmodel.compose.viewModel()
|
||||
@@ -538,7 +540,7 @@ fun MainScreen(
|
||||
androidx.compose.animation.AnimatedVisibility(
|
||||
visible = !showBackupScreen && !showSafetyScreen && !showThemeScreen &&
|
||||
!showUpdatesScreen && selectedUser == null && !showSearchScreen &&
|
||||
!showProfileScreen && !showOtherProfileScreen && !showLogsScreen,
|
||||
!showProfileScreen && !showOtherProfileScreen && !showLogsScreen && !showCrashLogsScreen,
|
||||
enter = fadeIn(animationSpec = tween(300)),
|
||||
exit = fadeOut(animationSpec = tween(200))
|
||||
) {
|
||||
@@ -780,6 +782,10 @@ fun MainScreen(
|
||||
showProfileScreen = false
|
||||
showLogsScreen = true
|
||||
},
|
||||
onNavigateToCrashLogs = {
|
||||
showProfileScreen = false
|
||||
showCrashLogsScreen = true
|
||||
},
|
||||
viewModel = profileViewModel,
|
||||
avatarRepository = avatarRepository,
|
||||
dialogDao = RosettaDatabase.getDatabase(context).dialogDao()
|
||||
@@ -807,6 +813,21 @@ fun MainScreen(
|
||||
}
|
||||
}
|
||||
|
||||
androidx.compose.animation.AnimatedVisibility(
|
||||
visible = showCrashLogsScreen,
|
||||
enter = fadeIn(animationSpec = tween(300)),
|
||||
exit = fadeOut(animationSpec = tween(200))
|
||||
) {
|
||||
if (showCrashLogsScreen) {
|
||||
CrashLogsScreen(
|
||||
onBackClick = {
|
||||
showCrashLogsScreen = false
|
||||
showProfileScreen = true
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
androidx.compose.animation.AnimatedVisibility(
|
||||
visible = showOtherProfileScreen,
|
||||
enter = fadeIn(animationSpec = tween(300)),
|
||||
|
||||
Reference in New Issue
Block a user