diff --git a/app/src/main/java/app/revanced/manager/ui/screen/SettingsScreen.kt b/app/src/main/java/app/revanced/manager/ui/screen/SettingsScreen.kt index f43ecb4bd0..0d0bd46e9c 100644 --- a/app/src/main/java/app/revanced/manager/ui/screen/SettingsScreen.kt +++ b/app/src/main/java/app/revanced/manager/ui/screen/SettingsScreen.kt @@ -66,7 +66,7 @@ fun SettingsScreen( ) to SettingsDestination.Advanced, Triple( R.string.about, - R.string.about_description, + R.string.app_name, Icons.Outlined.Info ) to SettingsDestination.About, ) diff --git a/app/src/main/java/app/revanced/manager/ui/screen/settings/AdvancedSettingsScreen.kt b/app/src/main/java/app/revanced/manager/ui/screen/settings/AdvancedSettingsScreen.kt index 04a104fffc..fa8cae28c8 100644 --- a/app/src/main/java/app/revanced/manager/ui/screen/settings/AdvancedSettingsScreen.kt +++ b/app/src/main/java/app/revanced/manager/ui/screen/settings/AdvancedSettingsScreen.kt @@ -1,10 +1,14 @@ package app.revanced.manager.ui.screen.settings import android.app.ActivityManager +import android.content.ClipData +import android.content.ClipboardManager import android.os.Build import androidx.activity.compose.rememberLauncherForActivityResult import androidx.activity.result.contract.ActivityResultContracts +import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.clickable +import androidx.compose.foundation.combinedClickable import androidx.compose.foundation.layout.* import androidx.compose.material.icons.Icons import androidx.compose.material.icons.outlined.Api @@ -13,7 +17,9 @@ import androidx.compose.material3.* import androidx.compose.runtime.* import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.ui.Modifier +import androidx.compose.ui.hapticfeedback.HapticFeedbackType import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.platform.LocalHapticFeedback import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp @@ -28,9 +34,10 @@ import app.revanced.manager.ui.component.settings.BooleanItem import app.revanced.manager.ui.component.settings.IntegerItem import app.revanced.manager.ui.component.settings.SettingsListItem import app.revanced.manager.ui.viewmodel.AdvancedSettingsViewModel +import app.revanced.manager.util.toast import org.koin.androidx.compose.koinViewModel -@OptIn(ExperimentalMaterial3Api::class) +@OptIn(ExperimentalMaterial3Api::class, ExperimentalFoundationApi::class) @Composable fun AdvancedSettingsScreen( onBackClick: () -> Unit, @@ -45,6 +52,7 @@ fun AdvancedSettingsScreen( activityManager.largeMemoryClass ) } + val haptics = LocalHapticFeedback.current Scaffold( topBar = { @@ -82,15 +90,6 @@ fun AdvancedSettingsScreen( } ) - val exportDebugLogsLauncher = - rememberLauncherForActivityResult(ActivityResultContracts.CreateDocument("text/plain")) { - it?.let(vm::exportDebugLogs) - } - SettingsListItem( - headlineContent = stringResource(R.string.debug_logs_export), - modifier = Modifier.clickable { exportDebugLogsLauncher.launch(vm.debugLogFileName) } - ) - GroupHeader(stringResource(R.string.patcher)) BooleanItem( preference = vm.prefs.useProcessRuntime, @@ -138,16 +137,38 @@ fun AdvancedSettingsScreen( ) GroupHeader(stringResource(R.string.debugging)) + val exportDebugLogsLauncher = + rememberLauncherForActivityResult(ActivityResultContracts.CreateDocument("text/plain")) { + it?.let(vm::exportDebugLogs) + } SettingsListItem( - headlineContent = stringResource(R.string.about_device), - supportingContent = """ - **Version**: ${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE}) - **Build type**: ${BuildConfig.BUILD_TYPE} - **Model**: ${Build.MODEL} - **Android version**: ${Build.VERSION.RELEASE} (${Build.VERSION.SDK_INT}) - **Supported Archs**: ${Build.SUPPORTED_ABIS.joinToString(", ")} - **Memory limit**: $memoryLimit + headlineContent = stringResource(R.string.debug_logs_export), + modifier = Modifier.clickable { exportDebugLogsLauncher.launch(vm.debugLogFileName) } + ) + val clipboard = remember { context.getSystemService()!! } + val deviceContent = """ + Version: ${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE}) + Build type: ${BuildConfig.BUILD_TYPE} + Model: ${Build.MODEL} + Android version: ${Build.VERSION.RELEASE} (${Build.VERSION.SDK_INT}) + Supported Archs: ${Build.SUPPORTED_ABIS.joinToString(", ")} + Memory limit: $memoryLimit """.trimIndent() + SettingsListItem( + modifier = Modifier.combinedClickable( + onClick = { }, + onLongClickLabel = stringResource(R.string.copy_to_clipboard), + onLongClick = { + haptics.performHapticFeedback(HapticFeedbackType.LongPress) + clipboard.setPrimaryClip( + ClipData.newPlainText("Device Information", deviceContent) + ) + + context.toast(context.getString(R.string.toast_copied_to_clipboard)) + } + ), + headlineContent = stringResource(R.string.about_device), + supportingContent = deviceContent ) } } diff --git a/app/src/main/java/app/revanced/manager/ui/screen/settings/ContributorScreen.kt b/app/src/main/java/app/revanced/manager/ui/screen/settings/ContributorScreen.kt index d4995aad0e..0b3a7888e6 100644 --- a/app/src/main/java/app/revanced/manager/ui/screen/settings/ContributorScreen.kt +++ b/app/src/main/java/app/revanced/manager/ui/screen/settings/ContributorScreen.kt @@ -2,7 +2,20 @@ package app.revanced.manager.ui.screen.settings import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.border -import androidx.compose.foundation.layout.* +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.BoxWithConstraints +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.ExperimentalLayoutApi +import androidx.compose.foundation.layout.FlowRow +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width import androidx.compose.foundation.lazy.items import androidx.compose.foundation.pager.HorizontalPager import androidx.compose.foundation.pager.rememberPagerState diff --git a/app/src/main/java/app/revanced/manager/ui/screen/settings/DeveloperOptionsScreen.kt b/app/src/main/java/app/revanced/manager/ui/screen/settings/DeveloperOptionsScreen.kt index f8f1e0cf14..1789329eb9 100644 --- a/app/src/main/java/app/revanced/manager/ui/screen/settings/DeveloperOptionsScreen.kt +++ b/app/src/main/java/app/revanced/manager/ui/screen/settings/DeveloperOptionsScreen.kt @@ -32,7 +32,7 @@ fun DeveloperOptionsScreen( Column(modifier = Modifier.padding(paddingValues)) { GroupHeader(stringResource(R.string.patch_bundles_section)) SettingsListItem( - headlineContent = stringResource(R.string.patch_bundles_redownload), + headlineContent = stringResource(R.string.patch_bundles_force_download), modifier = Modifier.clickable(onClick = vm::redownloadBundles) ) SettingsListItem( diff --git a/app/src/main/java/app/revanced/manager/ui/screen/settings/GeneralSettingsScreen.kt b/app/src/main/java/app/revanced/manager/ui/screen/settings/GeneralSettingsScreen.kt index f41e6a66e9..03eae09fe5 100644 --- a/app/src/main/java/app/revanced/manager/ui/screen/settings/GeneralSettingsScreen.kt +++ b/app/src/main/java/app/revanced/manager/ui/screen/settings/GeneralSettingsScreen.kt @@ -2,8 +2,18 @@ package app.revanced.manager.ui.screen.settings import android.os.Build import androidx.compose.foundation.clickable -import androidx.compose.foundation.layout.* -import androidx.compose.material3.* +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.AlertDialog +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.FilledTonalButton +import androidx.compose.material3.RadioButton +import androidx.compose.material3.Scaffold +import androidx.compose.material3.Text +import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf @@ -96,7 +106,7 @@ private fun ThemePicker( title = { Text(stringResource(R.string.theme)) }, text = { Column { - Theme.values().forEach { + Theme.entries.forEach { Row( modifier = Modifier .fillMaxWidth() diff --git a/app/src/main/java/app/revanced/manager/ui/screen/settings/ImportExportSettingsScreen.kt b/app/src/main/java/app/revanced/manager/ui/screen/settings/ImportExportSettingsScreen.kt index 1f15f469bf..84a96694d5 100644 --- a/app/src/main/java/app/revanced/manager/ui/screen/settings/ImportExportSettingsScreen.kt +++ b/app/src/main/java/app/revanced/manager/ui/screen/settings/ImportExportSettingsScreen.kt @@ -250,12 +250,17 @@ private fun PackageSelector(packages: Set, onFinish: (String?) -> Unit) } @Composable -private fun GroupItem(onClick: () -> Unit, @StringRes headline: Int, @StringRes description: Int) = +private fun GroupItem( + onClick: () -> Unit, + @StringRes headline: Int, + @StringRes description: Int? = null +) { SettingsListItem( modifier = Modifier.clickable { onClick() }, headlineContent = stringResource(headline), - supportingContent = stringResource(description) + supportingContent = description?.let { stringResource(it) } ) +} @Composable fun KeystoreCredentialsDialog( diff --git a/app/src/main/java/app/revanced/manager/ui/screen/settings/LicensesScreen.kt b/app/src/main/java/app/revanced/manager/ui/screen/settings/LicensesScreen.kt index 3a9bb82469..76e2e964a5 100644 --- a/app/src/main/java/app/revanced/manager/ui/screen/settings/LicensesScreen.kt +++ b/app/src/main/java/app/revanced/manager/ui/screen/settings/LicensesScreen.kt @@ -1,8 +1,11 @@ package app.revanced.manager.ui.screen.settings -import androidx.compose.foundation.layout.* +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.rememberLazyListState -import androidx.compose.material3.* +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1270e091b3..828c726d4a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -6,6 +6,9 @@ CLI Manager + Copied! + Copy to clipboard + Dashboard Settings Select an app @@ -49,19 +52,18 @@ These settings can be changed later. General - General settings - Advanced - Advanced settings + Theme, dynamic color Updates - Updates for ReVanced Manager - Open source licenses - View all the libraries used to make this application + Check for updates and view changelogs Downloads - Manage downloaded content + Downloader plugins and downloaded apps Import & export - Import and export settings + Keystore, patch options and selection + Advanced + API URL, memory limit, debugging About - About ReVanced + Open source licenses + View all the libraries used to make this application Contributors View the contributors of ReVanced @@ -169,7 +171,7 @@ Memory limits %1$dMB (Normal) - %2$dMB (Large) Patch bundles - Redownload all patch bundles + Force download all patch bundles Reset patch bundles Patching Signing