-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): add provider what's new screen and init provider test screen
- Loading branch information
Showing
16 changed files
with
247 additions
and
80 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
70 changes: 0 additions & 70 deletions
70
...rc/main/kotlin/com/flixclusive/feature/mobile/provider/settings/ProviderSettingsTopBar.kt
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
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 @@ | ||
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed | ||
plugins { | ||
alias(libs.plugins.flixclusive.feature) | ||
alias(libs.plugins.flixclusive.compose) | ||
alias(libs.plugins.flixclusive.destinations) | ||
} | ||
|
||
android { | ||
namespace = "com.flixclusive.feature.mobile.provider.test" | ||
} | ||
|
||
dependencies { | ||
implementation(projects.core.ui.mobile) | ||
implementation(projects.data.provider) | ||
|
||
implementation(libs.coil.compose) | ||
implementation(libs.compose.foundation) | ||
implementation(libs.compose.material3) | ||
implementation(libs.compose.runtime) | ||
implementation(libs.compose.ui) | ||
implementation(libs.compose.ui.tooling.preview) | ||
implementation(libs.lifecycle.runtimeCompose) | ||
} |
17 changes: 17 additions & 0 deletions
17
...in/kotlin/com/flixclusive/feature/mobile/provider/test/ProviderSettingsScreenViewModel.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,17 @@ | ||
package com.flixclusive.feature.mobile.provider.test | ||
|
||
import androidx.lifecycle.SavedStateHandle | ||
import androidx.lifecycle.ViewModel | ||
import com.flixclusive.core.ui.common.navigation.ProviderInfoScreenNavArgs | ||
import com.flixclusive.data.provider.ProviderManager | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import javax.inject.Inject | ||
|
||
@HiltViewModel | ||
class ProviderSettingsScreenViewModel @Inject constructor( | ||
providerManager: ProviderManager, | ||
savedStateHandle: SavedStateHandle | ||
) : ViewModel() { | ||
val providerData = savedStateHandle.navArgs<ProviderInfoScreenNavArgs>().providerData | ||
val providerInstance = providerManager.providers[providerData.name] | ||
} |
59 changes: 59 additions & 0 deletions
59
...r-test/src/main/kotlin/com/flixclusive/feature/mobile/provider/test/ProviderTestScreen.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,59 @@ | ||
package com.flixclusive.feature.mobile.provider.test | ||
|
||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.statusBarsPadding | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.currentComposer | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.ui.Modifier | ||
import androidx.hilt.navigation.compose.hiltViewModel | ||
import com.flixclusive.core.ui.common.COMMON_TOP_BAR_HEIGHT | ||
import com.flixclusive.core.ui.common.CommonTopBar | ||
import com.flixclusive.core.ui.common.navigation.GoBackAction | ||
import com.flixclusive.core.ui.common.navigation.ProviderInfoScreenNavArgs | ||
import com.ramcosta.composedestinations.annotation.Destination | ||
|
||
@Destination( | ||
navArgsDelegate = ProviderInfoScreenNavArgs::class | ||
) | ||
@Composable | ||
fun ProviderTestScreen( | ||
navigator: GoBackAction, | ||
args: ProviderInfoScreenNavArgs | ||
) { | ||
val viewModel = hiltViewModel<ProviderSettingsScreenViewModel>() | ||
|
||
Box( | ||
modifier = Modifier | ||
.fillMaxSize() | ||
) { | ||
Box( | ||
modifier = Modifier | ||
.statusBarsPadding() | ||
.padding(top = COMMON_TOP_BAR_HEIGHT) | ||
) { | ||
if (viewModel.providerInstance != null) { | ||
// Need to call the composable with the reflection way bc | ||
// Compose won't let us call it the normal way. | ||
val method = remember { | ||
viewModel.providerInstance::class.java | ||
.declaredMethods | ||
.find { | ||
it.name.equals("SettingsScreen") | ||
}?.also { | ||
it.isAccessible = true | ||
} | ||
} | ||
|
||
method?.invoke(viewModel.providerInstance, currentComposer, 0) | ||
} | ||
} | ||
|
||
CommonTopBar( | ||
headerTitle = args.providerData.name, | ||
onNavigationIconClick = navigator::goBack | ||
) | ||
} | ||
} |
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 @@ | ||
/build |
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,24 @@ | ||
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed | ||
plugins { | ||
alias(libs.plugins.flixclusive.feature) | ||
alias(libs.plugins.flixclusive.compose) | ||
alias(libs.plugins.flixclusive.destinations) | ||
} | ||
|
||
android { | ||
namespace = "com.flixclusive.feature.mobile.provider.whats_new" | ||
} | ||
|
||
dependencies { | ||
implementation(projects.core.ui.mobile) | ||
implementation(projects.data.provider) | ||
|
||
implementation(libs.coil.compose) | ||
implementation(libs.compose.foundation) | ||
implementation(libs.compose.material3) | ||
implementation(libs.compose.runtime) | ||
implementation(libs.compose.ui) | ||
implementation(libs.compose.ui.tooling.preview) | ||
implementation(libs.lifecycle.runtimeCompose) | ||
implementation(libs.markdown) | ||
} |
Oops, something went wrong.