From 7449bdf44661dbe98d317be6561f1e05dfb70660 Mon Sep 17 00:00:00 2001 From: Abdelilah El Aissaoui Date: Thu, 27 Oct 2022 20:29:35 +0200 Subject: [PATCH] Fixed clone button and added settings option --- src/main/kotlin/com/jetpackduba/gitnuro/ui/AppTab.kt | 3 ++- .../kotlin/com/jetpackduba/gitnuro/ui/WelcomePage.kt | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/AppTab.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/AppTab.kt index 310046e..3a3b178 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/AppTab.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/AppTab.kt @@ -86,7 +86,8 @@ fun AppTab( RepositorySelectionStatus.None -> { WelcomePage( tabViewModel = tabViewModel, - onShowCloneDialog = { showSettingsDialog = true } + onShowCloneDialog = { showCloneDialog = true }, + onShowSettings = { showSettingsDialog = true } ) } diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/WelcomePage.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/WelcomePage.kt index 27c5962..1b41a57 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/WelcomePage.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/WelcomePage.kt @@ -35,6 +35,7 @@ import com.jetpackduba.gitnuro.viewmodels.TabViewModel fun WelcomePage( tabViewModel: TabViewModel, onShowCloneDialog: () -> Unit, + onShowSettings: () -> Unit, ) { val appStateManager = tabViewModel.appStateManager var showAdditionalInfo by remember { mutableStateOf(false) } @@ -63,6 +64,7 @@ fun WelcomePage( tabViewModel = tabViewModel, onShowCloneView = onShowCloneDialog, onShowAdditionalInfo = { showAdditionalInfo = true }, + onShowSettings = onShowSettings, ) RecentRepositories(appStateManager, tabViewModel) @@ -93,6 +95,7 @@ fun HomeButtons( tabViewModel: TabViewModel, onShowCloneView: () -> Unit, onShowAdditionalInfo: () -> Unit, + onShowSettings: () -> Unit, ) { Column( modifier = Modifier.padding(end = 32.dp), @@ -128,7 +131,7 @@ fun HomeButtons( ) Text( - text = "About", + text = "Additional options", style = MaterialTheme.typography.h3, modifier = Modifier.padding(top = 16.dp, bottom = 8.dp), ) @@ -155,6 +158,12 @@ fun HomeButtons( onClick = onShowAdditionalInfo ) + IconTextButton( + title = "Settings", + painter = painterResource("settings.svg"), + onClick = onShowSettings + ) + if (newUpdate != null) { IconTextButton( title = "New update ${newUpdate.appVersion} available ",