generated from JetBrains/compose-multiplatform-template
-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to show feed info sheet from feeds sheet (#276)
* When feed sheet is created, then load feed info * When back is clicked, then dismiss bottom sheet * When remove feed is clicked, then remove feed * When feed name is changed, then update the feed name * Extract out feed label input component from `FeedListItem` * Add text align option to `FeedLabelInput` * Add `FeedInfoBottomSheet` UI * When feed info is clicked, then open feed info bottom sheet * Add support opening modals in the app * Use `ModalBottomSheet` as parent in `FeedInfoBottomSheet` * Dispatch `Init` when feed presenter is created * Remove `wrapContentHeight` modifier from `FeedInfoBottomSheet` * Run code formatting * Add progress indicator to `FeedInfoBottomSheet` * Add param to open feed info sheet, when button is clicked in feed list item * When removing feed is finished, then dismiss the feed info sheet * Change arrow down icon to info icon in feed list item * Show confirm delete feed dialog when remove button is clicked in feed info sheet
- Loading branch information
1 parent
e89351b
commit 39ca894
Showing
17 changed files
with
707 additions
and
136 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
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
23 changes: 23 additions & 0 deletions
23
shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/app/Modals.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,23 @@ | ||
/* | ||
* Copyright 2024 Sasikanth Miriyampalli | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package dev.sasikanth.rss.reader.app | ||
|
||
import dev.sasikanth.rss.reader.feed.FeedPresenter | ||
|
||
internal sealed interface Modals { | ||
class FeedInfo(val presenter: FeedPresenter) : Modals | ||
} |
75 changes: 75 additions & 0 deletions
75
shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/components/ConfirmFeedDeleteDialog.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,75 @@ | ||
/* | ||
* Copyright 2024 Sasikanth Miriyampalli | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package dev.sasikanth.rss.reader.components | ||
|
||
import androidx.compose.material3.AlertDialog | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Text | ||
import androidx.compose.material3.TextButton | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import dev.sasikanth.rss.reader.resources.strings.LocalStrings | ||
import dev.sasikanth.rss.reader.ui.AppTheme | ||
|
||
@Composable | ||
internal fun ConfirmFeedDeleteDialog( | ||
feedName: String, | ||
onRemoveFeed: () -> Unit, | ||
dismiss: () -> Unit, | ||
modifier: Modifier = Modifier, | ||
) { | ||
AlertDialog( | ||
modifier = modifier, | ||
onDismissRequest = dismiss, | ||
confirmButton = { | ||
TextButton( | ||
onClick = { | ||
onRemoveFeed() | ||
dismiss() | ||
}, | ||
shape = MaterialTheme.shapes.large | ||
) { | ||
Text( | ||
text = LocalStrings.current.delete, | ||
style = MaterialTheme.typography.labelLarge, | ||
color = MaterialTheme.colorScheme.error | ||
) | ||
} | ||
}, | ||
dismissButton = { | ||
TextButton(onClick = dismiss, shape = MaterialTheme.shapes.large) { | ||
Text( | ||
text = LocalStrings.current.buttonCancel, | ||
style = MaterialTheme.typography.labelLarge, | ||
color = AppTheme.colorScheme.textEmphasisMed | ||
) | ||
} | ||
}, | ||
title = { | ||
Text(text = LocalStrings.current.removeFeed, color = AppTheme.colorScheme.textEmphasisMed) | ||
}, | ||
text = { | ||
Text( | ||
text = LocalStrings.current.removeFeedDesc(feedName), | ||
color = AppTheme.colorScheme.textEmphasisMed | ||
) | ||
}, | ||
containerColor = AppTheme.colorScheme.tintedSurface, | ||
titleContentColor = AppTheme.colorScheme.onSurface, | ||
textContentColor = AppTheme.colorScheme.onSurface, | ||
) | ||
} |
Oops, something went wrong.