[skip ci]: Adding a check for LKM mode to the KPM info card
This commit is contained in:
@@ -20,6 +20,8 @@ import androidx.navigation.compose.rememberNavController
|
|||||||
import com.ramcosta.composedestinations.DestinationsNavHost
|
import com.ramcosta.composedestinations.DestinationsNavHost
|
||||||
import com.ramcosta.composedestinations.animations.NavHostAnimatedDestinationStyle
|
import com.ramcosta.composedestinations.animations.NavHostAnimatedDestinationStyle
|
||||||
import com.ramcosta.composedestinations.generated.NavGraphs
|
import com.ramcosta.composedestinations.generated.NavGraphs
|
||||||
|
import com.ramcosta.composedestinations.spec.NavHostGraphSpec
|
||||||
|
import com.ramcosta.composedestinations.spec.RouteOrDirection
|
||||||
import com.ramcosta.composedestinations.utils.isRouteOnBackStackAsState
|
import com.ramcosta.composedestinations.utils.isRouteOnBackStackAsState
|
||||||
import com.ramcosta.composedestinations.utils.rememberDestinationsNavigator
|
import com.ramcosta.composedestinations.utils.rememberDestinationsNavigator
|
||||||
import io.zako.zako.UltraToolInstall
|
import io.zako.zako.UltraToolInstall
|
||||||
@@ -65,7 +67,7 @@ class MainActivity : ComponentActivity() {
|
|||||||
) {
|
) {
|
||||||
DestinationsNavHost(
|
DestinationsNavHost(
|
||||||
modifier = Modifier.padding(innerPadding),
|
modifier = Modifier.padding(innerPadding),
|
||||||
navGraph = NavGraphs.root,
|
navGraph = NavGraphs.root as NavHostGraphSpec,
|
||||||
navController = navController,
|
navController = navController,
|
||||||
defaultTransitions = object : NavHostAnimatedDestinationStyle() {
|
defaultTransitions = object : NavHostAnimatedDestinationStyle() {
|
||||||
override val enterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition
|
override val enterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition
|
||||||
@@ -112,7 +114,7 @@ private fun BottomBar(navController: NavHostController) {
|
|||||||
navigator.popBackStack(destination.direction, false)
|
navigator.popBackStack(destination.direction, false)
|
||||||
}
|
}
|
||||||
navigator.navigate(destination.direction) {
|
navigator.navigate(destination.direction) {
|
||||||
popUpTo(NavGraphs.root) {
|
popUpTo(NavGraphs.root as RouteOrDirection) {
|
||||||
saveState = true
|
saveState = true
|
||||||
}
|
}
|
||||||
launchSingleTop = true
|
launchSingleTop = true
|
||||||
@@ -128,7 +130,7 @@ private fun BottomBar(navController: NavHostController) {
|
|||||||
},
|
},
|
||||||
label = { Text(stringResource(destination.label)) },
|
label = { Text(stringResource(destination.label)) },
|
||||||
alwaysShowLabel = false,
|
alwaysShowLabel = false,
|
||||||
colors = androidx.compose.material3.NavigationBarItemDefaults.colors(
|
colors = NavigationBarItemDefaults.colors(
|
||||||
unselectedTextColor = MaterialTheme.colorScheme.onSurfaceVariant
|
unselectedTextColor = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -143,7 +145,7 @@ private fun BottomBar(navController: NavHostController) {
|
|||||||
navigator.popBackStack(destination.direction, false)
|
navigator.popBackStack(destination.direction, false)
|
||||||
}
|
}
|
||||||
navigator.navigate(destination.direction) {
|
navigator.navigate(destination.direction) {
|
||||||
popUpTo(NavGraphs.root) {
|
popUpTo(NavGraphs.root as RouteOrDirection) {
|
||||||
saveState = true
|
saveState = true
|
||||||
}
|
}
|
||||||
launchSingleTop = true
|
launchSingleTop = true
|
||||||
|
|||||||
@@ -561,6 +561,7 @@ fun DonateCard() {
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun InfoCard() {
|
private fun InfoCard() {
|
||||||
|
val lkmMode = Natives.isLkmMode
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
val isSimpleMode = LocalContext.current.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
val isSimpleMode = LocalContext.current.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
||||||
.getBoolean("is_simple_mode", false)
|
.getBoolean("is_simple_mode", false)
|
||||||
@@ -617,6 +618,7 @@ private fun InfoCard() {
|
|||||||
|
|
||||||
|
|
||||||
if (!isSimpleMode) {
|
if (!isSimpleMode) {
|
||||||
|
if (lkmMode != true) {
|
||||||
val kpmVersion = getKpmVersion()
|
val kpmVersion = getKpmVersion()
|
||||||
var displayVersion: String
|
var displayVersion: String
|
||||||
val isKpmConfigured = checkKpmConfigured()
|
val isKpmConfigured = checkKpmConfigured()
|
||||||
@@ -634,6 +636,7 @@ private fun InfoCard() {
|
|||||||
Spacer(Modifier.height(16.dp))
|
Spacer(Modifier.height(16.dp))
|
||||||
InfoCardItem(stringResource(R.string.home_kpm_version), displayVersion)
|
InfoCardItem(stringResource(R.string.home_kpm_version), displayVersion)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val isHideSusfsStatus = LocalContext.current.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
val isHideSusfsStatus = LocalContext.current.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
||||||
.getBoolean("is_hide_susfs_status", false)
|
.getBoolean("is_hide_susfs_status", false)
|
||||||
|
|||||||
Reference in New Issue
Block a user