Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: reorganize and rename settings #1307

Merged
merged 36 commits into from
Oct 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
688979c
reorganize and rename settings
KobeW50 Sep 24, 2023
629fef2
Small consistency fix
KobeW50 Sep 24, 2023
b647c0a
refactor: string
validcube Sep 24, 2023
ea97d9f
refactor(i18n): string
validcube Sep 24, 2023
0a5783c
Update en_US.json
KobeW50 Sep 24, 2023
f891ff6
rename InfoSection to DebugSection
KobeW50 Sep 26, 2023
48310e8
rename ExperimentalPatches to VersionCompatibilityCheck
KobeW50 Sep 26, 2023
80b8376
Update docs settings page
KobeW50 Sep 26, 2023
62a6935
rename ExperimentalPatches to VersionCompatibilityCheck
KobeW50 Sep 26, 2023
0a1759d
Update en_US.json
KobeW50 Sep 26, 2023
52f7720
Update en_US.json
KobeW50 Sep 26, 2023
f7f9d64
correct grammar in string
KobeW50 Sep 26, 2023
9a2f089
remove undesirable user suggestion
KobeW50 Sep 26, 2023
0af521e
feat: add websites to socials
Ushie Oct 4, 2023
0c5683b
refactor: remove `experimental` from universal patches strings
Ushie Oct 4, 2023
0fcc983
fix: enable version compatibility check by default
Ushie Oct 4, 2023
944396f
refactor: move commented code to correct place
Ushie Oct 4, 2023
23c3f4b
refactor: remove unused stuff
Ushie Oct 4, 2023
8c4a4e1
Merge branch 'dev' into dev
Ushie Oct 4, 2023
441e488
feat: use revanced icon for website in socials
Ushie Oct 4, 2023
22ea54d
fix: fonts import in pubspec
Ushie Oct 4, 2023
306ae9f
refactor wording in docs
KobeW50 Oct 10, 2023
0edaaf8
refactor wording of "patches selection"
KobeW50 Oct 10, 2023
9374b03
Merge branch 'dev' into pr/KobeW50/1307-2
Ushie Oct 13, 2023
395e821
use new toggle names in patcher logs
KobeW50 Oct 13, 2023
5687731
Merge branch 'dev' into pr/KobeW50/1307-2
Ushie Oct 13, 2023
2c370f6
docs: reflect new settings order (and small changes)
KobeW50 Oct 13, 2023
b292c09
refactor and reorganize en_US.json
KobeW50 Oct 13, 2023
9b68156
docs: fix incorrect order
KobeW50 Oct 13, 2023
52a47af
docs: typo
KobeW50 Oct 13, 2023
55d195c
refactor strings for requested changes
KobeW50 Oct 13, 2023
8096231
singularize "selections"
KobeW50 Oct 15, 2023
2ee0c90
change "ReVanced Patches" to "patches"
KobeW50 Oct 15, 2023
5cfb989
requested changes
KobeW50 Oct 15, 2023
8f33519
requested changes regarding "keystore"
KobeW50 Oct 15, 2023
02a76e1
Merge branch 'dev' into dev
validcube Oct 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions assets/i18n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,9 @@

"appearanceSectionTitle": "Appearance",
"teamSectionTitle": "Team",
"infoSectionTitle": "Info",
"infoSectionTitle": "Debugging",
"advancedSectionTitle": "Advanced",
"exportSectionTitle": "Import & export",
"logsSectionTitle": "Logs",

"themeModeLabel": "App theme",
"systemThemeLabel": "System",
Expand Down Expand Up @@ -208,21 +207,21 @@
"contributorsLabel": "Contributors",
"contributorsHint": "A list of contributors of ReVanced",

"logsLabel": "Logs",
"logsHint": "Share Manager's logs",
"logsLabel": "Share logs",
"logsHint": "Share ReVanced Manager logs",

"enablePatchesSelectionLabel": "Enable changing selection",
"enablePatchesSelectionHint": "Enable changing the selection of patches.",
"enablePatchesSelectionLabel": "Allow changing patch selection",
"enablePatchesSelectionHint": "Allow changing the selection of patches",
"enablePatchesSelectionWarningText": "Changing the default selection of patches may cause unexpected issues.\n\nEnable anyways?",
"disablePatchesSelectionWarningText": "You are about to disable changing the selection of patches.\nThe default selection of patches will be restored.\n\nDisable anyways?",

