diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 922b2edc2..78c00b798 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -61,8 +61,11 @@
-
+
+
+
+
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index e8cc2b4ba..d466f9376 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -85,9 +85,11 @@ dependencies {
implementation(projects.feature.mobile.home)
implementation(projects.feature.mobile.player)
implementation(projects.feature.mobile.preferences)
- implementation(projects.feature.mobile.providerList)
implementation(projects.feature.mobile.providerInfo)
+ implementation(projects.feature.mobile.providerList)
implementation(projects.feature.mobile.providerSettings)
+ implementation(projects.feature.mobile.providerTest)
+ implementation(projects.feature.mobile.providerWhatsNew)
implementation(projects.feature.mobile.recentlyWatched)
implementation(projects.feature.mobile.repository)
implementation(projects.feature.mobile.repositorySearch)
diff --git a/core/ui/common/src/main/kotlin/com/flixclusive/core/ui/common/CommonTopBar.kt b/core/ui/common/src/main/kotlin/com/flixclusive/core/ui/common/CommonTopBar.kt
index 24a22429a..daf7e1119 100644
--- a/core/ui/common/src/main/kotlin/com/flixclusive/core/ui/common/CommonTopBar.kt
+++ b/core/ui/common/src/main/kotlin/com/flixclusive/core/ui/common/CommonTopBar.kt
@@ -2,7 +2,7 @@ package com.flixclusive.core.ui.common
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
-import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
@@ -23,6 +23,8 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import com.flixclusive.core.util.R as UtilR
+val COMMON_TOP_BAR_HEIGHT = 65.dp
+
@Composable
fun CommonTopBar(
modifier: Modifier = Modifier,
@@ -30,10 +32,12 @@ fun CommonTopBar(
onNavigationIconClick: () -> Unit,
endContent: (@Composable () -> Unit)? = null,
) {
- Column(
+ Box(
modifier = Modifier
- .fillMaxWidth()
.background(MaterialTheme.colorScheme.surface)
+ .statusBarsPadding()
+ .height(COMMON_TOP_BAR_HEIGHT),
+ contentAlignment = Alignment.TopCenter
) {
Spacer(modifier = Modifier.statusBarsPadding())
diff --git a/core/ui/common/src/main/kotlin/com/flixclusive/core/ui/common/util/DummyDataForPreview.kt b/core/ui/common/src/main/kotlin/com/flixclusive/core/ui/common/util/DummyDataForPreview.kt
index 24d2addc9..3afea809c 100644
--- a/core/ui/common/src/main/kotlin/com/flixclusive/core/ui/common/util/DummyDataForPreview.kt
+++ b/core/ui/common/src/main/kotlin/com/flixclusive/core/ui/common/util/DummyDataForPreview.kt
@@ -15,7 +15,12 @@ object DummyDataForPreview {
authors = List(5) { Author("FLX $it") },
repositoryUrl = "https://github.com/flixclusive/123Movies",
buildUrl = "https://raw.githubusercontent.com/Flixclusive/plugins-template/builds/updater.json",
- changelog = """Test""",
+ changelog = """
+ # v1.0.0
+
+ - Added new feature
+ - Fixed a bug
+ """.trimIndent(),
versionName = "1.0.0",
versionCode = 10000,
description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
diff --git a/core/util/src/main/res/values/strings.xml b/core/util/src/main/res/values/strings.xml
index 06e4e82e4..42db61eb3 100644
--- a/core/util/src/main/res/values/strings.xml
+++ b/core/util/src/main/res/values/strings.xml
@@ -239,6 +239,7 @@
I\'m sorry, this is not yet watchable
Episode is not yet available
Unknown provider type
+ This feature is coming soon!
Version is up to date!
Start adding now!
diff --git a/feature/mobile/provider-info/src/main/kotlin/com/flixclusive/feature/mobile/provider/info/ProviderInfoScreen.kt b/feature/mobile/provider-info/src/main/kotlin/com/flixclusive/feature/mobile/provider/info/ProviderInfoScreen.kt
index 59e79139d..00a595f23 100644
--- a/feature/mobile/provider-info/src/main/kotlin/com/flixclusive/feature/mobile/provider/info/ProviderInfoScreen.kt
+++ b/feature/mobile/provider-info/src/main/kotlin/com/flixclusive/feature/mobile/provider/info/ProviderInfoScreen.kt
@@ -159,6 +159,7 @@ fun ProviderInfoScreen(
.padding(bottom = 10.dp),
providerInstallationStatus = viewModel.providerInstallationStatus,
onTestProvider = {
+ context.showToast(context.getString(UtilR.string.coming_soon_feature))
navigator.testProviders(listOf(args.providerData))
},
onToggleInstallationState = viewModel::toggleInstallation
diff --git a/feature/mobile/provider-settings/src/main/kotlin/com/flixclusive/feature/mobile/provider/settings/ProviderSettingsScreen.kt b/feature/mobile/provider-settings/src/main/kotlin/com/flixclusive/feature/mobile/provider/settings/ProviderSettingsScreen.kt
index ee84353cc..d4dcde592 100644
--- a/feature/mobile/provider-settings/src/main/kotlin/com/flixclusive/feature/mobile/provider/settings/ProviderSettingsScreen.kt
+++ b/feature/mobile/provider-settings/src/main/kotlin/com/flixclusive/feature/mobile/provider/settings/ProviderSettingsScreen.kt
@@ -9,6 +9,8 @@ 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
@@ -30,7 +32,7 @@ fun ProviderSettingsScreen(
Box(
modifier = Modifier
.statusBarsPadding()
- .padding(top = TOP_BAR_HEIGHT)
+ .padding(top = COMMON_TOP_BAR_HEIGHT)
) {
if (viewModel.providerInstance != null) {
// Need to call the composable with the reflection way bc
@@ -49,8 +51,8 @@ fun ProviderSettingsScreen(
}
}
- ProviderSettingsTopBar(
- label = args.providerData.name,
+ CommonTopBar(
+ headerTitle = args.providerData.name,
onNavigationIconClick = navigator::goBack
)
}
diff --git a/feature/mobile/provider-settings/src/main/kotlin/com/flixclusive/feature/mobile/provider/settings/ProviderSettingsTopBar.kt b/feature/mobile/provider-settings/src/main/kotlin/com/flixclusive/feature/mobile/provider/settings/ProviderSettingsTopBar.kt
deleted file mode 100644
index aaee0dd78..000000000
--- a/feature/mobile/provider-settings/src/main/kotlin/com/flixclusive/feature/mobile/provider/settings/ProviderSettingsTopBar.kt
+++ /dev/null
@@ -1,70 +0,0 @@
-package com.flixclusive.feature.mobile.provider.settings
-
-
-import androidx.compose.foundation.background
-import androidx.compose.foundation.layout.Arrangement
-import androidx.compose.foundation.layout.Box
-import androidx.compose.foundation.layout.Row
-import androidx.compose.foundation.layout.fillMaxHeight
-import androidx.compose.foundation.layout.fillMaxWidth
-import androidx.compose.foundation.layout.height
-import androidx.compose.foundation.layout.padding
-import androidx.compose.foundation.layout.statusBarsPadding
-import androidx.compose.material3.Icon
-import androidx.compose.material3.IconButton
-import androidx.compose.material3.MaterialTheme
-import androidx.compose.material3.Text
-import androidx.compose.runtime.Composable
-import androidx.compose.ui.Alignment
-import androidx.compose.ui.Modifier
-import androidx.compose.ui.res.painterResource
-import androidx.compose.ui.res.stringResource
-import androidx.compose.ui.text.font.FontWeight
-import androidx.compose.ui.text.style.TextOverflow
-import androidx.compose.ui.unit.dp
-import com.flixclusive.core.ui.common.R as UiCommonR
-import com.flixclusive.core.util.R as UtilR
-
-internal val TOP_BAR_HEIGHT = 65.dp
-
-@Composable
-internal fun ProviderSettingsTopBar(
- modifier: Modifier = Modifier,
- label: String,
- onNavigationIconClick: () -> Unit,
-) {
- Box(
- modifier = Modifier
- .background(MaterialTheme.colorScheme.surface)
- .statusBarsPadding()
- .height(TOP_BAR_HEIGHT),
- contentAlignment = Alignment.TopCenter
- ) {
- Row(
- modifier = modifier
- .fillMaxWidth()
- .fillMaxHeight(),
- horizontalArrangement = Arrangement.Center,
- verticalAlignment = Alignment.CenterVertically
- ) {
- IconButton(onClick = onNavigationIconClick) {
- Icon(
- painter = painterResource(UiCommonR.drawable.left_arrow),
- contentDescription = stringResource(UtilR.string.navigate_up)
- )
- }
-
- Text(
- text = label,
- style = MaterialTheme.typography.bodyLarge.copy(
- fontWeight = FontWeight.SemiBold
- ),
- overflow = TextOverflow.Ellipsis,
- maxLines = 1,
- modifier = Modifier
- .weight(1F)
- .padding(horizontal = 15.dp)
- )
- }
- }
-}
\ No newline at end of file
diff --git a/feature/mobile/provider-test/.gitignore b/feature/mobile/provider-test/.gitignore
new file mode 100644
index 000000000..42afabfd2
--- /dev/null
+++ b/feature/mobile/provider-test/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/feature/mobile/provider-test/build.gradle.kts b/feature/mobile/provider-test/build.gradle.kts
new file mode 100644
index 000000000..79991da20
--- /dev/null
+++ b/feature/mobile/provider-test/build.gradle.kts
@@ -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)
+}
\ No newline at end of file
diff --git a/feature/mobile/provider-test/src/main/kotlin/com/flixclusive/feature/mobile/provider/test/ProviderSettingsScreenViewModel.kt b/feature/mobile/provider-test/src/main/kotlin/com/flixclusive/feature/mobile/provider/test/ProviderSettingsScreenViewModel.kt
new file mode 100644
index 000000000..ba360eb05
--- /dev/null
+++ b/feature/mobile/provider-test/src/main/kotlin/com/flixclusive/feature/mobile/provider/test/ProviderSettingsScreenViewModel.kt
@@ -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().providerData
+ val providerInstance = providerManager.providers[providerData.name]
+}
diff --git a/feature/mobile/provider-test/src/main/kotlin/com/flixclusive/feature/mobile/provider/test/ProviderTestScreen.kt b/feature/mobile/provider-test/src/main/kotlin/com/flixclusive/feature/mobile/provider/test/ProviderTestScreen.kt
new file mode 100644
index 000000000..104ad3660
--- /dev/null
+++ b/feature/mobile/provider-test/src/main/kotlin/com/flixclusive/feature/mobile/provider/test/ProviderTestScreen.kt
@@ -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()
+
+ 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
+ )
+ }
+}
diff --git a/feature/mobile/provider-whats-new/.gitignore b/feature/mobile/provider-whats-new/.gitignore
new file mode 100644
index 000000000..42afabfd2
--- /dev/null
+++ b/feature/mobile/provider-whats-new/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/feature/mobile/provider-whats-new/build.gradle.kts b/feature/mobile/provider-whats-new/build.gradle.kts
new file mode 100644
index 000000000..5cc9896e7
--- /dev/null
+++ b/feature/mobile/provider-whats-new/build.gradle.kts
@@ -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)
+}
\ No newline at end of file
diff --git a/feature/mobile/provider-whats-new/src/main/kotlin/com/flixclusive/feature/mobile/provider/whats_new/ProviderWhatsNewScreen.kt b/feature/mobile/provider-whats-new/src/main/kotlin/com/flixclusive/feature/mobile/provider/whats_new/ProviderWhatsNewScreen.kt
new file mode 100644
index 000000000..3b44965df
--- /dev/null
+++ b/feature/mobile/provider-whats-new/src/main/kotlin/com/flixclusive/feature/mobile/provider/whats_new/ProviderWhatsNewScreen.kt
@@ -0,0 +1,92 @@
+package com.flixclusive.feature.mobile.provider.whats_new
+
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.statusBarsPadding
+import androidx.compose.foundation.rememberScrollState
+import androidx.compose.foundation.verticalScroll
+import androidx.compose.material3.LocalContentColor
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.Surface
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.platform.LocalContext
+import androidx.compose.ui.platform.LocalUriHandler
+import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.dp
+import coil.imageLoader
+import com.flixclusive.core.theme.FlixclusiveTheme
+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.flixclusive.core.ui.common.util.DummyDataForPreview.getDummyProviderData
+import com.ramcosta.composedestinations.annotation.Destination
+import dev.jeziellago.compose.markdowntext.MarkdownText
+import com.flixclusive.core.theme.R as ThemeR
+
+@Destination(
+ navArgsDelegate = ProviderInfoScreenNavArgs::class
+)
+@Composable
+fun ProviderWhatsNewScreen(
+ navigator: GoBackAction,
+ args: ProviderInfoScreenNavArgs
+) {
+ val uriHandler = LocalUriHandler.current
+
+ Box(
+ modifier = Modifier
+ .fillMaxSize()
+ ) {
+ Column(
+ modifier = Modifier
+ .statusBarsPadding()
+ .padding(top = COMMON_TOP_BAR_HEIGHT)
+ .verticalScroll(rememberScrollState())
+ ) {
+ args.providerData.changelog?.let {
+ MarkdownText(
+ markdown = it,
+ isTextSelectable = true,
+ linkColor = Color(0xFF5890FF),
+ fontResource = ThemeR.font.space_grotesk_medium,
+ style = MaterialTheme.typography.bodyMedium.copy(
+ color = LocalContentColor.current,
+ ),
+ imageLoader = LocalContext.current.imageLoader,
+ onLinkClicked = uriHandler::openUri,
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(horizontal = 16.dp)
+ )
+ }
+ }
+
+ CommonTopBar(
+ headerTitle = args.providerData.name,
+ onNavigationIconClick = navigator::goBack
+ )
+ }
+}
+
+@Preview
+@Composable
+private fun ProviderWhatsNewScreenPreview() {
+ FlixclusiveTheme {
+ Surface {
+ ProviderWhatsNewScreen(
+ navigator = object : GoBackAction {
+ override fun goBack() {}
+ },
+ args = ProviderInfoScreenNavArgs(
+ providerData = getDummyProviderData()
+ )
+ )
+ }
+ }
+}
\ No newline at end of file
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 334e2b4e9..f3a36863b 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -37,9 +37,11 @@ include(":feature:mobile:genre")
include(":feature:mobile:home")
include(":feature:mobile:player")
include(":feature:mobile:preferences")
-include(":feature:mobile:provider-list")
include(":feature:mobile:provider-info")
+include(":feature:mobile:provider-list")
include(":feature:mobile:provider-settings")
+include(":feature:mobile:provider-test")
+include(":feature:mobile:provider-whats-new")
include(":feature:mobile:recently-watched")
include(":feature:mobile:repository")
include(":feature:mobile:repository-search")