-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separated the app by screens + some fixes
- Loading branch information
Mihai-Cristian Condrea
committed
Oct 14, 2024
1 parent
752f0b6
commit 941f12f
Showing
6 changed files
with
94 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
app/src/main/kotlin/com/d4rk/cleaner/ui/components/dialogs/ConfirmationAlertDialog.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.d4rk.cleaner.ui.components.dialogs | ||
|
||
import androidx.compose.material3.AlertDialog | ||
import androidx.compose.material3.Text | ||
import androidx.compose.material3.TextButton | ||
import androidx.compose.runtime.Composable | ||
|
||
@Composable | ||
fun ConfirmationAlertDialog( | ||
confirmationTitle: String, | ||
confirmationMessage: String, | ||
confirmationConfirmButtonText: String, | ||
confirmationDismissButtonText: String, | ||
onConfirm: () -> Unit, | ||
onDismiss: () -> Unit | ||
) { | ||
AlertDialog( | ||
onDismissRequest = onDismiss, | ||
title = { Text(text = confirmationTitle) }, | ||
text = { Text(confirmationMessage) }, | ||
confirmButton = { | ||
TextButton(onClick = onConfirm) { | ||
Text(text = confirmationConfirmButtonText) | ||
} | ||
}, | ||
dismissButton = { | ||
TextButton(onClick = onDismiss) { | ||
Text(text = confirmationDismissButtonText) | ||
} | ||
} | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
app/src/main/kotlin/com/d4rk/cleaner/ui/screens/nofilesfound/NoFilesFoundScreen.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package com.d4rk.cleaner.ui.screens.nofilesfound | ||
|
||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.outlined.FolderOff | ||
import androidx.compose.material.icons.outlined.Refresh | ||
import androidx.compose.material3.ButtonDefaults | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.OutlinedButton | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.unit.dp | ||
import com.d4rk.cleaner.R | ||
import com.d4rk.cleaner.ui.components.animations.bounceClick | ||
import com.d4rk.cleaner.ui.screens.home.HomeViewModel | ||
|
||
@Composable | ||
fun NoFilesFoundScreen(viewModel : HomeViewModel) { | ||
Box(modifier = Modifier.fillMaxSize() , contentAlignment = Alignment.Center) { | ||
Column(horizontalAlignment = Alignment.CenterHorizontally) { | ||
Icon( | ||
imageVector = Icons.Outlined.FolderOff , | ||
contentDescription = null , | ||
modifier = Modifier.size(64.dp) , | ||
tint = MaterialTheme.colorScheme.onSurface | ||
) | ||
Spacer(modifier = Modifier.height(16.dp)) | ||
Text( | ||
text = stringResource(id = R.string.no_files_found) , | ||
style = MaterialTheme.typography.bodyLarge , | ||
color = MaterialTheme.colorScheme.onSurface | ||
) | ||
|
||
OutlinedButton(modifier = Modifier.bounceClick() , onClick = { | ||
viewModel.rescanFiles() | ||
}) { | ||
Icon( | ||
modifier = Modifier.size(ButtonDefaults.IconSize) , | ||
imageVector = Icons.Outlined.Refresh , | ||
contentDescription = "Close" | ||
) | ||
Spacer(modifier = Modifier.size(ButtonDefaults.IconSpacing)) | ||
Text(text = stringResource(id = R.string.try_again)) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters