mirror of https://github.com/readrops/Readrops.git
Show feeds without folders in FeedTab
This commit is contained in:
parent
672de764de
commit
69788de077
|
@ -114,20 +114,35 @@ object FeedTab : Tab {
|
||||||
items(
|
items(
|
||||||
items = foldersAndFeeds.toList()
|
items = foldersAndFeeds.toList()
|
||||||
) { folderWithFeeds ->
|
) { 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) {
|
if (folderWithFeeds.first != null) {
|
||||||
FolderExpandableItem(
|
FolderExpandableItem(
|
||||||
folder = folderWithFeeds.first!!,
|
folder = folderWithFeeds.first!!,
|
||||||
feeds = folderWithFeeds.second,
|
feeds = folderWithFeeds.second,
|
||||||
onFeedClick = { feed ->
|
onFeedClick = { feed -> onFeedClick(feed) },
|
||||||
selectedFeed = feed
|
onFeedLongClick = { feed -> onFeedLongClick(feed) }
|
||||||
selectedFolder = folderWithFeeds.first
|
|
||||||
showBottomSheet = true
|
|
||||||
},
|
|
||||||
onFeedLongClick = { feed ->
|
|
||||||
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
|
|
||||||
uriHandler.openUri(feed.siteUrl!!)
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
val feeds = folderWithFeeds.second
|
||||||
|
|
||||||
|
for (feed in feeds) {
|
||||||
|
FeedItem(
|
||||||
|
feed = feed,
|
||||||
|
onClick = { onFeedClick(feed) },
|
||||||
|
onLongClick = { onFeedLongClick(feed) },
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue