diff --git a/appcompose/src/main/java/com/readrops/app/compose/feeds/FeedBottomSheet.kt b/appcompose/src/main/java/com/readrops/app/compose/feeds/FeedBottomSheet.kt index b855e63d..87eaea42 100644 --- a/appcompose/src/main/java/com/readrops/app/compose/feeds/FeedBottomSheet.kt +++ b/appcompose/src/main/java/com/readrops/app/compose/feeds/FeedBottomSheet.kt @@ -22,7 +22,6 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.res.vectorResource -import androidx.compose.ui.unit.dp import coil.compose.AsyncImage import com.readrops.app.compose.R import com.readrops.app.compose.util.theme.LargeSpacer @@ -30,14 +29,17 @@ import com.readrops.app.compose.util.theme.MediumSpacer import com.readrops.app.compose.util.theme.VeryShortSpacer import com.readrops.app.compose.util.theme.spacing import com.readrops.db.entities.Feed +import com.readrops.db.entities.Folder @OptIn(ExperimentalMaterial3Api::class) @Composable fun FeedModalBottomSheet( feed: Feed, + folder: Folder?, onDismissRequest: () -> Unit, onOpen: () -> Unit, onModify: () -> Unit, + onUpdateColor: () -> Unit, onDelete: () -> Unit, ) { ModalBottomSheet( @@ -48,13 +50,13 @@ fun FeedModalBottomSheet( horizontalArrangement = Arrangement.Center, verticalAlignment = Alignment.CenterVertically, modifier = Modifier.padding( - horizontal = 24.dp + horizontal = MaterialTheme.spacing.largeSpacing ) ) { AsyncImage( model = feed.iconUrl, contentDescription = feed.name!!, - modifier = Modifier.size(48.dp) + modifier = Modifier.size(MaterialTheme.spacing.veryLargeSpacing) ) MediumSpacer() @@ -65,12 +67,14 @@ fun FeedModalBottomSheet( style = MaterialTheme.typography.headlineSmall, ) - VeryShortSpacer() + if (folder != null) { + VeryShortSpacer() - Text( - text = "folder name if it exists", - style = MaterialTheme.typography.labelSmall - ) + Text( + text = folder.name!!, + style = MaterialTheme.typography.labelSmall + ) + } } } @@ -78,7 +82,7 @@ fun FeedModalBottomSheet( Divider( modifier = Modifier.padding( - horizontal = MaterialTheme.spacing.shortSpacing + horizontal = MaterialTheme.spacing.mediumSpacing ) ) @@ -96,6 +100,12 @@ fun FeedModalBottomSheet( onClick = onModify ) + BottomSheetOption( + text = "Update color", + icon = ImageVector.vectorResource(R.drawable.ic_color), + onClick = onUpdateColor + ) + BottomSheetOption( text = "Delete", icon = Icons.Default.Delete, @@ -120,8 +130,8 @@ fun BottomSheetOption( modifier = Modifier .fillMaxWidth() .padding( - horizontal = 16.dp, - vertical = 8.dp + horizontal = MaterialTheme.spacing.mediumSpacing, + vertical = MaterialTheme.spacing.shortSpacing ) ) { diff --git a/appcompose/src/main/java/com/readrops/app/compose/feeds/FeedTab.kt b/appcompose/src/main/java/com/readrops/app/compose/feeds/FeedTab.kt index 2d67b35b..fcf06e9c 100644 --- a/appcompose/src/main/java/com/readrops/app/compose/feeds/FeedTab.kt +++ b/appcompose/src/main/java/com/readrops/app/compose/feeds/FeedTab.kt @@ -1,6 +1,5 @@ package com.readrops.app.compose.feeds -import android.util.Log import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding @@ -34,6 +33,7 @@ import cafe.adriel.voyager.navigator.tab.TabOptions import com.readrops.app.compose.R import com.readrops.app.compose.util.components.Placeholder import com.readrops.db.entities.Feed +import com.readrops.db.entities.Folder import org.koin.androidx.compose.getViewModel object FeedTab : Tab { @@ -56,16 +56,17 @@ object FeedTab : Tab { var showDialog by remember { mutableStateOf(false) } var selectedFeed by remember { mutableStateOf(null) } + var selectedFolder by remember { mutableStateOf(null) } var showBottomSheet by remember { mutableStateOf(false) } if (showBottomSheet) { FeedModalBottomSheet( feed = selectedFeed!!, + folder = selectedFolder, onDismissRequest = { showBottomSheet = false }, - onOpen = { - Log.d("TAG", "Content: ") - uriHandler.openUri(selectedFeed!!.siteUrl!!) }, + onOpen = { uriHandler.openUri(selectedFeed!!.siteUrl!!) }, onModify = { }, + onUpdateColor = {}, onDelete = {}, ) } @@ -119,6 +120,7 @@ object FeedTab : Tab { feeds = folderWithFeeds.second, onFeedClick = { feed -> selectedFeed = feed + selectedFolder = folderWithFeeds.first showBottomSheet = true }, onFeedLongClick = { feed -> diff --git a/appcompose/src/main/res/drawable/ic_color.xml b/appcompose/src/main/res/drawable/ic_color.xml new file mode 100644 index 00000000..c3d2c7b3 --- /dev/null +++ b/appcompose/src/main/res/drawable/ic_color.xml @@ -0,0 +1,5 @@ + + +