Skip to content

Commit

Permalink
feat(ui): migrate to swipe
Browse files Browse the repository at this point in the history
  • Loading branch information
JunkFood02 committed Sep 26, 2024
1 parent 8140df4 commit d1f9641
Show file tree
Hide file tree
Showing 7 changed files with 200 additions and 580 deletions.
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ dependencies {
implementation(libs.readability4j)
implementation(libs.rome)
implementation(libs.telephoto)
implementation(libs.swipe)
implementation(libs.okhttp)
implementation(libs.okhttp.coroutines)
implementation(libs.retrofit)
Expand Down
23 changes: 17 additions & 6 deletions app/src/main/java/me/ash/reader/ui/page/home/feeds/FeedsPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ fun FeedsPage(
is GroupFeedsView.Group -> {
groupsVisible[groupWithFeed.group.id] = true
}

else -> {}
}
}
Expand All @@ -178,12 +179,15 @@ fun FeedsPage(
is GroupFeedsView.Group -> {
groupsVisible[groupWithFeed.group.id] = false
}

else -> {}
}
}
hasGroupVisible = false
}
val groupDrawerState = rememberModalBottomSheetState(initialValue = ModalBottomSheetValue.Hidden)

val groupDrawerState =
rememberModalBottomSheetState(initialValue = ModalBottomSheetValue.Hidden)
val feedDrawerState = rememberModalBottomSheetState(initialValue = ModalBottomSheetValue.Hidden)

LaunchedEffect(Unit) {
Expand Down Expand Up @@ -327,10 +331,16 @@ fun FeedsPage(
groupWithFeed.group.id,
groupListExpand::value
).not()
hasGroupVisible = if (groupsVisible[groupWithFeed.group.id] == true) {
true
} else {
groupsVisible.any { it.value }
hasGroupVisible =
if (groupsVisible[groupWithFeed.group.id] == true) {
true
} else {
groupsVisible.any { it.value }
}
},
onLongClick = {
scope.launch {
groupDrawerState.show()
}
}
) {
Expand Down Expand Up @@ -400,7 +410,8 @@ fun FeedsPage(
)

SubscribeDialog(subscribeViewModel = subscribeViewModel)
GroupOptionDrawer()

GroupOptionDrawer(drawerState = groupDrawerState)
FeedOptionDrawer(drawerState = feedDrawerState)

AccountsTab(
Expand Down
Loading

0 comments on commit d1f9641

Please sign in to comment.