"autoUpdatePatchesLabel": "Auto update patches",
"autoUpdatePatchesHint": "Automatically update ReVanced Patches to the latest version",
"experimentalUniversalPatchesLabel": "Experimental universal patches support",
"experimentalUniversalPatchesHint": "Display all applications to use with universal patches, loading list of apps may be slower",
"experimentalPatchesLabel": "Experimental patches support",
"experimentalPatchesHint": "Enable usage of unsupported patches in any app version",
"enabledExperimentalPatches": "Experimental patches support enabled",
"experimentalUniversalPatchesLabel": "Show universal patches",
"experimentalUniversalPatchesHint": "Display all applications to use with universal patches. Loading list of apps may be slower",
"experimentalPatchesLabel": "Allow experimental patches",
"experimentalPatchesHint": "Enable usage of patches in any app version",
"enabledExperimentalPatches": "Experimental patches enabled",

"aboutLabel": "About",
"snackbarMessage": "Copied to clipboard",
Expand All @@ -241,15 +240,15 @@
"importPatchesHint": "Import patches selection from a JSON file",
"importedPatches": "Patches selection imported",

"resetStoredPatchesLabel": "Reset patches",
"resetStoredPatchesLabel": "Reset patches selection",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im not sure if it should be "Reset patches selection" or "Reset patch selection" (same question for the similar options)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "Reset selection of patches"?

Copy link
Contributor Author

@KobeW50 KobeW50 Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that sounds clunky. If this is changed the other options need to be changed too for consistency (Ie: "Export selection of patches")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think @PalmDevs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, it should be patch selections, since it is multiple selections of patches. This can be combined with options which would result in something along the lines of:

Reset patch selections and options

Patches selection just doesn't sound right in my opinion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, ill make these changes today

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

"resetStoredPatchesHint": "Reset the stored patches selection",

"resetStoredPatchesDialogTitle": "Reset patches selection?",
"resetStoredPatchesDialogText": "Resetting patches selection will remove all selected patches.",
"resetStoredPatches": "Patches selection has been reset",

"deleteLogsLabel": "Delete logs",
"deleteLogsHint": "Delete collected manager logs",
"deleteLogsLabel": "Clear logs",
"deleteLogsHint": "Delete collected ReVanced Manager logs",
"deletedLogs": "Logs deleted",

"regenerateKeystoreLabel": "Regenerate keystore",
Expand All @@ -269,7 +268,7 @@
"importedKeystore": "Keystore imported",

"selectKeystorePassword": "Keystore Password",
KobeW50 marked this conversation as resolved.
Show resolved Hide resolved
"selectKeystorePasswordHint": "Select keystore password used to sign the apk",
"selectKeystorePasswordHint": "Select keystore password used to sign the APK",

"jsonSelectorErrorMessage": "Unable to use selected JSON file",
"keystoreSelectorErrorMessage": "Unable to use selected KEYSTORE file"
KobeW50 marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
5 changes: 3 additions & 2 deletions lib/ui/views/settings/settings_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@ class SettingsView extends StatelessWidget {
delegate: SliverChildListDelegate.fixed(
<Widget>[
SUpdateThemeUI(),
// SUpdateLanguageUI(),
// _settingsDivider,
STeamSection(),
// SUpdateLanguageUI(),
_settingsDivider,
SAdvancedSection(),
_settingsDivider,
SExportSection(),
_settingsDivider,
STeamSection(),
_settingsDivider,
SInfoSection(),
],
),
Expand Down
80 changes: 4 additions & 76 deletions lib/ui/widgets/settingsView/settings_advanced_section.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// ignore_for_file: prefer_const_constructors

import 'package:flutter/material.dart';
import 'package:flutter_i18n/widgets/I18nText.dart';
import 'package:revanced_manager/ui/views/settings/settingsFragment/settings_manage_api_url.dart';
import 'package:revanced_manager/ui/views/settings/settingsFragment/settings_manage_sources.dart';
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
Expand All @@ -10,7 +9,6 @@ import 'package:revanced_manager/ui/widgets/settingsView/settings_auto_update_pa
import 'package:revanced_manager/ui/widgets/settingsView/settings_experimental_patches.dart';
import 'package:revanced_manager/ui/widgets/settingsView/settings_experimental_universal_patches.dart';
import 'package:revanced_manager/ui/widgets/settingsView/settings_section.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_material_button.dart';

final _settingsViewModel = SettingsViewModel();

Expand All @@ -22,84 +20,14 @@ class SAdvancedSection extends StatelessWidget {
return SettingsSection(
title: 'settingsView.advancedSectionTitle',
children: <Widget>[
SManageApiUrlUI(),
SManageSourcesUI(),
// SManageKeystorePasswordUI(),
SAutoUpdatePatches(),
SEnablePatchesSelection(),
SExperimentalUniversalPatches(),
SExperimentalPatches(),
ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.regenerateKeystoreLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
),
subtitle: I18nText('settingsView.regenerateKeystoreHint'),
onTap: () => _showDeleteKeystoreDialog(context),
),
ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.deleteTempDirLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
),
subtitle: I18nText('settingsView.deleteTempDirHint'),
onTap: () => _settingsViewModel.deleteTempDir(),
),
ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.deleteLogsLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
),
subtitle: I18nText('settingsView.deleteLogsHint'),
onTap: () => _settingsViewModel.deleteLogs(),
),
SExperimentalUniversalPatches(),
SManageSourcesUI(),
SManageApiUrlUI(),
// SManageKeystorePasswordUI(),
KobeW50 marked this conversation as resolved.
Show resolved Hide resolved
],
);
}

