Make page transition animation optional (#683)

This commit is contained in:
Imran Remtulla
2023-07-16 11:36:49 -04:00
parent 785bba1f45
commit 6b16857186
16 changed files with 42 additions and 2 deletions

View File

@@ -237,6 +237,7 @@
"removeOnExternalUninstall": "Automatically remove externally uninstalled Apps",
"pickHighestVersionCode": "Auto-select highest version code APK",
"checkUpdateOnDetailPage": "Check for updates on opening an App detail page",
"disablePageTransitions": "Disable page transition animations",
"removeAppQuestion": {
"one": "App entfernen?",
"other": "Apps entfernen?"

View File

@@ -237,6 +237,7 @@
"removeOnExternalUninstall": "Automatically remove externally uninstalled Apps",
"pickHighestVersionCode": "Auto-select highest version code APK",
"checkUpdateOnDetailPage": "Check for updates on opening an App detail page",
"disablePageTransitions": "Disable page transition animations",
"removeAppQuestion": {
"one": "Remove App?",
"other": "Remove Apps?"

View File

@@ -237,6 +237,7 @@
"removeOnExternalUninstall": "Automatically remove externally uninstalled Apps",
"pickHighestVersionCode": "Auto-select highest version code APK",
"checkUpdateOnDetailPage": "Check for updates on opening an App detail page",
"disablePageTransitions": "Disable page transition animations",
"removeAppQuestion": {
"one": "¿Eliminar Aplicación?",
"other": "¿Eliminar Aplicaciones?"

View File

@@ -237,6 +237,7 @@
"removeOnExternalUninstall": "Automatically remove externally uninstalled Apps",
"pickHighestVersionCode": "Auto-select highest version code APK",
"checkUpdateOnDetailPage": "Check for updates on opening an App detail page",
"disablePageTransitions": "Disable page transition animations",
"removeAppQuestion": {
"one": "برنامه حذف شود؟",
"other": "برنامه ها حذف شوند؟"

View File

@@ -237,6 +237,7 @@
"removeOnExternalUninstall": "Automatically remove externally uninstalled Apps",
"pickHighestVersionCode": "Auto-select highest version code APK",
"checkUpdateOnDetailPage": "Check for updates on opening an App detail page",
"disablePageTransitions": "Disable page transition animations",
"removeAppQuestion": {
"one": "Supprimer l'application ?",
"other": "Supprimer les applications ?"

View File

@@ -236,6 +236,7 @@
"removeOnExternalUninstall": "A külsőleg eltávolított appok auto. eltávolítása",
"pickHighestVersionCode": "A legmagasabb verziószámú APK auto. kiválasztása",
"checkUpdateOnDetailPage": "Frissítések keresése az app részleteit tartalmazó oldal megnyitásakor",
"disablePageTransitions": "Disable page transition animations",
"removeAppQuestion": {
"one": "Eltávolítja az alkalmazást?",
"other": "Eltávolítja az alkalmazást?"

View File

@@ -237,6 +237,7 @@
"removeOnExternalUninstall": "Automatically remove externally uninstalled Apps",
"pickHighestVersionCode": "Auto-select highest version code APK",
"checkUpdateOnDetailPage": "Check for updates on opening an App detail page",
"disablePageTransitions": "Disable page transition animations",
"removeAppQuestion": {
"one": "Rimuovere l'app?",
"other": "Rimuovere le app?"

View File

@@ -237,6 +237,7 @@
"removeOnExternalUninstall": "外部でアンインストールされたアプリを自動的に削除する",
"pickHighestVersionCode": "最も高いバージョンコードのAPKを自動的に選択する",
"checkUpdateOnDetailPage": "アプリの詳細ページを開く際にアップデートを確認する",
"disablePageTransitions": "Disable page transition animations",
"removeAppQuestion": {
"one": "アプリを削除しますか?",
"other": "アプリを削除しますか?"

View File

@@ -241,6 +241,7 @@
"removeOnExternalUninstall": "Automatyczne usuń odinstalowane zewnętrznie aplikacje",
"pickHighestVersionCode": "Automatycznie wybierz najwyższy kod wersji APK",
"checkUpdateOnDetailPage": "Sprawdzaj aktualizacje podczas otwierania strony szczegółów aplikacji",
"disablePageTransitions": "Disable page transition animations",
"removeAppQuestion": {
"one": "Usunąć aplikację?",
"other": "Usunąć aplikacje?"

View File

@@ -237,6 +237,7 @@
"removeOnExternalUninstall": "Автоматически убирать из списка удаленные извне приложения",
"pickHighestVersionCode": "Автовыбор кода наивысшей версии APK",
"checkUpdateOnDetailPage": "Проверять наличие обновлений при открытии страницы представления приложения",
"disablePageTransitions": "Disable page transition animations",
"removeAppQuestion": {
"one": "Удалить приложение?",
"other": "Удалить приложения?"

View File

@@ -237,6 +237,7 @@
"removeOnExternalUninstall": "Automatically remove externally uninstalled Apps",
"pickHighestVersionCode": "Auto-select highest version code APK",
"checkUpdateOnDetailPage": "Check for updates on opening an App detail page",
"disablePageTransitions": "Disable page transition animations",
"removeAppQuestion": {
"one": "是否删除应用?",
"other": "是否删除应用?"

View File

@@ -21,7 +21,7 @@ import 'package:easy_localization/src/easy_localization_controller.dart';
// ignore: implementation_imports
import 'package:easy_localization/src/localization.dart';
const String currentVersion = '0.13.17';
const String currentVersion = '0.13.18';
const String currentReleaseTag =
'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES

View File

@@ -7,6 +7,7 @@ import 'package:obtainium/pages/apps.dart';
import 'package:obtainium/pages/import_export.dart';
import 'package:obtainium/pages/settings.dart';
import 'package:obtainium/providers/apps_provider.dart';
import 'package:obtainium/providers/settings_provider.dart';
import 'package:provider/provider.dart';
class HomePage extends StatefulWidget {
@@ -42,6 +43,7 @@ class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
AppsProvider appsProvider = context.watch<AppsProvider>();
SettingsProvider settingsProvider = context.watch<SettingsProvider>();
setIsReversing(int targetIndex) {
bool reversing = selectedIndexHistory.isNotEmpty &&
@@ -89,6 +91,9 @@ class _HomePageState extends State<HomePage> {
child: Scaffold(
backgroundColor: Theme.of(context).colorScheme.surface,
body: PageTransitionSwitcher(
duration: Duration(
milliseconds:
settingsProvider.disablePageTransitions ? 0 : 300),
reverse: isReversing,
transitionBuilder: (
Widget child,

View File

@@ -396,6 +396,21 @@ class _SettingsPageState extends State<SettingsPage> {
})
],
),
height16,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Flexible(
child: Text(tr('disablePageTransitions'))),
Switch(
value:
settingsProvider.disablePageTransitions,
onChanged: (value) {
settingsProvider.disablePageTransitions =
value;
})
],
),
height32,
Text(
tr('categories'),

View File

@@ -291,4 +291,13 @@ class SettingsProvider with ChangeNotifier {
prefs?.setBool('checkUpdateOnDetailPage', show);
notifyListeners();
}
bool get disablePageTransitions {
return prefs?.getBool('disablePageTransitions') ?? false;
}
set disablePageTransitions(bool show) {
prefs?.setBool('disablePageTransitions', show);
notifyListeners();
}
}

View File

@@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 0.13.17+181 # When changing this, update the tag in main() accordingly
version: 0.13.18+182 # When changing this, update the tag in main() accordingly
environment:
sdk: '>=2.18.2 <3.0.0'