-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a3623d9
commit d6d605f
Showing
41 changed files
with
822 additions
and
111 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
14 changes: 14 additions & 0 deletions
14
core/analytics/src/main/kotlin/org/michaelbel/movies/analytics/event/SelectFeedViewEvent.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,14 @@ | ||
package org.michaelbel.movies.analytics.event | ||
|
||
import org.michaelbel.movies.analytics.constants.MoviesEvents | ||
import org.michaelbel.movies.analytics.constants.MoviesParams | ||
import org.michaelbel.movies.analytics.model.BaseEvent | ||
|
||
class SelectFeedViewEvent( | ||
feedView: String | ||
): BaseEvent(MoviesEvents.SETTINGS_FEED_VIEW) { | ||
|
||
init { | ||
add(MoviesParams.PARAM_SELECTED_FEED_VIEW, feedView) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
core/common/src/main/kotlin/org/michaelbel/movies/common/appearance/FeedView.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,20 @@ | ||
package org.michaelbel.movies.common.appearance | ||
|
||
import org.michaelbel.movies.common.appearance.exceptions.InvalidFeedViewException | ||
|
||
sealed interface FeedView { | ||
|
||
data object List: FeedView | ||
|
||
data object Grid: FeedView | ||
|
||
companion object { | ||
fun transform(name: String): FeedView { | ||
return when (name) { | ||
List.toString() -> List | ||
Grid.toString() -> Grid | ||
else -> throw InvalidFeedViewException | ||
} | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...ain/kotlin/org/michaelbel/movies/common/appearance/exceptions/InvalidFeedViewException.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,5 @@ | ||
package org.michaelbel.movies.common.appearance.exceptions | ||
|
||
internal data object InvalidFeedViewException: Exception("Invalid feed view") { | ||
private fun readResolve(): Any = InvalidFeedViewException | ||
} |
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
13 changes: 13 additions & 0 deletions
13
...interactor/src/main/kotlin/org/michaelbel/movies/interactor/usecase/SelectFeedViewCase.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,13 @@ | ||
package org.michaelbel.movies.interactor.usecase | ||
|
||
import org.michaelbel.movies.common.appearance.FeedView | ||
import org.michaelbel.movies.interactor.Interactor | ||
import javax.inject.Inject | ||
|
||
class SelectFeedViewCase @Inject constructor( | ||
private val interactor: Interactor | ||
) { | ||
suspend operator fun invoke(feedView: FeedView) { | ||
interactor.selectFeedView(feedView) | ||
} | ||
} |
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
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
Oops, something went wrong.