Compare commits

...

8 Commits

Author SHA1 Message Date
Aunali321
31756884b6 build: Bump version to v0.0.7. 2022-09-16 03:48:23 +05:30
Aunali321
0a2a495ab0 feat: custom animated progressbar. 2022-09-16 03:46:46 +05:30
Aunali321
8300cc4071 feat: dropdown for changelogs. 2022-09-16 00:49:11 +05:30
Alberto Ponces
9f58757caf feat: Apply dark/light mode to system navigation bar too 2022-09-15 13:27:48 +01:00
Alberto Ponces
5d296038b7 fix: Increase API's maxAge to 1 day 2022-09-15 12:33:19 +01:00
Alberto Ponces
9f85450c6c build: Bump version to v0.0.6 2022-09-15 09:14:43 +01:00
Alberto Ponces
cba4e175a3 build: Bump version to v0.0.5 2022-09-15 02:27:36 +01:00
Alberto Ponces
cf3fa935ce fix: Fix select from storage for Android 13 devices 2022-09-15 02:18:07 +01:00
11 changed files with 140 additions and 34 deletions

View File

@@ -1,6 +1,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="app.revanced.manager.flutter"> package="app.revanced.manager.flutter">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<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" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" /> <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />

View File

@@ -69,7 +69,8 @@
}, },
"patchesSelectorView": { "patchesSelectorView": {
"searchBarHint": "Search patches", "searchBarHint": "Search patches",
"doneButton": "Done" "doneButton": "Done",
"noPatchesFound": "No patches found for the selected app."
}, },
"patchItem": { "patchItem": {
"unsupportedWarningButton": "Unsupported version", "unsupportedWarningButton": "Unsupported version",

View File

@@ -13,7 +13,7 @@ class GithubAPI {
final Dio _dio = Dio(); final Dio _dio = Dio();
final DioCacheManager _dioCacheManager = DioCacheManager(CacheConfig()); final DioCacheManager _dioCacheManager = DioCacheManager(CacheConfig());
final Options _cacheOptions = buildCacheOptions( final Options _cacheOptions = buildCacheOptions(
const Duration(hours: 1), const Duration(days: 1),
maxStale: const Duration(days: 7), maxStale: const Duration(days: 7),
); );
final Map<String, String> repoAppPath = { final Map<String, String> repoAppPath = {

View File

@@ -13,7 +13,7 @@ class RevancedAPI {
final Dio _dio = Dio(); final Dio _dio = Dio();
final DioCacheManager _dioCacheManager = DioCacheManager(CacheConfig()); final DioCacheManager _dioCacheManager = DioCacheManager(CacheConfig());
final Options _cacheOptions = buildCacheOptions( final Options _cacheOptions = buildCacheOptions(
const Duration(hours: 1), const Duration(days: 1),
maxStale: const Duration(days: 7), maxStale: const Duration(days: 7),
); );

View File

@@ -3,6 +3,7 @@ import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:revanced_manager/ui/views/installer/installer_viewmodel.dart'; import 'package:revanced_manager/ui/views/installer/installer_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/installerView/custom_material_button.dart'; import 'package:revanced_manager/ui/widgets/installerView/custom_material_button.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_card.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_popup_menu.dart'; import 'package:revanced_manager/ui/widgets/shared/custom_popup_menu.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart'; import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart';
@@ -57,14 +58,9 @@ class InstallerView extends StatelessWidget {
), ),
], ],
bottom: PreferredSize( bottom: PreferredSize(
preferredSize: const Size(double.infinity, 1.0), preferredSize: const Size(double.infinity, 1.0),
child: LinearProgressIndicator( child:
color: Theme.of(context).colorScheme.primary, GradientProgressIndicator(progress: model.progress!)),
backgroundColor:
Theme.of(context).colorScheme.primaryContainer,
value: model.progress,
),
),
), ),
SliverPadding( SliverPadding(
padding: const EdgeInsets.all(20.0), padding: const EdgeInsets.all(20.0),

View File

@@ -1,6 +1,7 @@
// ignore_for_file: use_build_context_synchronously // ignore_for_file: use_build_context_synchronously
import 'package:dynamic_themes/dynamic_themes.dart'; import 'package:dynamic_themes/dynamic_themes.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:injectable/injectable.dart'; import 'package:injectable/injectable.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:revanced_manager/services/root_api.dart'; import 'package:revanced_manager/services/root_api.dart';
@@ -15,14 +16,21 @@ class NavigationViewModel extends IndexTrackingViewModel {
void initialize(BuildContext context) async { void initialize(BuildContext context) async {
SharedPreferences prefs = await SharedPreferences.getInstance(); SharedPreferences prefs = await SharedPreferences.getInstance();
if (prefs.getBool('useDarkTheme') == null) { if (prefs.getBool('useDarkTheme') == null) {
if (MediaQuery.of(context).platformBrightness == Brightness.light) { bool isDark =
await prefs.setBool('useDarkTheme', false); MediaQuery.of(context).platformBrightness != Brightness.light;
DynamicTheme.of(context)!.setTheme(0); await prefs.setBool('useDarkTheme', isDark);
} else { await DynamicTheme.of(context)!.setTheme(isDark ? 1 : 0);
await prefs.setBool('useDarkTheme', true);
DynamicTheme.of(context)!.setTheme(1);
}
} }
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(
systemNavigationBarColor:
DynamicTheme.of(context)!.theme.colorScheme.surface,
systemNavigationBarIconBrightness:
DynamicTheme.of(context)!.theme.brightness == Brightness.light
? Brightness.dark
: Brightness.light,
),
);
RootAPI().hasRootPermissions(); RootAPI().hasRootPermissions();
Permission.requestInstallPackages.request(); Permission.requestInstallPackages.request();
Permission.ignoreBatteryOptimizations.request(); Permission.ignoreBatteryOptimizations.request();

View File

@@ -55,9 +55,16 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
const SizedBox(height: 12), const SizedBox(height: 12),
Expanded( Expanded(
child: model.patches.isEmpty child: model.patches.isEmpty
? Center( ? Padding(
child: CircularProgressIndicator( padding: const EdgeInsets.all(8.0),
color: Theme.of(context).colorScheme.primary, child: Center(
child: I18nText(
'patchesSelectorView.noPatchesFound',
child: Text(
'',
style: Theme.of(context).textTheme.bodyMedium,
),
),
), ),
) )
: ListView( : ListView(

View File

@@ -3,6 +3,7 @@ import 'dart:io';
import 'package:device_info_plus/device_info_plus.dart'; import 'package:device_info_plus/device_info_plus.dart';
import 'package:dynamic_themes/dynamic_themes.dart'; import 'package:dynamic_themes/dynamic_themes.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:logcat/logcat.dart'; import 'package:logcat/logcat.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
@@ -50,10 +51,16 @@ class SettingsViewModel extends BaseViewModel {
await _managerAPI.setUseDynamicTheme(value); await _managerAPI.setUseDynamicTheme(value);
int currentTheme = DynamicTheme.of(context)!.themeId; int currentTheme = DynamicTheme.of(context)!.themeId;
if (currentTheme.isEven) { if (currentTheme.isEven) {
DynamicTheme.of(context)!.setTheme(value ? 2 : 0); await DynamicTheme.of(context)!.setTheme(value ? 2 : 0);
} else { } else {
DynamicTheme.of(context)!.setTheme(value ? 3 : 1); await DynamicTheme.of(context)!.setTheme(value ? 3 : 1);
} }
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(
systemNavigationBarColor:
DynamicTheme.of(context)!.theme.colorScheme.surface,
),
);
notifyListeners(); notifyListeners();
} }
@@ -65,10 +72,18 @@ class SettingsViewModel extends BaseViewModel {
await _managerAPI.setUseDarkTheme(value); await _managerAPI.setUseDarkTheme(value);
int currentTheme = DynamicTheme.of(context)!.themeId; int currentTheme = DynamicTheme.of(context)!.themeId;
if (currentTheme < 2) { if (currentTheme < 2) {
DynamicTheme.of(context)!.setTheme(value ? 1 : 0); await DynamicTheme.of(context)!.setTheme(value ? 1 : 0);
} else { } else {
DynamicTheme.of(context)!.setTheme(value ? 3 : 2); await DynamicTheme.of(context)!.setTheme(value ? 3 : 2);
} }
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(
systemNavigationBarColor:
DynamicTheme.of(context)!.theme.colorScheme.surface,
systemNavigationBarIconBrightness:
value ? Brightness.light : Brightness.dark,
),
);
notifyListeners(); notifyListeners();
} }

View File

@@ -0,0 +1,32 @@
import 'package:flutter/material.dart';
class GradientProgressIndicator extends StatefulWidget {
final double? progress;
const GradientProgressIndicator({required this.progress, super.key});
@override
State<GradientProgressIndicator> createState() =>
_GradientProgressIndicatorState();
}
class _GradientProgressIndicatorState extends State<GradientProgressIndicator> {
@override
Widget build(BuildContext context) {
return Align(
alignment: Alignment.centerLeft,
child: AnimatedContainer(
duration: const Duration(milliseconds: 500),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Theme.of(context).colorScheme.primary,
Theme.of(context).colorScheme.secondary,
],
),
),
height: 5,
width: MediaQuery.of(context).size.width * widget.progress!,
),
);
}
}

View File

@@ -6,7 +6,7 @@ import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
import 'package:expandable/expandable.dart'; import 'package:expandable/expandable.dart';
import 'package:timeago/timeago.dart'; import 'package:timeago/timeago.dart';
class ApplicationItem extends StatelessWidget { class ApplicationItem extends StatefulWidget {
final Uint8List icon; final Uint8List icon;
final String name; final String name;
final DateTime patchDate; final DateTime patchDate;
@@ -24,10 +24,39 @@ class ApplicationItem extends StatelessWidget {
required this.onPressed, required this.onPressed,
}) : super(key: key); }) : super(key: key);
@override
State<ApplicationItem> createState() => _ApplicationItemState();
}
class _ApplicationItemState extends State<ApplicationItem>
with TickerProviderStateMixin {
late AnimationController _animationController;
@override
initState() {
super.initState();
_animationController = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 300),
);
}
@override
void dispose() {
_animationController.dispose();
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ExpandableController expController = ExpandableController();
return ExpandablePanel( return ExpandablePanel(
controller: expController,
theme: const ExpandableThemeData( theme: const ExpandableThemeData(
inkWellBorderRadius: BorderRadius.all(Radius.circular(16)),
tapBodyToCollapse: false,
tapBodyToExpand: false,
tapHeaderToExpand: false,
hasIcon: false, hasIcon: false,
animationDuration: Duration(milliseconds: 450), animationDuration: Duration(milliseconds: 450),
), ),
@@ -36,32 +65,44 @@ class ApplicationItem extends StatelessWidget {
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
width: 60, width: 60,
child: Image.memory(icon, height: 39, width: 39), child: Image.memory(widget.icon, height: 39, width: 39),
), ),
const SizedBox(width: 4), const SizedBox(width: 4),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Text(
name, widget.name,
style: const TextStyle( style: const TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
), ),
Text(format(patchDate)), Text(format(widget.patchDate)),
], ],
), ),
const Spacer(), const Spacer(),
RotationTransition(
turns: Tween(begin: 0.0, end: 0.50).animate(_animationController),
child: IconButton(
onPressed: () {
expController.toggle();
_animationController.isCompleted
? _animationController.reverse()
: _animationController.forward();
},
icon: const Icon(Icons.arrow_drop_down),
),
),
Column( Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[ children: <Widget>[
CustomMaterialButton( CustomMaterialButton(
label: isUpdatableApp label: widget.isUpdatableApp
? I18nText('applicationItem.patchButton') ? I18nText('applicationItem.patchButton')
: I18nText('applicationItem.infoButton'), : I18nText('applicationItem.infoButton'),
onPressed: onPressed, onPressed: widget.onPressed,
), ),
], ],
), ),
@@ -82,7 +123,7 @@ class ApplicationItem extends StatelessWidget {
), ),
), ),
const SizedBox(height: 4), const SizedBox(height: 4),
Text('\u2022 ${changelog.join('\n\u2022 ')}'), Text('\u2022 ${widget.changelog.join('\n\u2022 ')}'),
], ],
), ),
), ),

View File

@@ -4,7 +4,7 @@ homepage: https://github.com/revanced/revanced-manager
publish_to: 'none' publish_to: 'none'
version: 0.0.4+4 version: 0.0.7+7
environment: environment:
sdk: ">=2.17.5 <3.0.0" sdk: ">=2.17.5 <3.0.0"
@@ -24,7 +24,10 @@ dependencies:
dynamic_color: ^1.5.4 dynamic_color: ^1.5.4
dynamic_themes: ^1.1.0 dynamic_themes: ^1.1.0
expandable: ^5.0.1 expandable: ^5.0.1
file_picker: ^5.0.1 file_picker:
git:
url: https://github.com/alexmercerind/flutter_file_picker
ref: master
flex_color_scheme: ^6.0.0 flex_color_scheme: ^6.0.0
flutter: flutter:
sdk: flutter sdk: flutter