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

chore: Merge dev to main #1611

Merged
merged 100 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
c94eb7a
perf: Load patched apps as soon as possible
oSumAtrIX Dec 23, 2023
975180b
fix: added a trailing comma
BenjaminHalko Dec 28, 2023
9ed43ef
feat: use native TextField
validcube Dec 30, 2023
3f96608
fix: Allow mounting without Magisk
Ushie Dec 31, 2023
f3c78c2
fix: Mount script causes build to fail (#1613)
BenjaminHalko Dec 31, 2023
edd8602
fix: use lowercase repo names (#1626)
BenjaminHalko Jan 8, 2024
28ae276
feat: Add API migration code (#1615)
oSumAtrIX Jan 9, 2024
0d45fe4
feat: Simplify settings strings (#1618)
oSumAtrIX Jan 9, 2024
4f22e88
fix: Incorrect strings and logics (#1619)
TheAabedKhan Jan 11, 2024
fd27806
chore: remove unused import
BenjaminHalko Jan 12, 2024
ef9b1d5
refactor: Replace deprecated `WillPopScope` (#1604)
BenjaminHalko Jan 14, 2024
7911459
feat: add haptic feedback (#1459)
BenjaminHalko Jan 14, 2024
b07b935
docs(security): init (#1599)
validcube Jan 21, 2024
cf1afdd
chore: remove unused dependencies (#1603)
BenjaminHalko Jan 21, 2024
079c0de
fix: fix redundant buttons on dialog
validcube Jan 21, 2024
30d5f3a
docs(security): Prepare for v1.19.0
validcube Jan 21, 2024
97c33d6
chore: Remove deprecated lint rules
validcube Jan 21, 2024
9764326
chore(patch_item): Remove import directive
validcube Jan 21, 2024
8e52abd
fix(Keystore Password): textfield title display
validcube Jan 21, 2024
acb1e24
fix(Patch Option): Set text colour on dropdown menu
validcube Jan 21, 2024
efb2d5e
feat: Improve app selector and patcher UI (#1616)
oSumAtrIX Jan 22, 2024
ec2c2d8
ci: Build pre-release versions (#1606)
BenjaminHalko Jan 22, 2024
6fd740f
feat: Improve Split APK warning readability (#1625)
otahir-21 Jan 22, 2024
8595099
fix(Release CI): truncate the "v" from version
validcube Jan 22, 2024
f38a593
ci(Release Build): Use correct syntax in getting the version
validcube Jan 22, 2024
bea99bb
chore(release): 1.19.0-dev.1 [skip ci]
semantic-release-bot Jan 22, 2024
d933997
fix: Use correct version code & name (#1647)
BenjaminHalko Jan 22, 2024
7104d6d
chore(release): 1.19.0-dev.2 [skip ci]
semantic-release-bot Jan 22, 2024
c7d975e
feat: Show a dialog when an update is available (#1654)
TheAabedKhan Jan 25, 2024
70a1086
fix: Do not delete files from post-fs-data.d
TheAabedKhan Jan 25, 2024
deb1ba3
docs(Security): Use dynamic information on version
validcube Jan 27, 2024
3e51caf
docs(Security): Avoid table shifting layout
validcube Jan 27, 2024
07fc964
ci: Specify paths in release workflow (#1664)
BenjaminHalko Jan 29, 2024
b115643
chore(release): 1.19.0-dev.3 [skip ci]
semantic-release-bot Jan 29, 2024
088a3b7
ci: Improve build workflow (#1668)
BenjaminHalko Feb 1, 2024
5b2c551
fix: Stop patch when signing fails (#1553)
kitadai31 Feb 1, 2024
93482b0
chore(release): 1.19.0-dev.4 [skip ci]
semantic-release-bot Feb 2, 2024
8be07de
ci(release): Migrate deprecated Node version
validcube Feb 2, 2024
9aeb156
fix(Update Confirmation Sheet): Add top padding
validcube Feb 2, 2024
edc8ef4
chore(release): 1.19.0-dev.5 [skip ci]
semantic-release-bot Feb 2, 2024
c900d09
refactor: Disable update for dev build (#1662)
BenjaminHalko Feb 2, 2024
8cda2c1
ci: Add scope to changelog (#1672)
BenjaminHalko Feb 3, 2024
eb6d3cd
fix(PopScope): User able to exit patch screen when the installer is s…
BenjaminHalko Feb 3, 2024
9bf5153
chore(release): 1.19.0-dev.6 [skip ci]
semantic-release-bot Feb 3, 2024
b9241fa
docs(Security): Format badges
validcube Feb 3, 2024
3559477
fix: adjust padding
TheAabedKhan Feb 6, 2024
c498cff
chore(release): 1.19.0-dev.7 [skip ci]
semantic-release-bot Feb 6, 2024
f82c439
feat: Allow changing languages (#1488)
Ushie Feb 11, 2024
f5578b0
chore(i18n): Sync translations (#1671)
github-actions[bot] Feb 11, 2024
3436523
fix: Use correct title size for bottom sheet (#1687)
oSumAtrIX Feb 12, 2024
64c10b4
chore(release): 1.19.0-dev.9 [skip ci]
semantic-release-bot Feb 12, 2024
31a32eb
chore(i18n): Sync translations (#1685)
github-actions[bot] Feb 13, 2024
1aaeac1
chore: update dependencies
BenjaminHalko Feb 13, 2024
bdfeda2
chore(release): 1.19.0-dev.8 [skip ci]
semantic-release-bot Feb 12, 2024
3b0fed5
revert: WillPopScope migration
validcube Feb 15, 2024
3ee29c2
chore(release): 1.19.0-dev.10 [skip ci]
semantic-release-bot Feb 15, 2024
f57898a
build: Bump Gradle to v8.6
validcube Feb 15, 2024
0ec6897
chore: Update .gitignore
validcube Feb 15, 2024
5a24911
refactor: Check-in pubspec.lock
validcube Feb 15, 2024
b754a04
build: Enable ProGuard (#1650)
kitadai31 Feb 15, 2024
e0c750d
ci(build): Upload build artifact
validcube Feb 15, 2024
b2119ce
feat: Improve consistency on language selector
validcube Feb 15, 2024
953209c
chore(release): 1.19.0-dev.11 [skip ci]
semantic-release-bot Feb 15, 2024
bfe59ea
docs: Add a tip for the prompt to select an APK from storage
oSumAtrIX Feb 15, 2024
933c719
docs: Use consistent wording
oSumAtrIX Feb 15, 2024
f5ba84d
docs: Adjust footnote regarding obtaining APK files
oSumAtrIX Feb 15, 2024
3b58d22
refactor: PopScope Migration (#1674)
validcube Feb 18, 2024
25d53ce
ci: Dependabot (#1692)
BenjaminHalko Feb 18, 2024
f2e7071
chore(release): 1.19.0-dev.12 [skip ci]
semantic-release-bot Feb 18, 2024
8a41617
chore: Upgrade dependencies (#1693)
BenjaminHalko Feb 18, 2024
0443c8c
chore(i18n): Sync translations (#1688)
github-actions[bot] Feb 18, 2024
ce5088a
chore(release): 1.19.0-dev.13 [skip ci]
semantic-release-bot Feb 18, 2024
f89c742
feat: Add a toggle for alternative sources (#1686)
TheAabedKhan Feb 19, 2024
244d078
chore(release): 1.19.0-dev.14 [skip ci]
semantic-release-bot Feb 19, 2024
82d6e3f
ci(Release): Remove unnecessary upload (#1695)
BenjaminHalko Feb 19, 2024
d068955
docs: Switch order of note and tip [skip ci]
oSumAtrIX Feb 25, 2024
d4b15ae
fix: Specify that dark theme is dark (#1699)
BenjaminHalko Feb 25, 2024
f774780
chore(i18n): Sync translations (#1694)
github-actions[bot] Feb 25, 2024
28d6ab6
chore(release): 1.19.0-dev.15 [skip ci]
semantic-release-bot Feb 25, 2024
3e696d6
feat: Hide the Install button during installation (#1633)
erayerdin Feb 25, 2024
c72d10a
fix: Show version label correctly
oSumAtrIX Feb 25, 2024
f4dea6e
chore(release): 1.19.0-dev.16 [skip ci]
semantic-release-bot Feb 25, 2024
6d866d4
feat: Improve language distinguishness and resolve language-specific …
Ushie Feb 26, 2024
6d6fae1
chore(release): 1.19.0-dev.17 [skip ci]
semantic-release-bot Feb 26, 2024
d414a91
ci: Match changelog format of other ReVanced repos (#1705)
BenjaminHalko Feb 26, 2024
c170392
ci(Release): Use ReVanced account instead of semantic-release
validcube Mar 4, 2024
52e1020
chore(Dependency): Switch language_code back to Upstream version
validcube Mar 4, 2024
e76418d
chore: Sync translations (#1701)
github-actions[bot] Mar 4, 2024
6dee3aa
docs: Fix consistency issues with other repositories (#1707)
oSumAtrIX Mar 4, 2024
10bae69
build(Needs bump): Bump dependencies (#1717)
oSumAtrIX Mar 4, 2024
2e1de94
chore: Fix builds
oSumAtrIX Mar 4, 2024
02722fc
chore(release): 1.19.0-dev.18 [skip ci]
semantic-release-bot Mar 4, 2024
1200360
fix: Fix patched APKs exports after installation
oSumAtrIX Mar 4, 2024
2d7026a
feat: Use more appropriate progress values
oSumAtrIX Mar 4, 2024
4fc913e
chore(release): 1.19.0-dev.19 [skip ci]
semantic-release-bot Mar 4, 2024
c5e04cc
build: Bump dependencies
oSumAtrIX Mar 4, 2024
6ec6546
fix: Bump dependencies to support BCS keystore
oSumAtrIX Mar 4, 2024
4ca7b8a
chore(release): 1.19.0-dev.20 [skip ci]
semantic-release-bot Mar 4, 2024
aa0575a
feat: Display current app language at the top of the list
Ushie Mar 5, 2024
bc83a39
chore(release): 1.19.0-dev.21 [skip ci]
semantic-release-bot Mar 5, 2024
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
3 changes: 2 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />

<uses-permission android:name="android.permission.VIBRATE" />

<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
Expand Down
18 changes: 9 additions & 9 deletions assets/i18n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@

"storageButton": "Storage",
"selectFromStorageButton": "Select from storage",

"errorMessage": "Unable to use selected application",

"downloadToast": "Download function is not available yet",
Expand Down Expand Up @@ -175,7 +175,7 @@
"pressBackAgain": "Press back again to cancel",
"openButton": "Open",
"shareButton": "Share file",

"notificationTitle": "ReVanced Manager is patching",
"notificationText": "Tap to return to the installer",

Expand Down Expand Up @@ -208,29 +208,29 @@
"englishOption": "English",

"sourcesLabel": "Sources",
"sourcesLabelHint": "Configure your sources",
"sourcesLabelHint": "Configure the source of patches and integrations",
"sourcesIntegrationsLabel": "Integrations source",
"sourcesResetDialogTitle": "Reset",
"sourcesResetDialogText": "Are you sure you want to reset your sources to their default values?",
"apiURLResetDialogText": "Are you sure you want to reset your API URL to its default value?",
"sourcesUpdateNote": "Note: Patches will be updated to the latest version automatically.\n\nThis will reveal your IP address to the server.",

"apiURLLabel": "API URL",
"apiURLHint": "Configure your API URL",
"apiURLHint": "Configure the URL of the API to use",
"selectApiURL": "API URL",
"hostRepositoryLabel": "Repository API",
"orgPatchesLabel": "Patches organization",
"sourcesPatchesLabel": "Patches source",
"orgIntegrationsLabel": "Integrations organization",

"contributorsLabel": "Contributors",
"contributorsHint": "A list of contributors of ReVanced",

"logsLabel": "Share logs",
"logsHint": "Share ReVanced Manager logs",

"enablePatchesSelectionLabel": "Allow changing patch selection",
"enablePatchesSelectionHint": "Allow changing the selection of patches",
"enablePatchesSelectionHint": "Do not prevent selecting or deselecting patches",
"enablePatchesSelectionWarningText": "Changing the 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?",

Expand All @@ -240,9 +240,9 @@
"universalPatchesHint": "Display all apps and universal patches (may slow down the app list)",

"versionCompatibilityCheckLabel": "Version compatibility check",
"versionCompatibilityCheckHint": "Restricts patches to supported app versions",
"versionCompatibilityCheckHint": "Prevent selecting patches that are not compatible with the selected app version",
"requireSuggestedAppVersionLabel": "Require suggested app version",
"requireSuggestedAppVersionHint": "Enforce selection of suggested app version",
"requireSuggestedAppVersionHint": "Prevent selecting an app with a version that is not the suggested",
"requireSuggestedAppVersionDialogText": "Selecting an app that is not the suggested version may cause unexpected issues.\n\nDo you want to proceed anyways?",

"aboutLabel": "About",
Expand Down Expand Up @@ -320,7 +320,7 @@

"patchedDateHint": "{date} at {time}",
"appliedPatchesHint": "{quantity} applied patches",

"updateNotImplemented": "This feature has not been implemented yet"
},
"contributorsView": {
Expand Down
26 changes: 20 additions & 6 deletions lib/services/manager_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import 'package:revanced_manager/services/github_api.dart';
import 'package:revanced_manager/services/patcher_api.dart';
import 'package:revanced_manager/services/revanced_api.dart';
import 'package:revanced_manager/services/root_api.dart';
import 'package:revanced_manager/services/toast.dart';
import 'package:revanced_manager/ui/widgets/shared/haptics/haptic_checkbox_list_tile.dart';
import 'package:revanced_manager/utils/check_for_supported_patch.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:timeago/timeago.dart';
Expand All @@ -23,6 +25,7 @@ import 'package:timeago/timeago.dart';
class ManagerAPI {
final RevancedAPI _revancedAPI = locator<RevancedAPI>();
final GithubAPI _githubAPI = locator<GithubAPI>();
final Toast _toast = locator<Toast>();
final RootAPI _rootAPI = RootAPI();
final String patcherRepo = 'revanced-patcher';
final String cliRepo = 'revanced-cli';
Expand Down Expand Up @@ -50,12 +53,12 @@ class ManagerAPI {
String? integrationsVersion = '';

bool isDefaultPatchesRepo() {
return getPatchesRepo().toLowerCase() == 'revanced/revanced-patches';
return getPatchesRepo().toLowerCase() == defaultPatchesRepo;
}

bool isDefaultIntegrationsRepo() {
return getIntegrationsRepo().toLowerCase() ==
'revanced/revanced-integrations';
defaultIntegrationsRepo;
}

Future<void> initialize() async {
Expand All @@ -65,6 +68,16 @@ class ManagerAPI {
(await getSdkVersion()) >= 31; // ANDROID_12_SDK_VERSION = 31
storedPatchesFile =
(await getApplicationDocumentsDirectory()).path + storedPatchesFile;

// Migrate to new API URL if not done yet as the old one is sunset.
final bool hasMigrated = _prefs.getBool('migratedToNewApiUrl') ?? false;
if (!hasMigrated) {
final String apiUrl = getApiUrl().toLowerCase();
if (apiUrl.contains('releases.revanced.app')) {
await setApiUrl(''); // Reset to default.
_prefs.setBool('migratedToNewApiUrl', true);
}
}
}

Future<int> getSdkVersion() async {
Expand All @@ -82,6 +95,7 @@ class ManagerAPI {
}
await _revancedAPI.clearAllCache();
await _prefs.setString('apiUrl', url);
_toast.showBottom('settingsView.restartAppForChanges');
}

String getRepoUrl() {
Expand Down Expand Up @@ -582,8 +596,8 @@ class ManagerAPI {
return showDialog(
barrierDismissible: false,
context: context,
builder: (context) => WillPopScope(
onWillPop: () async => false,
builder: (context) => PopScope(
canPop: false,
child: AlertDialog(
title: I18nText('warning'),
content: ValueListenableBuilder(
Expand All @@ -604,7 +618,7 @@ class ManagerAPI {
),
),
const SizedBox(height: 8),
CheckboxListTile(
HapticCheckboxListTile(
value: value,
contentPadding: EdgeInsets.zero,
title: I18nText(
Expand Down Expand Up @@ -632,7 +646,7 @@ class ManagerAPI {
);
}

Future<void> reAssessSavedApps() async {
Future<void> rePatchedSavedApps() async {
final List<PatchedApplication> patchedApps = getPatchedApps();

// Remove apps that are not installed anymore.
Expand Down
4 changes: 2 additions & 2 deletions lib/services/revanced_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class RevancedAPI {
final response = await _dio.get('/contributors');
final List<dynamic> repositories = response.data['repositories'];
for (final Map<String, dynamic> repo in repositories) {
final String name = repo['name'];
final String name = repo['name'].toLowerCase();
contributors[name] = repo['contributors'];
}
} on Exception catch (e) {
Expand All @@ -54,7 +54,7 @@ class RevancedAPI {
final List<dynamic> tools = response.data['tools'];
return tools.firstWhereOrNull(
(t) =>
t['repository'] == repoName &&
(t['repository'] as String).toLowerCase() == repoName.toLowerCase() &&
(t['name'] as String).endsWith(extension),
);
} on Exception catch (e) {
Expand Down
8 changes: 6 additions & 2 deletions lib/services/root_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,12 @@ class RootAPI {
);
final String mountScript = '''
#!/system/bin/sh
MAGISKTMP="\$(magisk --path)" || MAGISKTMP=/sbin
# Mount using Magisk mirror, if available.
MAGISKTMP="\$( magisk --path )" || MAGISKTMP=/sbin
MIRROR="\$MAGISKTMP/.magisk/mirror"
if [ ! -f \$MIRROR ]; then
MIRROR=""
fi

until [ "\$(getprop sys.boot_completed)" = 1 ]; do sleep 3; done
until [ -d "/sdcard/Android" ]; do sleep 1; done
Expand All @@ -171,7 +175,7 @@ class RootAPI {
}

Future<void> installPatchedApk(
String packageName, String patchedFilePath) async {
String packageName, String patchedFilePath,) async {
final String newPatchedFilePath = '$_revancedDirPath/$packageName/base.apk';
await Root.exec(
cmd: '''
Expand Down
3 changes: 2 additions & 1 deletion lib/ui/views/app_selector/app_selector_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:revanced_manager/ui/views/app_selector/app_selector_viewmodel.da
import 'package:revanced_manager/ui/widgets/appSelectorView/app_skeleton_loader.dart';
import 'package:revanced_manager/ui/widgets/appSelectorView/installed_app_item.dart';
import 'package:revanced_manager/ui/widgets/appSelectorView/not_installed_app_item.dart';
import 'package:revanced_manager/ui/widgets/shared/haptics/haptic_floating_action_button_extended.dart';
import 'package:revanced_manager/ui/widgets/shared/search_bar.dart';
import 'package:stacked/stacked.dart' hide SkeletonLoader;

Expand All @@ -23,7 +24,7 @@ class _AppSelectorViewState extends State<AppSelectorView> {
onViewModelReady: (model) => model.initialize(),
viewModelBuilder: () => AppSelectorViewModel(),
builder: (context, model, child) => Scaffold(
floatingActionButton: FloatingActionButton.extended(
floatingActionButton: HapticFloatingActionButtonExtended(
label: I18nText('appSelectorView.storageButton'),
icon: const Icon(Icons.sd_storage),
onPressed: () {
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/views/contributors/contributors_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ class ContributorsViewModel extends BaseViewModel {
final Map<String, List<dynamic>> contributors =
await _managerAPI.getContributors();
patcherContributors = contributors[_managerAPI.defaultPatcherRepo] ?? [];
patchesContributors = contributors[_managerAPI.getPatchesRepo()] ?? [];
patchesContributors = contributors[_managerAPI.getPatchesRepo().toLowerCase()] ?? [];
integrationsContributors =
contributors[_managerAPI.getIntegrationsRepo()] ?? [];
contributors[_managerAPI.getIntegrationsRepo().toLowerCase()] ?? [];
cliContributors = contributors[_managerAPI.defaultCliRepo] ?? [];
managerContributors = contributors[_managerAPI.defaultManagerRepo] ?? [];
notifyListeners();
Expand Down
11 changes: 8 additions & 3 deletions lib/ui/views/home/home_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import 'package:revanced_manager/services/toast.dart';
import 'package:revanced_manager/ui/views/navigation/navigation_viewmodel.dart';
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/homeView/update_confirmation_dialog.dart';
import 'package:revanced_manager/ui/widgets/shared/haptics/haptic_checkbox_list_tile.dart';
import 'package:stacked/stacked.dart';
import 'package:stacked_services/stacked_services.dart';

Expand All @@ -38,11 +39,15 @@ class HomeViewModel extends BaseViewModel {
File? downloadedApk;

Future<void> initialize(BuildContext context) async {
_managerAPI.rePatchedSavedApps().then((_) => _getPatchedApps());

_latestManagerVersion = await _managerAPI.getLatestManagerVersion();
if (!_managerAPI.getPatchesConsent()) {
await showPatchesConsent(context);
}

await _patcherAPI.initialize();

await flutterLocalNotificationsPlugin.initialize(
const InitializationSettings(
android: AndroidInitializationSettings('ic_notification'),
Expand All @@ -63,11 +68,13 @@ class HomeViewModel extends BaseViewModel {
.resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>()
?.requestNotificationsPermission();

final bool isConnected =
await Connectivity().checkConnectivity() != ConnectivityResult.none;
if (!isConnected) {
_toast.showBottom('homeView.noConnection');
}

final NotificationAppLaunchDetails? notificationAppLaunchDetails =
await flutterLocalNotificationsPlugin.getNotificationAppLaunchDetails();
if (notificationAppLaunchDetails?.didNotificationLaunchApp ?? false) {
Expand All @@ -79,8 +86,6 @@ class HomeViewModel extends BaseViewModel {
_toast.showBottom('homeView.errorDownloadMessage');
}
}

_managerAPI.reAssessSavedApps().then((_) => _getPatchedApps());
}

void navigateToAppInfo(PatchedApplication app) {
Expand Down Expand Up @@ -203,7 +208,7 @@ class HomeViewModel extends BaseViewModel {
),
),
),
CheckboxListTile(
HapticCheckboxListTile(
value: value,
contentPadding: EdgeInsets.zero,
title: I18nText(
Expand Down
7 changes: 4 additions & 3 deletions lib/ui/views/installer/installer_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:revanced_manager/ui/views/installer/installer_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/installerView/gradient_progress_indicator.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart';
import 'package:revanced_manager/ui/widgets/shared/haptics/haptic_floating_action_button_extended.dart';
import 'package:stacked/stacked.dart';

class InstallerView extends StatelessWidget {
Expand All @@ -15,14 +16,14 @@ class InstallerView extends StatelessWidget {
return ViewModelBuilder<InstallerViewModel>.reactive(
onViewModelReady: (model) => model.initialize(context),
viewModelBuilder: () => InstallerViewModel(),
builder: (context, model, child) => WillPopScope(
builder: (context, model, child) => PopScope(
child: SafeArea(
top: false,
bottom: model.isPatching,
child: Scaffold(
floatingActionButton: Visibility(
visible: !model.isPatching && !model.hasErrors,
child: FloatingActionButton.extended(
child: HapticFloatingActionButtonExtended(
label: I18nText(
model.isInstalled
? 'installerView.openButton'
Expand Down Expand Up @@ -111,7 +112,7 @@ class InstallerView extends StatelessWidget {
),
),
),
onWillPop: () => model.onWillPop(context),
onPopInvoked: (bool didPop) => model.onWillPop(context),
),
);
}
Expand Down
12 changes: 4 additions & 8 deletions lib/ui/views/navigation/navigation_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,10 @@ class NavigationView extends StatelessWidget {
return ViewModelBuilder<NavigationViewModel>.reactive(
onViewModelReady: (model) => model.initialize(context),
viewModelBuilder: () => locator<NavigationViewModel>(),
builder: (context, model, child) => WillPopScope(
onWillPop: () async {
if (model.currentIndex == 0) {
return true;
} else {
model.setIndex(0);
return false;
}
builder: (context, model, child) => PopScope(
canPop: model.currentIndex == 0,
onPopInvoked: (bool didPop) => {
if (!didPop) model.setIndex(0),
},
child: Scaffold(
body: PageTransitionSwitcher(
Expand Down
3 changes: 2 additions & 1 deletion lib/ui/views/patch_options/patch_options_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:google_fonts/google_fonts.dart';
import 'package:revanced_manager/models/patch.dart';
import 'package:revanced_manager/ui/views/patch_options/patch_options_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/patchesSelectorView/patch_options_fields.dart';
import 'package:revanced_manager/ui/widgets/shared/haptics/haptic_floating_action_button_extended.dart';
import 'package:stacked/stacked.dart';

class PatchOptionsView extends StatelessWidget {
Expand All @@ -17,7 +18,7 @@ class PatchOptionsView extends StatelessWidget {
builder: (context, model, child) => GestureDetector(
onTap: () => FocusScope.of(context).unfocus(),
child: Scaffold(
floatingActionButton: FloatingActionButton.extended(
floatingActionButton: HapticFloatingActionButtonExtended(
onPressed: () async {
final bool saved = model.saveOptions(context);
if (saved && context.mounted) {
Expand Down
3 changes: 2 additions & 1 deletion lib/ui/views/patcher/patcher_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/patcherView/app_selector_card.dart';
import 'package:revanced_manager/ui/widgets/patcherView/patch_selector_card.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart';
import 'package:revanced_manager/ui/widgets/shared/haptics/haptic_floating_action_button_extended.dart';
import 'package:stacked/stacked.dart';

class PatcherView extends StatelessWidget {
Expand All @@ -19,7 +20,7 @@ class PatcherView extends StatelessWidget {
builder: (context, model, child) => Scaffold(
floatingActionButton: Visibility(
visible: model.showPatchButton(),
child: FloatingActionButton.extended(
child: HapticFloatingActionButtonExtended(
label: I18nText('patcherView.patchButton'),
icon: const Icon(Icons.build),
onPressed: () async {
Expand Down
3 changes: 2 additions & 1 deletion lib/ui/views/patches_selector/patches_selector_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:revanced_manager/app/app.locator.dart';
import 'package:revanced_manager/services/manager_api.dart';
import 'package:revanced_manager/ui/views/patches_selector/patches_selector_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/shared/haptics/haptic_floating_action_button_extended.dart';
import 'package:revanced_manager/ui/widgets/shared/search_bar.dart';
import 'package:stacked/stacked.dart';

Expand Down Expand Up @@ -36,7 +37,7 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
builder: (context, model, child) => Scaffold(
floatingActionButton: Visibility(
visible: model.patches.isNotEmpty,
child: FloatingActionButton.extended(
child: HapticFloatingActionButtonExtended(
label: Row(
children: <Widget>[
I18nText('patchesSelectorView.doneButton'),
Expand Down
Loading