Show feeds without folders in FeedTab

This commit is contained in:
Shinokuni 2024-01-14 01:01:45 +01:00
parent 672de764de
commit 69788de077
1 changed files with 24 additions and 9 deletions

View File

@ -114,20 +114,35 @@ object FeedTab : Tab {
items(
items = foldersAndFeeds.toList()
) { folderWithFeeds ->
fun onFeedClick(feed: Feed) {
selectedFeed = feed
selectedFolder = folderWithFeeds.first
showBottomSheet = true
}
fun onFeedLongClick(feed: Feed) {
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
uriHandler.openUri(feed.siteUrl!!)
}
if (folderWithFeeds.first != null) {
FolderExpandableItem(
folder = folderWithFeeds.first!!,
feeds = folderWithFeeds.second,
onFeedClick = { feed ->
selectedFeed = feed
selectedFolder = folderWithFeeds.first
showBottomSheet = true
},
onFeedLongClick = { feed ->
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
uriHandler.openUri(feed.siteUrl!!)
}
onFeedClick = { feed -> onFeedClick(feed) },
onFeedLongClick = { feed -> onFeedLongClick(feed) }
)
} else {
val feeds = folderWithFeeds.second
for (feed in feeds) {
FeedItem(
feed = feed,
onClick = { onFeedClick(feed) },
onLongClick = { onFeedLongClick(feed) },
)
}
}
}
}