Future<void> _showDeleteKeystoreDialog(context) {
return showDialog(
context: context,
builder: (context) => AlertDialog(
title: I18nText('settingsView.regenerateKeystoreDialogTitle'),
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
content: I18nText('settingsView.regenerateKeystoreDialogText'),
actions: <Widget>[
CustomMaterialButton(
isFilled: false,
label: I18nText('noButton'),
onPressed: () => Navigator.of(context).pop(),
),
CustomMaterialButton(
label: I18nText('yesButton'),
onPressed: () => {
Navigator.of(context).pop(),
_settingsViewModel.deleteKeystore(),
},
),
],
),
);
}
}
46 changes: 43 additions & 3 deletions lib/ui/widgets/settingsView/settings_export_section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,21 @@ class SExportSection extends StatelessWidget {
subtitle: I18nText('settingsView.importPatchesHint'),
onTap: () => _settingsViewModel.importPatches(context),
),
ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.resetStoredPatchesLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
),
subtitle: I18nText('settingsView.resetStoredPatchesHint'),
onTap: () => _showResetStoredPatchesDialog(context),
),
ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
Expand Down Expand Up @@ -84,7 +99,7 @@ class SExportSection extends StatelessWidget {
ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.resetStoredPatchesLabel',
'settingsView.regenerateKeystoreLabel',
child: const Text(
'',
style: TextStyle(
Expand All @@ -93,8 +108,8 @@ class SExportSection extends StatelessWidget {
),
),
),
subtitle: I18nText('settingsView.resetStoredPatchesHint'),
onTap: () => _showResetStoredPatchesDialog(context),
subtitle: I18nText('settingsView.regenerateKeystoreHint'),
onTap: () => _showDeleteKeystoreDialog(context),
),
],
);
Expand Down Expand Up @@ -126,4 +141,29 @@ class SExportSection extends StatelessWidget {
),
);
}

Future<void> _showDeleteKeystoreDialog(context) {
return showDialog(
context: context,
builder: (context) => AlertDialog(
title: I18nText('settingsView.regenerateKeystoreDialogTitle'),
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
content: I18nText('settingsView.regenerateKeystoreDialogText'),
actions: <Widget>[
CustomMaterialButton(
isFilled: false,
label: I18nText('noButton'),
onPressed: () => Navigator.of(context).pop(),
),
CustomMaterialButton(
label: I18nText('yesButton'),
onPressed: () => {
Navigator.of(context).pop(),
_settingsViewModel.deleteKeystore(),
},
),
],
),
);
}
}
30 changes: 30 additions & 0 deletions lib/ui/widgets/settingsView/settings_info_section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,36 @@ class SInfoSection extends StatelessWidget {
subtitle: I18nText('settingsView.logsHint'),
onTap: () => _settingsViewModel.exportLogcatLogs(),
),
ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.deleteLogsLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
),
subtitle: I18nText('settingsView.deleteLogsHint'),
onTap: () => _settingsViewModel.deleteLogs(),
),
ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.deleteTempDirLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
),
subtitle: I18nText('settingsView.deleteTempDirHint'),
onTap: () => _settingsViewModel.deleteTempDir(),
),
const AboutWidget(
padding: EdgeInsets.symmetric(horizontal: 20.0),
),
Expand Down