Skip to content

Commit

Permalink
[1.141.*] Pre-release merge (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
tramline-github[bot] authored Apr 27, 2024
2 parents 8785ee8 + 703bcb2 commit 7cec4b3
Show file tree
Hide file tree
Showing 17 changed files with 1,034 additions and 840 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/ci_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:

jobs:
code-formatting:
runs-on: macos-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -60,11 +60,17 @@ jobs:
run: ./gradlew cleanAllTests allTests

android-tests:
runs-on: macos-latest
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4

- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Setup JDK 20
uses: actions/setup-java@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
kotlin = "1.9.23"
android_gradle_plugin = "8.3.2"
compose = "1.6.2"
compose = "1.6.10-beta02"

android_sdk_compile = "34"
android_sdk_target = "34"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,5 @@ val DeTwineStrings =
actionGroupsTooltip = "Gruppen können nicht innerhalb anderer Gruppen sein.",
groupAddNew = "Add new",
appBarAllFeeds = "All feeds",
edit = "Edit",
)
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,5 @@ val EnTwineStrings =
actionGroupsTooltip = "Groups cannot be inside other groups.",
groupAddNew = "Add new",
appBarAllFeeds = "All feeds",
edit = "Edit",
)
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,5 @@ val TrTwineStrings =
actionGroupsTooltip = "Gruplar başka grupların içinde olamaz.",
groupAddNew = "Add new",
appBarAllFeeds = "All feeds",
edit = "Edit",
)
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ data class TwineStrings(
val actionGroupsTooltip: String,
val groupAddNew: String,
val appBarAllFeeds: String,
val edit: String
)

object Locales {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ class AppPresenter(
{ navigation.push(Config.Bookmarks) },
{ navigation.push(Config.Settings) },
{ openPost(it) },
{ modalNavigation.activate(ModalConfig.GroupSelection) }
{ modalNavigation.activate(ModalConfig.GroupSelection) },
{ modalNavigation.activate(ModalConfig.FeedInfo(it)) }
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ sealed interface FeedsEvent {

data object ClearSearchQuery : FeedsEvent

data class OnFeedClick(val source: Source) : FeedsEvent
data class OnSourceClick(val source: Source) : FeedsEvent

data class OnFeedSortOrderChanged(val feedsOrderBy: FeedsOrderBy) : FeedsEvent

Expand All @@ -60,5 +60,7 @@ sealed interface FeedsEvent {

data class OnGroupsSelected(val groupIds: Set<String>) : FeedsEvent

data class OnEditSourceClicked(val source: Source) : FeedsEvent

data object OnAddToGroupClicked : FeedsEvent
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import com.arkivanov.essenty.instancekeeper.InstanceKeeper
import com.arkivanov.essenty.instancekeeper.getOrCreate
import com.arkivanov.essenty.lifecycle.doOnCreate
import dev.sasikanth.rss.reader.core.model.local.Feed
import dev.sasikanth.rss.reader.core.model.local.FeedGroup
import dev.sasikanth.rss.reader.core.model.local.Source
import dev.sasikanth.rss.reader.core.model.local.SourceType
import dev.sasikanth.rss.reader.feeds.ui.FeedsViewMode
Expand Down Expand Up @@ -77,6 +78,7 @@ class FeedsPresenter(
private val observableActiveSource: ObservableActiveSource,
@Assisted componentContext: ComponentContext,
@Assisted private val openGroupSelectionSheet: () -> Unit,
@Assisted private val openFeedInfoSheet: (feedId: String) -> Unit,
) : ComponentContext by componentContext {

private val presenterInstance =
Expand All @@ -100,12 +102,20 @@ class FeedsPresenter(

fun dispatch(event: FeedsEvent) {
when (event) {
is FeedsEvent.OnFeedClick -> {
// TODO: Open source screen with posts
}
is FeedsEvent.OnAddToGroupClicked -> {
openGroupSelectionSheet()
}
is FeedsEvent.OnEditSourceClicked -> {
when (val source = event.source) {
is Feed -> openFeedInfoSheet(source.id)
is FeedGroup -> {
// TODO: Open edit feed group screen
}
else -> {
throw IllegalArgumentException("Unknown source: $source")
}
}
}
else -> {
// no-op
}
Expand Down Expand Up @@ -146,10 +156,7 @@ class FeedsPresenter(
is FeedsEvent.OnFeedPinClicked -> onFeedPinClicked(event.feed)
FeedsEvent.ClearSearchQuery -> clearSearchQuery()
is FeedsEvent.SearchQueryChanged -> onSearchQueryChanged(event.searchQuery)
is FeedsEvent.OnFeedClick -> {
// TODO: Remove once source page with posts is implemented
onSourceClicked(event.source)
}
is FeedsEvent.OnSourceClick -> onSourceClicked(event.source)
FeedsEvent.TogglePinnedSection -> onTogglePinnedSection()
is FeedsEvent.OnFeedSortOrderChanged -> onFeedSortOrderChanged(event.feedsOrderBy)
FeedsEvent.OnChangeFeedsViewModeClick -> onChangeFeedsViewModeClick()
Expand All @@ -163,6 +170,9 @@ class FeedsPresenter(
FeedsEvent.OnAddToGroupClicked -> {
// no-op
}
is FeedsEvent.OnEditSourceClicked -> {
// no-op
}
}
}

Expand Down Expand Up @@ -206,7 +216,12 @@ class FeedsPresenter(
private fun onDeleteSelectedSources() {
coroutineScope
.launch { rssRepository.deleteSources(_state.value.selectedSources) }
.invokeOnCompletion { dispatch(FeedsEvent.CancelSourcesSelection) }
.invokeOnCompletion {
if (_state.value.selectedSources.any { it.id == _state.value.activeSource?.id }) {
_state.update { it.copy(activeSource = null) }
}
dispatch(FeedsEvent.CancelSourcesSelection)
}
}

private fun onCancelSourcesSelection() {
Expand Down
Loading

0 comments on commit 7cec4b3

Please sign in to comment.