mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-05-01 22:34:25 +02:00
feat: hide unfinished pages in release mode
This commit is contained in:
parent
8f5449527d
commit
f5b3b29d6d
@ -22,10 +22,12 @@ import androidx.compose.runtime.mutableStateOf
|
|||||||
import androidx.compose.runtime.saveable.rememberSaveable
|
import androidx.compose.runtime.saveable.rememberSaveable
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import app.revanced.manager.R
|
import app.revanced.manager.R
|
||||||
import app.revanced.manager.ui.component.TextInputDialog
|
import app.revanced.manager.ui.component.TextInputDialog
|
||||||
|
import app.revanced.manager.util.isDebuggable
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun BaseBundleDialog(
|
fun BaseBundleDialog(
|
||||||
@ -159,21 +161,19 @@ fun BaseBundleDialog(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val patchesClickable = LocalContext.current.isDebuggable && patchCount > 0
|
||||||
BundleListItem(
|
BundleListItem(
|
||||||
headlineText = stringResource(R.string.patches),
|
headlineText = stringResource(R.string.patches),
|
||||||
supportingText = if (patchCount == 0) stringResource(R.string.no_patches)
|
supportingText = if (patchCount == 0) stringResource(R.string.no_patches)
|
||||||
else stringResource(R.string.patches_available, patchCount),
|
else stringResource(R.string.patches_available, patchCount),
|
||||||
modifier = Modifier.clickable(enabled = patchCount > 0) {
|
modifier = Modifier.clickable(enabled = patchesClickable, onClick = onPatchesClick)
|
||||||
onPatchesClick()
|
|
||||||
}
|
|
||||||
) {
|
) {
|
||||||
if (patchCount > 0) {
|
if (patchesClickable)
|
||||||
Icon(
|
Icon(
|
||||||
Icons.Outlined.ArrowRight,
|
Icons.Outlined.ArrowRight,
|
||||||
stringResource(R.string.patches)
|
stringResource(R.string.patches)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
version?.let {
|
version?.let {
|
||||||
BundleListItem(
|
BundleListItem(
|
||||||
|
@ -24,6 +24,7 @@ import app.revanced.manager.BuildConfig
|
|||||||
import app.revanced.manager.R
|
import app.revanced.manager.R
|
||||||
import app.revanced.manager.ui.component.AppTopBar
|
import app.revanced.manager.ui.component.AppTopBar
|
||||||
import app.revanced.manager.ui.destination.SettingsDestination
|
import app.revanced.manager.ui.destination.SettingsDestination
|
||||||
|
import app.revanced.manager.util.isDebuggable
|
||||||
import app.revanced.manager.util.openUrl
|
import app.revanced.manager.util.openUrl
|
||||||
import com.google.accompanist.drawablepainter.rememberDrawablePainter
|
import com.google.accompanist.drawablepainter.rememberDrawablePainter
|
||||||
import dev.olshevski.navigation.reimagined.NavController
|
import dev.olshevski.navigation.reimagined.NavController
|
||||||
@ -57,15 +58,15 @@ fun AboutSettingsScreen(
|
|||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
val listItems = listOf(
|
val listItems = listOfNotNull(
|
||||||
Triple(stringResource(R.string.submit_feedback), stringResource(R.string.submit_feedback_description),
|
Triple(stringResource(R.string.submit_feedback), stringResource(R.string.submit_feedback_description),
|
||||||
third = {
|
third = {
|
||||||
context.openUrl("https://github.com/ReVanced/revanced-manager/issues/new/choose")
|
context.openUrl("https://github.com/ReVanced/revanced-manager/issues/new/choose")
|
||||||
}),
|
}),
|
||||||
Triple(stringResource(R.string.contributors), stringResource(R.string.contributors_description),
|
Triple(stringResource(R.string.contributors), stringResource(R.string.contributors_description),
|
||||||
third = onContributorsClick),
|
third = onContributorsClick).takeIf { context.isDebuggable },
|
||||||
Triple(stringResource(R.string.developer_options), stringResource(R.string.developer_options_description),
|
Triple(stringResource(R.string.developer_options), stringResource(R.string.developer_options_description),
|
||||||
third = { /*TODO*/ }),
|
third = { /*TODO*/ }).takeIf { context.isDebuggable },
|
||||||
Triple(stringResource(R.string.opensource_licenses), stringResource(R.string.opensource_licenses_description),
|
Triple(stringResource(R.string.opensource_licenses), stringResource(R.string.opensource_licenses_description),
|
||||||
third = onLicensesClick)
|
third = onLicensesClick)
|
||||||
)
|
)
|
||||||
|
@ -2,6 +2,7 @@ package app.revanced.manager.util
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import android.content.pm.ApplicationInfo
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
@ -22,6 +23,8 @@ import java.util.Locale
|
|||||||
typealias PatchesSelection = Map<Int, Set<String>>
|
typealias PatchesSelection = Map<Int, Set<String>>
|
||||||
typealias Options = Map<Int, Map<String, Map<String, Any?>>>
|
typealias Options = Map<Int, Map<String, Map<String, Any?>>>
|
||||||
|
|
||||||
|
val Context.isDebuggable get() = 0 != applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE
|
||||||
|
|
||||||
fun Context.openUrl(url: String) {
|
fun Context.openUrl(url: String) {
|
||||||
startActivity(Intent(Intent.ACTION_VIEW, url.toUri()).apply {
|
startActivity(Intent(Intent.ACTION_VIEW, url.toUri()).apply {
|
||||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||||
|
Loading…
x
Reference in New Issue
Block a user