-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move article status filter to bottom of feed list (#763)
* Move article status filter to bottom of feed list * Rearrange add icon button
- Loading branch information
Showing
11 changed files
with
164 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
app/src/main/java/com/capyreader/app/ui/articles/ArticleStatusBar.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.capyreader.app.ui.articles | ||
|
||
import androidx.compose.material3.SegmentedButton | ||
import androidx.compose.material3.SegmentedButtonDefaults | ||
import androidx.compose.material3.SingleChoiceSegmentedButtonRow | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import com.jocmp.capy.ArticleStatus | ||
|
||
@Composable | ||
fun ArticleStatusBar( | ||
onSelectStatus: (status: ArticleStatus) -> Unit, | ||
status: ArticleStatus, | ||
) { | ||
SingleChoiceSegmentedButtonRow { | ||
options.forEachIndexed { index, buttonStatus -> | ||
SegmentedButton( | ||
shape = SegmentedButtonDefaults.itemShape(index = index, count = options.size), | ||
onClick = { | ||
if (buttonStatus != status) { | ||
onSelectStatus(buttonStatus) | ||
} | ||
}, | ||
icon = {}, | ||
selected = buttonStatus == status | ||
) { | ||
ArticleStatusIcon(status = buttonStatus) | ||
} | ||
} | ||
} | ||
} | ||
|
||
val options = listOf( | ||
ArticleStatus.ALL, | ||
ArticleStatus.UNREAD, | ||
ArticleStatus.STARRED, | ||
) | ||
|
||
@Composable | ||
@Preview | ||
fun ArticleStatusBarPreview() { | ||
ArticleStatusBar( | ||
onSelectStatus = {}, | ||
status = ArticleStatus.UNREAD | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 0 additions & 62 deletions
62
app/src/main/java/com/capyreader/app/ui/articles/ArticleStatusMenu.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.