Move Fab back action button to separate component. Adjust colors for the fabs in CustomListsScreen.

This commit is contained in:
KotlinGeekDev
2025-09-23 12:19:04 +01:00
parent ec10d53195
commit 04b8f6cca2
2 changed files with 28 additions and 15 deletions
@@ -32,6 +32,7 @@ import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
@@ -227,7 +228,7 @@ private fun FollowSetFabsAndMenu(
isListAdditionDialogOpen.value = true
},
shape = CircleShape,
containerColor = MaterialTheme.colorScheme.primaryContainer,
containerColor = ButtonDefaults.filledTonalButtonColors().containerColor,
) {
Icon(
painter = painterResource(R.drawable.lock_plus),
@@ -241,7 +242,7 @@ private fun FollowSetFabsAndMenu(
isListAdditionDialogOpen.value = true
},
shape = CircleShape,
containerColor = MaterialTheme.colorScheme.primaryContainer,
containerColor = ButtonDefaults.filledTonalButtonColors().containerColor,
) {
Icon(
painter = painterResource(R.drawable.earth_plus),
@@ -130,16 +130,7 @@ fun FollowSetsManagementDialog(
)
},
floatingActionButton = {
OutlinedButton(
onClick = {
navigator.popBack()
},
shape = ButtonBorder,
colors = ButtonDefaults.filledTonalButtonColors(),
elevation = ButtonDefaults.elevatedButtonElevation(defaultElevation = 6.0.dp),
) {
Text(text = "Cancel", fontWeight = FontWeight.SemiBold)
}
BackActionButton { navigator.popBack() }
},
) { contentPadding ->
Column(
@@ -228,10 +219,27 @@ fun FollowSetsManagementDialog(
}
}
@Composable
fun BackActionButton(
modifier: Modifier = Modifier,
onBack: () -> Unit,
) {
OutlinedButton(
onClick = onBack,
shape = ButtonBorder,
colors = ButtonDefaults.filledTonalButtonColors(),
elevation = ButtonDefaults.elevatedButtonElevation(defaultElevation = 6.0.dp),
) {
Text(text = "Back", fontWeight = FontWeight.SemiBold)
}
}
@Composable
private fun Loading() {
Column(
Modifier.fillMaxWidth().fillMaxHeight(0.5f),
Modifier
.fillMaxWidth()
.fillMaxHeight(0.5f),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
) {
@@ -243,7 +251,9 @@ private fun Loading() {
@Composable
private fun EmptyOrNoneFound(onRefresh: () -> Unit) {
Column(
Modifier.fillMaxWidth().fillMaxHeight(0.5f),
Modifier
.fillMaxWidth()
.fillMaxHeight(0.5f),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
) {
@@ -259,7 +269,9 @@ private fun ErrorMessage(
onRefresh: () -> Unit,
) {
Column(
Modifier.fillMaxWidth().fillMaxHeight(0.5f),
Modifier
.fillMaxWidth()
.fillMaxHeight(0.5f),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
) {