-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature] Support managing subscription muting in a separate page (#84)
- Loading branch information
Showing
21 changed files
with
380 additions
and
39 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
2 changes: 1 addition & 1 deletion
2
...ppearance/feed/HideMutedFeedPreference.kt → .../behavior/feed/HideMutedFeedPreference.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
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
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
9 changes: 9 additions & 0 deletions
9
app/src/main/java/com/skyd/anivu/ui/screen/feed/mute/MuteFeedEvent.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,9 @@ | ||
package com.skyd.anivu.ui.screen.feed.mute | ||
|
||
import com.skyd.anivu.base.mvi.MviSingleEvent | ||
|
||
sealed interface MuteFeedEvent : MviSingleEvent { | ||
sealed interface MuteResultEvent : MuteFeedEvent { | ||
data class Failed(val msg: String) : MuteResultEvent | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
app/src/main/java/com/skyd/anivu/ui/screen/feed/mute/MuteFeedIntent.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,8 @@ | ||
package com.skyd.anivu.ui.screen.feed.mute | ||
|
||
import com.skyd.anivu.base.mvi.MviIntent | ||
|
||
sealed interface MuteFeedIntent : MviIntent { | ||
data object Init : MuteFeedIntent | ||
data class Mute(val feedUrl: String, val mute: Boolean) : MuteFeedIntent | ||
} |
41 changes: 41 additions & 0 deletions
41
app/src/main/java/com/skyd/anivu/ui/screen/feed/mute/MuteFeedPartialStateChange.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,41 @@ | ||
package com.skyd.anivu.ui.screen.feed.mute | ||
|
||
import com.skyd.anivu.model.bean.feed.FeedBean | ||
|
||
|
||
internal sealed interface MuteFeedPartialStateChange { | ||
fun reduce(oldState: MuteFeedState): MuteFeedState | ||
|
||
sealed interface LoadingDialog : MuteFeedPartialStateChange { | ||
data object Show : LoadingDialog { | ||
override fun reduce(oldState: MuteFeedState) = oldState.copy(loadingDialog = true) | ||
} | ||
} | ||
|
||
sealed interface Init : MuteFeedPartialStateChange { | ||
override fun reduce(oldState: MuteFeedState): MuteFeedState { | ||
return when (this) { | ||
is Failed -> oldState.copy(loadingDialog = false) | ||
is Success -> oldState.copy( | ||
listState = MuteFeedState.ListState.Success(feeds), | ||
loadingDialog = false, | ||
) | ||
} | ||
} | ||
|
||
data class Success(val feeds: List<FeedBean>) : Init | ||
data class Failed(val msg: String) : Init | ||
} | ||
|
||
sealed interface Mute : MuteFeedPartialStateChange { | ||
override fun reduce(oldState: MuteFeedState): MuteFeedState { | ||
return when (this) { | ||
is Failed -> oldState.copy(loadingDialog = false) | ||
is Success -> oldState.copy(loadingDialog = false) | ||
} | ||
} | ||
|
||
data object Success : Mute | ||
data class Failed(val msg: String) : Mute | ||
} | ||
} |
Oops, something went wrong.