mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-16 23:12:12 +00:00
feat: adding cotnributors page.
This commit is contained in:
parent
d9fbcdb9fb
commit
49c3329526
7 changed files with 1095 additions and 7 deletions
|
|
@ -89,6 +89,20 @@ abstract class GenerateRuntimeConfigsTask : DefaultTask() {
|
|||
""".trimMargin()
|
||||
)
|
||||
}
|
||||
|
||||
outDir.resolve("com/nuvio/app/features/settings").apply {
|
||||
mkdirs()
|
||||
resolve("CommunityConfig.kt").writeText(
|
||||
"""
|
||||
|package com.nuvio.app.features.settings
|
||||
|
|
||||
|object CommunityConfig {
|
||||
| const val DONATIONS_BASE_URL = "${props.getProperty("DONATIONS_BASE_URL", "")}"
|
||||
| const val DONATIONS_DONATE_URL = "${props.getProperty("DONATIONS_DONATE_URL", "")}"
|
||||
|}
|
||||
""".trimMargin()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -134,6 +134,7 @@ import com.nuvio.app.features.settings.ContinueWatchingSettingsScreen
|
|||
import com.nuvio.app.features.settings.AddonsSettingsScreen
|
||||
import com.nuvio.app.features.settings.PluginsSettingsScreen
|
||||
import com.nuvio.app.features.settings.AccountSettingsScreen
|
||||
import com.nuvio.app.features.settings.SupportersContributorsSettingsScreen
|
||||
import com.nuvio.app.features.settings.ThemeSettingsRepository
|
||||
import com.nuvio.app.features.collection.CollectionManagementScreen
|
||||
import com.nuvio.app.features.collection.CollectionEditorScreen
|
||||
|
|
@ -215,6 +216,9 @@ object PluginsSettingsRoute
|
|||
@Serializable
|
||||
object AccountSettingsRoute
|
||||
|
||||
@Serializable
|
||||
object SupportersContributorsSettingsRoute
|
||||
|
||||
@Serializable
|
||||
object CollectionsRoute
|
||||
|
||||
|
|
@ -953,6 +957,9 @@ private fun MainAppContent(
|
|||
}
|
||||
},
|
||||
onAccountSettingsClick = { navController.navigate(AccountSettingsRoute) },
|
||||
onSupportersContributorsSettingsClick = {
|
||||
navController.navigate(SupportersContributorsSettingsRoute)
|
||||
},
|
||||
onCollectionsSettingsClick = { navController.navigate(CollectionsRoute) },
|
||||
onFolderClick = { collectionId, folderId ->
|
||||
navController.navigate(FolderDetailRoute(collectionId = collectionId, folderId = folderId))
|
||||
|
|
@ -1558,6 +1565,15 @@ private fun MainAppContent(
|
|||
onBack = onBack,
|
||||
)
|
||||
}
|
||||
composable<SupportersContributorsSettingsRoute> { backStackEntry ->
|
||||
val onBack = rememberGuardedPopBackStack(
|
||||
navController = navController,
|
||||
backStackEntry = backStackEntry,
|
||||
)
|
||||
SupportersContributorsSettingsScreen(
|
||||
onBack = onBack,
|
||||
)
|
||||
}
|
||||
composable<CollectionsRoute> { backStackEntry ->
|
||||
val onBack = rememberGuardedPopBackStack(
|
||||
navController = navController,
|
||||
|
|
@ -1823,6 +1839,7 @@ private fun AppTabHost(
|
|||
onAddonsSettingsClick: () -> Unit = {},
|
||||
onPluginsSettingsClick: () -> Unit = {},
|
||||
onAccountSettingsClick: () -> Unit = {},
|
||||
onSupportersContributorsSettingsClick: () -> Unit = {},
|
||||
onCollectionsSettingsClick: () -> Unit = {},
|
||||
onFolderClick: ((collectionId: String, folderId: String) -> Unit)? = null,
|
||||
onInitialHomeContentRendered: () -> Unit = {},
|
||||
|
|
@ -1872,6 +1889,7 @@ private fun AppTabHost(
|
|||
onAddonsClick = onAddonsSettingsClick,
|
||||
onPluginsClick = onPluginsSettingsClick,
|
||||
onAccountClick = onAccountSettingsClick,
|
||||
onSupportersContributorsClick = onSupportersContributorsSettingsClick,
|
||||
onCollectionsClick = onCollectionsSettingsClick,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,9 @@ internal fun LazyListScope.accountSettingsContent(
|
|||
}
|
||||
|
||||
@Composable
|
||||
private fun AccountSettingsBody(isTablet: Boolean) {
|
||||
private fun AccountSettingsBody(
|
||||
isTablet: Boolean,
|
||||
) {
|
||||
val authState by AuthRepository.state.collectAsStateWithLifecycle()
|
||||
val scope = rememberCoroutineScope()
|
||||
var showDeleteConfirm by remember { mutableStateOf(false) }
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.nuvio.app.features.settings
|
|||
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.rounded.AccountCircle
|
||||
import androidx.compose.material.icons.rounded.Info
|
||||
import androidx.compose.material.icons.rounded.Notifications
|
||||
import androidx.compose.material.icons.rounded.Settings
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
|
|
@ -12,6 +13,7 @@ internal enum class SettingsCategory(
|
|||
) {
|
||||
Account("Account", Icons.Rounded.AccountCircle),
|
||||
General("General", Icons.Rounded.Settings),
|
||||
About("About", Icons.Rounded.Info),
|
||||
}
|
||||
|
||||
internal enum class SettingsPage(
|
||||
|
|
@ -29,6 +31,11 @@ internal enum class SettingsPage(
|
|||
category = SettingsCategory.Account,
|
||||
parentPage = Root,
|
||||
),
|
||||
SupportersContributors(
|
||||
title = "Supporters & Contributors",
|
||||
category = SettingsCategory.About,
|
||||
parentPage = Root,
|
||||
),
|
||||
Playback(
|
||||
title = "Playback",
|
||||
category = SettingsCategory.General,
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import androidx.compose.material.icons.Icons
|
|||
import androidx.compose.material.icons.rounded.AccountCircle
|
||||
import androidx.compose.material.icons.rounded.CloudDownload
|
||||
import androidx.compose.material.icons.rounded.Extension
|
||||
import androidx.compose.material.icons.rounded.Favorite
|
||||
import androidx.compose.material.icons.rounded.Info
|
||||
import androidx.compose.material.icons.rounded.Link
|
||||
import androidx.compose.material.icons.rounded.Notifications
|
||||
import androidx.compose.material.icons.rounded.Palette
|
||||
|
|
@ -27,11 +29,13 @@ internal fun LazyListScope.settingsRootContent(
|
|||
onContentDiscoveryClick: () -> Unit,
|
||||
onIntegrationsClick: () -> Unit,
|
||||
onTraktClick: () -> Unit,
|
||||
onSupportersContributorsClick: () -> Unit,
|
||||
onDownloadsClick: () -> Unit,
|
||||
onAccountClick: () -> Unit,
|
||||
onSwitchProfileClick: (() -> Unit)? = null,
|
||||
showAccountSection: Boolean = true,
|
||||
showGeneralSection: Boolean = true,
|
||||
showAboutSection: Boolean = true,
|
||||
) {
|
||||
if (showAccountSection) {
|
||||
item {
|
||||
|
|
@ -127,15 +131,44 @@ internal fun LazyListScope.settingsRootContent(
|
|||
}
|
||||
}
|
||||
}
|
||||
if (showAboutSection) {
|
||||
item {
|
||||
SettingsSection(
|
||||
title = "ABOUT",
|
||||
isTablet = isTablet,
|
||||
) {
|
||||
SettingsGroup(isTablet = isTablet) {
|
||||
SettingsNavigationRow(
|
||||
title = "Supporters & Contributors",
|
||||
description = "See cross-app contributors and the supporters backing Nuvio.",
|
||||
icon = Icons.Rounded.Favorite,
|
||||
isTablet = isTablet,
|
||||
onClick = onSupportersContributorsClick,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
item {
|
||||
Text(
|
||||
text = "Version ${AppVersionConfig.VERSION_NAME} (${AppVersionConfig.VERSION_CODE})",
|
||||
androidx.compose.foundation.layout.Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 20.dp, vertical = if (isTablet) 20.dp else 16.dp),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
textAlign = TextAlign.Center,
|
||||
)
|
||||
) {
|
||||
Text(
|
||||
text = "Made with ❤️ by Tapframe and friends",
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
textAlign = TextAlign.Center,
|
||||
)
|
||||
Text(
|
||||
text = "Version ${AppVersionConfig.VERSION_NAME} (${AppVersionConfig.VERSION_CODE})",
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
textAlign = TextAlign.Center,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ fun SettingsScreen(
|
|||
onPluginsClick: () -> Unit = {},
|
||||
onDownloadsClick: () -> Unit = {},
|
||||
onAccountClick: () -> Unit = {},
|
||||
onSupportersContributorsClick: () -> Unit = {},
|
||||
onCollectionsClick: () -> Unit = {},
|
||||
) {
|
||||
BoxWithConstraints(
|
||||
|
|
@ -188,6 +189,7 @@ fun SettingsScreen(
|
|||
posterCardStyleUiState = posterCardStyleUiState,
|
||||
onSwitchProfile = onSwitchProfile,
|
||||
onDownloadsClick = onDownloadsClick,
|
||||
onSupportersContributorsClick = onSupportersContributorsClick,
|
||||
onCollectionsClick = onCollectionsClick,
|
||||
)
|
||||
} else {
|
||||
|
|
@ -230,6 +232,7 @@ fun SettingsScreen(
|
|||
onPluginsClick = onPluginsClick,
|
||||
onDownloadsClick = onDownloadsClick,
|
||||
onAccountClick = onAccountClick,
|
||||
onSupportersContributorsClick = onSupportersContributorsClick,
|
||||
onCollectionsClick = onCollectionsClick,
|
||||
)
|
||||
}
|
||||
|
|
@ -276,6 +279,7 @@ private fun MobileSettingsScreen(
|
|||
onPluginsClick: () -> Unit = {},
|
||||
onDownloadsClick: () -> Unit = {},
|
||||
onAccountClick: () -> Unit = {},
|
||||
onSupportersContributorsClick: () -> Unit = {},
|
||||
onCollectionsClick: () -> Unit = {},
|
||||
) {
|
||||
NuvioScreen {
|
||||
|
|
@ -296,6 +300,7 @@ private fun MobileSettingsScreen(
|
|||
onContentDiscoveryClick = { onPageChange(SettingsPage.ContentDiscovery) },
|
||||
onIntegrationsClick = { onPageChange(SettingsPage.Integrations) },
|
||||
onTraktClick = { onPageChange(SettingsPage.TraktAuthentication) },
|
||||
onSupportersContributorsClick = onSupportersContributorsClick,
|
||||
onDownloadsClick = onDownloadsClick,
|
||||
onAccountClick = onAccountClick,
|
||||
onSwitchProfileClick = onSwitchProfile,
|
||||
|
|
@ -303,6 +308,9 @@ private fun MobileSettingsScreen(
|
|||
SettingsPage.Account -> accountSettingsContent(
|
||||
isTablet = false,
|
||||
)
|
||||
SettingsPage.SupportersContributors -> supportersContributorsContent(
|
||||
isTablet = false,
|
||||
)
|
||||
SettingsPage.Playback -> playbackSettingsContent(
|
||||
isTablet = false,
|
||||
showLoadingOverlay = showLoadingOverlay,
|
||||
|
|
@ -421,6 +429,7 @@ private fun TabletSettingsScreen(
|
|||
posterCardStyleUiState: PosterCardStyleUiState,
|
||||
onSwitchProfile: (() -> Unit)? = null,
|
||||
onDownloadsClick: () -> Unit = {},
|
||||
onSupportersContributorsClick: () -> Unit = {},
|
||||
onCollectionsClick: () -> Unit = {},
|
||||
) {
|
||||
var selectedCategory by rememberSaveable { mutableStateOf(SettingsCategory.General.name) }
|
||||
|
|
@ -508,15 +517,20 @@ private fun TabletSettingsScreen(
|
|||
onContentDiscoveryClick = { openInlinePage(SettingsPage.ContentDiscovery) },
|
||||
onIntegrationsClick = { openInlinePage(SettingsPage.Integrations) },
|
||||
onTraktClick = { openInlinePage(SettingsPage.TraktAuthentication) },
|
||||
onSupportersContributorsClick = { openInlinePage(SettingsPage.SupportersContributors) },
|
||||
onDownloadsClick = onDownloadsClick,
|
||||
onAccountClick = { openInlinePage(SettingsPage.Account) },
|
||||
onSwitchProfileClick = onSwitchProfile,
|
||||
showAccountSection = activeCategory == SettingsCategory.Account,
|
||||
showGeneralSection = activeCategory == SettingsCategory.General,
|
||||
showAboutSection = activeCategory == SettingsCategory.About,
|
||||
)
|
||||
SettingsPage.Account -> accountSettingsContent(
|
||||
isTablet = true,
|
||||
)
|
||||
SettingsPage.SupportersContributors -> supportersContributorsContent(
|
||||
isTablet = true,
|
||||
)
|
||||
SettingsPage.Playback -> playbackSettingsContent(
|
||||
isTablet = true,
|
||||
showLoadingOverlay = showLoadingOverlay,
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue