-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from Divinelink/feature/details-fab-actions
[Expandable FAB] Introduce Expandable FAB Component on Details Screen
- Loading branch information
Showing
53 changed files
with
1,048 additions
and
462 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
209 changes: 48 additions & 161 deletions
209
.../test/kotlin/com/andreolas/movierama/details/domain/usecase/GetMediaDetailsUseCaseTest.kt
Large diffs are not rendered by default.
Oops, something went wrong.
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
28 changes: 28 additions & 0 deletions
28
core/domain/src/main/kotlin/com/divinelink/core/domain/GetDetailsActionItemsUseCase.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,28 @@ | ||
package com.divinelink.core.domain | ||
|
||
import com.divinelink.core.commons.domain.DispatcherProvider | ||
import com.divinelink.core.commons.domain.FlowUseCase | ||
import com.divinelink.core.datastore.PreferenceStorage | ||
import com.divinelink.core.model.details.DetailActionItem | ||
import kotlinx.coroutines.flow.Flow | ||
import kotlinx.coroutines.flow.combine | ||
|
||
class GetDetailsActionItemsUseCase( | ||
private val storage: PreferenceStorage, | ||
val dispatcher: DispatcherProvider, | ||
) : FlowUseCase<Unit, List<DetailActionItem>>(dispatcher.io) { | ||
|
||
override fun execute(parameters: Unit): Flow<Result<List<DetailActionItem>>> = combine( | ||
storage.jellyseerrAccount, | ||
) { account -> | ||
|
||
val menuItems = buildList { | ||
add(DetailActionItem.RATE) | ||
add(DetailActionItem.WATCHLIST) | ||
account.firstOrNull()?.let { | ||
add(DetailActionItem.REQUEST) | ||
} | ||
} | ||
Result.success(menuItems) | ||
} | ||
} |
25 changes: 8 additions & 17 deletions
25
core/domain/src/main/kotlin/com/divinelink/core/domain/GetDropdownMenuItemsUseCase.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 |
---|---|---|
@@ -1,27 +1,18 @@ | ||
package com.divinelink.core.domain | ||
|
||
import com.divinelink.core.commons.domain.DispatcherProvider | ||
import com.divinelink.core.commons.domain.FlowUseCase | ||
import com.divinelink.core.datastore.PreferenceStorage | ||
import com.divinelink.core.model.details.DetailsMenuOptions | ||
import com.divinelink.core.commons.domain.DispatcherProvider | ||
import kotlinx.coroutines.flow.Flow | ||
import kotlinx.coroutines.flow.combine | ||
import kotlinx.coroutines.flow.flow | ||
|
||
class GetDropdownMenuItemsUseCase( | ||
private val storage: PreferenceStorage, | ||
val dispatcher: DispatcherProvider, | ||
) : FlowUseCase<Unit, List<DetailsMenuOptions>>(dispatcher.io) { | ||
class GetDropdownMenuItemsUseCase(val dispatcher: DispatcherProvider) : | ||
FlowUseCase<Unit, List<DetailsMenuOptions>>(dispatcher.io) { | ||
|
||
override fun execute(parameters: Unit): Flow<Result<List<DetailsMenuOptions>>> = combine( | ||
storage.jellyseerrAccount, | ||
) { account -> | ||
val menuItems = mutableListOf<DetailsMenuOptions>() | ||
menuItems.add(DetailsMenuOptions.SHARE) | ||
|
||
account.firstOrNull()?.let { | ||
menuItems.add(DetailsMenuOptions.REQUEST) | ||
override fun execute(parameters: Unit): Flow<Result<List<DetailsMenuOptions>>> = flow { | ||
val menuItems = buildList { | ||
add(DetailsMenuOptions.SHARE) | ||
} | ||
|
||
Result.success(menuItems) | ||
emit(Result.success(menuItems)) | ||
} | ||
} |
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.