mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 10:11:52 +01:00
Remove top app bar scroll behavior
This lets us make it more consistent with the Compose screens for now. Maybe it'll return in the future. This also includes making the AboutController a full Compose controller with a new abstracted TopAppBar composable.
This commit is contained in:
parent
2096df301d
commit
80c7a45328
@ -7,15 +7,16 @@ import androidx.compose.runtime.Composable
|
|||||||
import androidx.compose.runtime.LaunchedEffect
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
|
import androidx.compose.ui.res.stringResource
|
||||||
import eu.kanade.presentation.category.components.CategoryContent
|
import eu.kanade.presentation.category.components.CategoryContent
|
||||||
import eu.kanade.presentation.category.components.CategoryCreateDialog
|
import eu.kanade.presentation.category.components.CategoryCreateDialog
|
||||||
import eu.kanade.presentation.category.components.CategoryDeleteDialog
|
import eu.kanade.presentation.category.components.CategoryDeleteDialog
|
||||||
import eu.kanade.presentation.category.components.CategoryFloatingActionButton
|
import eu.kanade.presentation.category.components.CategoryFloatingActionButton
|
||||||
import eu.kanade.presentation.category.components.CategoryRenameDialog
|
import eu.kanade.presentation.category.components.CategoryRenameDialog
|
||||||
import eu.kanade.presentation.category.components.CategoryTopAppBar
|
|
||||||
import eu.kanade.presentation.components.EmptyScreen
|
import eu.kanade.presentation.components.EmptyScreen
|
||||||
import eu.kanade.presentation.components.LoadingScreen
|
import eu.kanade.presentation.components.LoadingScreen
|
||||||
import eu.kanade.presentation.components.Scaffold
|
import eu.kanade.presentation.components.Scaffold
|
||||||
|
import eu.kanade.presentation.components.TopAppBar
|
||||||
import eu.kanade.presentation.util.horizontalPadding
|
import eu.kanade.presentation.util.horizontalPadding
|
||||||
import eu.kanade.presentation.util.plus
|
import eu.kanade.presentation.util.plus
|
||||||
import eu.kanade.presentation.util.topPaddingValues
|
import eu.kanade.presentation.util.topPaddingValues
|
||||||
@ -34,7 +35,8 @@ fun CategoryScreen(
|
|||||||
Scaffold(
|
Scaffold(
|
||||||
modifier = Modifier.statusBarsPadding(),
|
modifier = Modifier.statusBarsPadding(),
|
||||||
topBar = {
|
topBar = {
|
||||||
CategoryTopAppBar(
|
TopAppBar(
|
||||||
|
title = stringResource(R.string.action_edit_categories),
|
||||||
navigateUp = navigateUp,
|
navigateUp = navigateUp,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
package eu.kanade.presentation.category.components
|
|
||||||
|
|
||||||
import androidx.compose.material.icons.Icons
|
|
||||||
import androidx.compose.material.icons.filled.ArrowBack
|
|
||||||
import androidx.compose.material3.Icon
|
|
||||||
import androidx.compose.material3.IconButton
|
|
||||||
import androidx.compose.material3.SmallTopAppBar
|
|
||||||
import androidx.compose.material3.Text
|
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.compose.ui.res.stringResource
|
|
||||||
import eu.kanade.tachiyomi.R
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun CategoryTopAppBar(
|
|
||||||
navigateUp: () -> Unit,
|
|
||||||
) {
|
|
||||||
SmallTopAppBar(
|
|
||||||
navigationIcon = {
|
|
||||||
IconButton(onClick = navigateUp) {
|
|
||||||
Icon(
|
|
||||||
imageVector = Icons.Default.ArrowBack,
|
|
||||||
contentDescription = stringResource(R.string.abc_action_bar_up_description),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
title = {
|
|
||||||
Text(text = stringResource(R.string.action_edit_categories))
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
@ -1,12 +1,15 @@
|
|||||||
package eu.kanade.presentation.components
|
package eu.kanade.presentation.components
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
|
import androidx.compose.foundation.layout.RowScope
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.filled.ArrowBack
|
||||||
import androidx.compose.material.icons.filled.MoreVert
|
import androidx.compose.material.icons.filled.MoreVert
|
||||||
import androidx.compose.material3.DropdownMenuItem
|
import androidx.compose.material3.DropdownMenuItem
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.material3.SmallTopAppBar
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
@ -19,6 +22,30 @@ import androidx.compose.ui.text.font.FontWeight
|
|||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import eu.kanade.tachiyomi.R
|
import eu.kanade.tachiyomi.R
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun TopAppBar(
|
||||||
|
title: String?,
|
||||||
|
subtitle: String? = null,
|
||||||
|
navigateUp: () -> Unit,
|
||||||
|
navigationIcon: ImageVector = Icons.Default.ArrowBack,
|
||||||
|
actions: @Composable RowScope.() -> Unit = {},
|
||||||
|
) {
|
||||||
|
SmallTopAppBar(
|
||||||
|
navigationIcon = {
|
||||||
|
IconButton(onClick = navigateUp) {
|
||||||
|
Icon(
|
||||||
|
imageVector = navigationIcon,
|
||||||
|
contentDescription = stringResource(R.string.abc_action_bar_up_description),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
title = {
|
||||||
|
AppBarTitle(title, subtitle)
|
||||||
|
},
|
||||||
|
actions = actions,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun AppBarTitle(
|
fun AppBarTitle(
|
||||||
title: String?,
|
title: String?,
|
||||||
|
@ -6,21 +6,23 @@ import androidx.compose.foundation.layout.WindowInsets
|
|||||||
import androidx.compose.foundation.layout.asPaddingValues
|
import androidx.compose.foundation.layout.asPaddingValues
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.navigationBars
|
import androidx.compose.foundation.layout.navigationBars
|
||||||
|
import androidx.compose.foundation.layout.statusBarsPadding
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.outlined.Public
|
import androidx.compose.material.icons.outlined.Public
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.vector.rememberVectorPainter
|
import androidx.compose.ui.graphics.vector.rememberVectorPainter
|
||||||
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
|
|
||||||
import androidx.compose.ui.input.nestedscroll.nestedScroll
|
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.platform.LocalUriHandler
|
import androidx.compose.ui.platform.LocalUriHandler
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import eu.kanade.presentation.components.LinkIcon
|
import eu.kanade.presentation.components.LinkIcon
|
||||||
import eu.kanade.presentation.components.PreferenceRow
|
import eu.kanade.presentation.components.PreferenceRow
|
||||||
|
import eu.kanade.presentation.components.Scaffold
|
||||||
import eu.kanade.presentation.components.ScrollbarLazyColumn
|
import eu.kanade.presentation.components.ScrollbarLazyColumn
|
||||||
|
import eu.kanade.presentation.components.TopAppBar
|
||||||
import eu.kanade.presentation.more.LogoHeader
|
import eu.kanade.presentation.more.LogoHeader
|
||||||
|
import eu.kanade.presentation.util.plus
|
||||||
import eu.kanade.tachiyomi.BuildConfig
|
import eu.kanade.tachiyomi.BuildConfig
|
||||||
import eu.kanade.tachiyomi.R
|
import eu.kanade.tachiyomi.R
|
||||||
import eu.kanade.tachiyomi.data.updater.RELEASE_URL
|
import eu.kanade.tachiyomi.data.updater.RELEASE_URL
|
||||||
@ -29,7 +31,7 @@ import eu.kanade.tachiyomi.util.system.copyToClipboard
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun AboutScreen(
|
fun AboutScreen(
|
||||||
nestedScrollInterop: NestedScrollConnection,
|
navigateUp: () -> Unit,
|
||||||
checkVersion: () -> Unit,
|
checkVersion: () -> Unit,
|
||||||
getFormattedBuildTime: () -> String,
|
getFormattedBuildTime: () -> String,
|
||||||
onClickLicenses: () -> Unit,
|
onClickLicenses: () -> Unit,
|
||||||
@ -37,108 +39,117 @@ fun AboutScreen(
|
|||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
val uriHandler = LocalUriHandler.current
|
val uriHandler = LocalUriHandler.current
|
||||||
|
|
||||||
ScrollbarLazyColumn(
|
Scaffold(
|
||||||
modifier = Modifier.nestedScroll(nestedScrollInterop),
|
modifier = Modifier.statusBarsPadding(),
|
||||||
contentPadding = WindowInsets.navigationBars.asPaddingValues(),
|
topBar = {
|
||||||
) {
|
TopAppBar(
|
||||||
item {
|
title = stringResource(R.string.pref_category_about),
|
||||||
LogoHeader()
|
navigateUp = navigateUp,
|
||||||
}
|
|
||||||
|
|
||||||
item {
|
|
||||||
PreferenceRow(
|
|
||||||
title = stringResource(R.string.version),
|
|
||||||
subtitle = when {
|
|
||||||
BuildConfig.DEBUG -> {
|
|
||||||
"Debug ${BuildConfig.COMMIT_SHA} (${getFormattedBuildTime()})"
|
|
||||||
}
|
|
||||||
BuildConfig.PREVIEW -> {
|
|
||||||
"Preview r${BuildConfig.COMMIT_COUNT} (${BuildConfig.COMMIT_SHA}, ${getFormattedBuildTime()})"
|
|
||||||
}
|
|
||||||
else -> {
|
|
||||||
"Stable ${BuildConfig.VERSION_NAME} (${getFormattedBuildTime()})"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onClick = {
|
|
||||||
val deviceInfo = CrashLogUtil(context).getDebugInfo()
|
|
||||||
context.copyToClipboard("Debug information", deviceInfo)
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
}
|
},
|
||||||
|
) { paddingValues ->
|
||||||
|
ScrollbarLazyColumn(
|
||||||
|
contentPadding = paddingValues + WindowInsets.navigationBars.asPaddingValues(),
|
||||||
|
) {
|
||||||
|
item {
|
||||||
|
LogoHeader()
|
||||||
|
}
|
||||||
|
|
||||||
if (BuildConfig.INCLUDE_UPDATER) {
|
|
||||||
item {
|
item {
|
||||||
PreferenceRow(
|
PreferenceRow(
|
||||||
title = stringResource(R.string.check_for_updates),
|
title = stringResource(R.string.version),
|
||||||
onClick = checkVersion,
|
subtitle = when {
|
||||||
|
BuildConfig.DEBUG -> {
|
||||||
|
"Debug ${BuildConfig.COMMIT_SHA} (${getFormattedBuildTime()})"
|
||||||
|
}
|
||||||
|
BuildConfig.PREVIEW -> {
|
||||||
|
"Preview r${BuildConfig.COMMIT_COUNT} (${BuildConfig.COMMIT_SHA}, ${getFormattedBuildTime()})"
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
"Stable ${BuildConfig.VERSION_NAME} (${getFormattedBuildTime()})"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onClick = {
|
||||||
|
val deviceInfo = CrashLogUtil(context).getDebugInfo()
|
||||||
|
context.copyToClipboard("Debug information", deviceInfo)
|
||||||
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (!BuildConfig.DEBUG) {
|
if (BuildConfig.INCLUDE_UPDATER) {
|
||||||
|
item {
|
||||||
|
PreferenceRow(
|
||||||
|
title = stringResource(R.string.check_for_updates),
|
||||||
|
onClick = checkVersion,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!BuildConfig.DEBUG) {
|
||||||
|
item {
|
||||||
|
PreferenceRow(
|
||||||
|
title = stringResource(R.string.whats_new),
|
||||||
|
onClick = { uriHandler.openUri(RELEASE_URL) },
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
item {
|
item {
|
||||||
PreferenceRow(
|
PreferenceRow(
|
||||||
title = stringResource(R.string.whats_new),
|
title = stringResource(R.string.help_translate),
|
||||||
onClick = { uriHandler.openUri(RELEASE_URL) },
|
onClick = { uriHandler.openUri("https://tachiyomi.org/help/contribution/#translation") },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
item {
|
item {
|
||||||
PreferenceRow(
|
PreferenceRow(
|
||||||
title = stringResource(R.string.help_translate),
|
title = stringResource(R.string.licenses),
|
||||||
onClick = { uriHandler.openUri("https://tachiyomi.org/help/contribution/#translation") },
|
onClick = onClickLicenses,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
item {
|
item {
|
||||||
PreferenceRow(
|
PreferenceRow(
|
||||||
title = stringResource(R.string.licenses),
|
title = stringResource(R.string.privacy_policy),
|
||||||
onClick = onClickLicenses,
|
onClick = { uriHandler.openUri("https://tachiyomi.org/privacy") },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
item {
|
item {
|
||||||
PreferenceRow(
|
Row(
|
||||||
title = stringResource(R.string.privacy_policy),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
onClick = { uriHandler.openUri("https://tachiyomi.org/privacy") },
|
horizontalArrangement = Arrangement.Center,
|
||||||
)
|
) {
|
||||||
}
|
LinkIcon(
|
||||||
|
label = stringResource(R.string.website),
|
||||||
item {
|
painter = rememberVectorPainter(Icons.Outlined.Public),
|
||||||
Row(
|
url = "https://tachiyomi.org",
|
||||||
modifier = Modifier.fillMaxWidth(),
|
)
|
||||||
horizontalArrangement = Arrangement.Center,
|
LinkIcon(
|
||||||
) {
|
label = "Discord",
|
||||||
LinkIcon(
|
painter = painterResource(R.drawable.ic_discord_24dp),
|
||||||
label = stringResource(R.string.website),
|
url = "https://discord.gg/tachiyomi",
|
||||||
painter = rememberVectorPainter(Icons.Outlined.Public),
|
)
|
||||||
url = "https://tachiyomi.org",
|
LinkIcon(
|
||||||
)
|
label = "Twitter",
|
||||||
LinkIcon(
|
painter = painterResource(R.drawable.ic_twitter_24dp),
|
||||||
label = "Discord",
|
url = "https://twitter.com/tachiyomiorg",
|
||||||
painter = painterResource(R.drawable.ic_discord_24dp),
|
)
|
||||||
url = "https://discord.gg/tachiyomi",
|
LinkIcon(
|
||||||
)
|
label = "Facebook",
|
||||||
LinkIcon(
|
painter = painterResource(R.drawable.ic_facebook_24dp),
|
||||||
label = "Twitter",
|
url = "https://facebook.com/tachiyomiorg",
|
||||||
painter = painterResource(R.drawable.ic_twitter_24dp),
|
)
|
||||||
url = "https://twitter.com/tachiyomiorg",
|
LinkIcon(
|
||||||
)
|
label = "Reddit",
|
||||||
LinkIcon(
|
painter = painterResource(R.drawable.ic_reddit_24dp),
|
||||||
label = "Facebook",
|
url = "https://www.reddit.com/r/Tachiyomi",
|
||||||
painter = painterResource(R.drawable.ic_facebook_24dp),
|
)
|
||||||
url = "https://facebook.com/tachiyomiorg",
|
LinkIcon(
|
||||||
)
|
label = "GitHub",
|
||||||
LinkIcon(
|
painter = painterResource(R.drawable.ic_github_24dp),
|
||||||
label = "Reddit",
|
url = "https://github.com/tachiyomiorg",
|
||||||
painter = painterResource(R.drawable.ic_reddit_24dp),
|
)
|
||||||
url = "https://www.reddit.com/r/Tachiyomi",
|
}
|
||||||
)
|
|
||||||
LinkIcon(
|
|
||||||
label = "GitHub",
|
|
||||||
painter = painterResource(R.drawable.ic_github_24dp),
|
|
||||||
url = "https://github.com/tachiyomiorg",
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,7 @@ import androidx.compose.material.icons.Icons
|
|||||||
import androidx.compose.material.icons.filled.ArrowBack
|
import androidx.compose.material.icons.filled.ArrowBack
|
||||||
import androidx.compose.material.icons.filled.ArrowForward
|
import androidx.compose.material.icons.filled.ArrowForward
|
||||||
import androidx.compose.material.icons.filled.Close
|
import androidx.compose.material.icons.filled.Close
|
||||||
import androidx.compose.material3.Icon
|
|
||||||
import androidx.compose.material3.IconButton
|
|
||||||
import androidx.compose.material3.LinearProgressIndicator
|
import androidx.compose.material3.LinearProgressIndicator
|
||||||
import androidx.compose.material3.SmallTopAppBar
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
@ -28,7 +25,7 @@ import com.google.accompanist.web.rememberWebViewNavigator
|
|||||||
import com.google.accompanist.web.rememberWebViewState
|
import com.google.accompanist.web.rememberWebViewState
|
||||||
import eu.kanade.presentation.components.AppBar
|
import eu.kanade.presentation.components.AppBar
|
||||||
import eu.kanade.presentation.components.AppBarActions
|
import eu.kanade.presentation.components.AppBarActions
|
||||||
import eu.kanade.presentation.components.AppBarTitle
|
import eu.kanade.presentation.components.TopAppBar
|
||||||
import eu.kanade.tachiyomi.BuildConfig
|
import eu.kanade.tachiyomi.BuildConfig
|
||||||
import eu.kanade.tachiyomi.R
|
import eu.kanade.tachiyomi.R
|
||||||
import eu.kanade.tachiyomi.util.system.setDefaultSettings
|
import eu.kanade.tachiyomi.util.system.setDefaultSettings
|
||||||
@ -48,21 +45,11 @@ fun WebViewScreen(
|
|||||||
val navigator = rememberWebViewNavigator()
|
val navigator = rememberWebViewNavigator()
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
SmallTopAppBar(
|
TopAppBar(
|
||||||
title = {
|
title = state.pageTitle ?: initialTitle,
|
||||||
AppBarTitle(
|
subtitle = state.content.getCurrentUrl(),
|
||||||
title = state.pageTitle ?: initialTitle,
|
navigateUp = onUp,
|
||||||
subtitle = state.content.getCurrentUrl(),
|
navigationIcon = Icons.Default.Close,
|
||||||
)
|
|
||||||
},
|
|
||||||
navigationIcon = {
|
|
||||||
IconButton(onClick = onUp) {
|
|
||||||
Icon(
|
|
||||||
imageVector = Icons.Default.Close,
|
|
||||||
contentDescription = stringResource(R.string.action_close),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
actions = {
|
actions = {
|
||||||
AppBarActions(
|
AppBarActions(
|
||||||
listOf(
|
listOf(
|
||||||
|
@ -73,6 +73,27 @@ abstract class BasicComposeController :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Basic Compose controller without a presenter.
|
||||||
|
*/
|
||||||
|
abstract class BasicFullComposeController :
|
||||||
|
BaseController<ComposeControllerBinding>(),
|
||||||
|
FullComposeContentController {
|
||||||
|
|
||||||
|
override fun createBinding(inflater: LayoutInflater) =
|
||||||
|
ComposeControllerBinding.inflate(inflater)
|
||||||
|
|
||||||
|
override fun onViewCreated(view: View) {
|
||||||
|
super.onViewCreated(view)
|
||||||
|
|
||||||
|
binding.root.apply {
|
||||||
|
setComposeContent {
|
||||||
|
ComposeContent()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
abstract class SearchableComposeController<P : BasePresenter<*>>(bundle: Bundle? = null) :
|
abstract class SearchableComposeController<P : BasePresenter<*>>(bundle: Bundle? = null) :
|
||||||
SearchableNucleusController<ComposeControllerBinding, P>(bundle),
|
SearchableNucleusController<ComposeControllerBinding, P>(bundle),
|
||||||
ComposeContentController {
|
ComposeContentController {
|
||||||
|
@ -43,7 +43,7 @@ import eu.kanade.tachiyomi.extension.api.ExtensionGithubApi
|
|||||||
import eu.kanade.tachiyomi.ui.base.activity.BaseActivity
|
import eu.kanade.tachiyomi.ui.base.activity.BaseActivity
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.DialogController
|
import eu.kanade.tachiyomi.ui.base.controller.DialogController
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.FabController
|
import eu.kanade.tachiyomi.ui.base.controller.FabController
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.FullComposeController
|
import eu.kanade.tachiyomi.ui.base.controller.FullComposeContentController
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.NoAppBarElevationController
|
import eu.kanade.tachiyomi.ui.base.controller.NoAppBarElevationController
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.RootController
|
import eu.kanade.tachiyomi.ui.base.controller.RootController
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.TabbedController
|
import eu.kanade.tachiyomi.ui.base.controller.TabbedController
|
||||||
@ -606,7 +606,7 @@ class MainActivity : BaseActivity() {
|
|||||||
binding.fabLayout.rootFab.hide()
|
binding.fabLayout.rootFab.hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
val isFullComposeController = internalTo is FullComposeController<*>
|
val isFullComposeController = internalTo is FullComposeContentController
|
||||||
binding.appbar.isVisible = !isFullComposeController
|
binding.appbar.isVisible = !isFullComposeController
|
||||||
binding.controllerContainer.enableScrollingBehavior(!isFullComposeController)
|
binding.controllerContainer.enableScrollingBehavior(!isFullComposeController)
|
||||||
|
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
package eu.kanade.tachiyomi.ui.more
|
package eu.kanade.tachiyomi.ui.more
|
||||||
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
|
|
||||||
import eu.kanade.presentation.more.about.AboutScreen
|
import eu.kanade.presentation.more.about.AboutScreen
|
||||||
import eu.kanade.tachiyomi.BuildConfig
|
import eu.kanade.tachiyomi.BuildConfig
|
||||||
import eu.kanade.tachiyomi.R
|
import eu.kanade.tachiyomi.R
|
||||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||||
import eu.kanade.tachiyomi.data.updater.AppUpdateChecker
|
import eu.kanade.tachiyomi.data.updater.AppUpdateChecker
|
||||||
import eu.kanade.tachiyomi.data.updater.AppUpdateResult
|
import eu.kanade.tachiyomi.data.updater.AppUpdateResult
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.BasicComposeController
|
import eu.kanade.tachiyomi.ui.base.controller.BasicFullComposeController
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.NoAppBarElevationController
|
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.pushController
|
import eu.kanade.tachiyomi.ui.base.controller.pushController
|
||||||
import eu.kanade.tachiyomi.util.lang.launchNow
|
import eu.kanade.tachiyomi.util.lang.launchNow
|
||||||
import eu.kanade.tachiyomi.util.lang.toDateTimestampString
|
import eu.kanade.tachiyomi.util.lang.toDateTimestampString
|
||||||
@ -22,17 +20,15 @@ import java.text.SimpleDateFormat
|
|||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
import java.util.TimeZone
|
import java.util.TimeZone
|
||||||
|
|
||||||
class AboutController : BasicComposeController(), NoAppBarElevationController {
|
class AboutController : BasicFullComposeController() {
|
||||||
|
|
||||||
private val preferences: PreferencesHelper by injectLazy()
|
private val preferences: PreferencesHelper by injectLazy()
|
||||||
private val updateChecker by lazy { AppUpdateChecker() }
|
private val updateChecker by lazy { AppUpdateChecker() }
|
||||||
|
|
||||||
override fun getTitle() = resources?.getString(R.string.pref_category_about)
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
override fun ComposeContent(nestedScrollInterop: NestedScrollConnection) {
|
override fun ComposeContent() {
|
||||||
AboutScreen(
|
AboutScreen(
|
||||||
nestedScrollInterop = nestedScrollInterop,
|
navigateUp = router::popCurrentController,
|
||||||
checkVersion = this::checkVersion,
|
checkVersion = this::checkVersion,
|
||||||
getFormattedBuildTime = this::getFormattedBuildTime,
|
getFormattedBuildTime = this::getFormattedBuildTime,
|
||||||
onClickLicenses = { router.pushController(LicensesController()) },
|
onClickLicenses = { router.pushController(LicensesController()) },
|
||||||
|
@ -23,8 +23,7 @@
|
|||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?attr/actionBarSize"
|
android:layout_height="?attr/actionBarSize"
|
||||||
android:theme="?attr/actionBarTheme"
|
android:theme="?attr/actionBarTheme" />
|
||||||
app:layout_scrollFlags="scroll|enterAlways|snap" />
|
|
||||||
|
|
||||||
<com.google.android.material.tabs.TabLayout
|
<com.google.android.material.tabs.TabLayout
|
||||||
android:id="@+id/tabs"
|
android:id="@+id/tabs"
|
||||||
|
Loading…
Reference in New Issue
Block a user