From 8648c1bea7d9a09462aa73a8480925388240d20d Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Wed, 1 Mar 2023 20:20:34 -0500 Subject: [PATCH 1/3] Added icon for non-installed Apps --- lib/pages/apps.dart | 17 ++++++++++++++++- pubspec.yaml | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/pages/apps.dart b/lib/pages/apps.dart index 8d4f51d..aedbde9 100644 --- a/lib/pages/apps.dart +++ b/lib/pages/apps.dart @@ -264,7 +264,22 @@ class AppsPageState extends State { listedApps[index].installedInfo!.icon!, gaplessPlayback: true, ) - : null, + : Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Transform( + alignment: Alignment.center, + transform: Matrix4.rotationZ(0.31), + child: Image( + image: const AssetImage( + 'assets/graphics/icon.png'), + color: Colors.white.withOpacity(0.1), + colorBlendMode: BlendMode.modulate, + gaplessPlayback: true, + ), + ), + ]), title: Text( maxLines: 1, listedApps[index].installedInfo?.name ?? diff --git a/pubspec.yaml b/pubspec.yaml index 86a1cd0..b948450 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -97,6 +97,7 @@ flutter: assets: - assets/translations/ + - assets/graphics/ # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware From 2e88c8eede2db65eaa48b54fbda93fce416a8b97 Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Wed, 1 Mar 2023 21:37:18 -0500 Subject: [PATCH 2/3] UI improvements Update button for individual apps on list is now an icon. Less clipping on small screens on apps list page. --- lib/pages/apps.dart | 161 +++++++++++++++++++++----------------------- 1 file changed, 78 insertions(+), 83 deletions(-) diff --git a/lib/pages/apps.dart b/lib/pages/apps.dart index aedbde9..9fe11b8 100644 --- a/lib/pages/apps.dart +++ b/lib/pages/apps.dart @@ -233,6 +233,31 @@ class AppsPageState extends State { .getSource(listedApps[index].app.url) .changeLogPageFromStandardUrl(listedApps[index].app.url); var transparent = const Color.fromARGB(0, 0, 0, 0).value; + var hasUpdate = listedApps[index].app.installedVersion != null && + listedApps[index].app.installedVersion != + listedApps[index].app.latestVersion; + var updateButton = IconButton( + visualDensity: VisualDensity.compact, + color: Theme.of(context).colorScheme.primary, + tooltip: + listedApps[index].app.additionalSettings['trackOnly'] == + true + ? tr('markUpdated') + : tr('update'), + onPressed: appsProvider.areDownloadsRunning() + ? null + : () { + appsProvider.downloadAndInstallLatestApps([ + listedApps[index].app.id + ], globalNavigatorKey.currentContext).catchError((e) { + showError(e, context); + }); + }, + icon: Icon( + listedApps[index].app.additionalSettings['trackOnly'] == + true + ? Icons.check_circle_outline + : Icons.install_mobile)); return Container( decoration: BoxDecoration( border: Border.symmetric( @@ -293,21 +318,33 @@ class AppsPageState extends State { ), subtitle: Text( tr('byX', args: [listedApps[index].app.author]), + maxLines: 1, style: TextStyle( + overflow: TextOverflow.ellipsis, fontWeight: listedApps[index].app.pinned ? FontWeight.bold : FontWeight.normal)), - trailing: SingleChildScrollView( - reverse: true, - child: listedApps[index].downloadProgress != null - ? Text(tr('percentProgress', args: [ - listedApps[index] - .downloadProgress - ?.toInt() - .toString() ?? - '100' - ])) - : (Column( + trailing: listedApps[index].downloadProgress != null + ? Text(tr('percentProgress', args: [ + listedApps[index] + .downloadProgress + ?.toInt() + .toString() ?? + '100' + ])) + : (Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + hasUpdate + ? updateButton + : const SizedBox.shrink(), + hasUpdate + ? const SizedBox( + width: 10, + ) + : const SizedBox.shrink(), + Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.end, children: [ @@ -321,80 +358,38 @@ class AppsPageState extends State { '${listedApps[index].app.installedVersion ?? tr('notInstalled')}${listedApps[index].app.additionalSettings['trackOnly'] == true ? ' ${tr('estimateInBrackets')}' : ''}', overflow: TextOverflow.ellipsis, textAlign: TextAlign.end, - )) + )), ]), - GestureDetector( - onTap: changesUrl == null - ? null - : () { - launchUrlString(changesUrl, - mode: LaunchMode - .externalApplication); - }, - child: Text( - listedApps[index].app.releaseDate == - null - ? tr('changes') - : DateFormat('yyyy-MM-dd').format( - listedApps[index] - .app - .releaseDate!), - style: const TextStyle( - fontStyle: FontStyle.italic, - decoration: - TextDecoration.underline), - )), - listedApps[index].app.installedVersion != - null && - listedApps[index] - .app - .installedVersion != - listedApps[index] - .app - .latestVersion - ? appsProvider.areDownloadsRunning() - ? Text(tr('pleaseWait')) - : Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment.end, - children: [ - GestureDetector( - onTap: () { - appsProvider - .downloadAndInstallLatestApps( - [ - listedApps[index] - .app - .id - ], - globalNavigatorKey - .currentContext).catchError( - (e) { - showError(e, context); - }); - }, - child: Text( - listedApps[index] - .app - .additionalSettings[ - 'trackOnly'] == - true - ? tr('markUpdated') - : tr('update'), - style: TextStyle( - color: - Theme.of(context) - .colorScheme - .primary, - fontWeight: - FontWeight.bold), - )), - ], - ) - : const SizedBox.shrink(), + Row( + mainAxisSize: MainAxisSize.min, + children: [ + GestureDetector( + onTap: changesUrl == null + ? null + : () { + launchUrlString(changesUrl, + mode: LaunchMode + .externalApplication); + }, + child: Text( + listedApps[index].app.releaseDate == + null + ? tr('changes') + : DateFormat('yyyy-MM-dd') + .format(listedApps[index] + .app + .releaseDate!), + style: const TextStyle( + fontStyle: FontStyle.italic, + decoration: + TextDecoration.underline), + )) + ], + ), ], - ))), + ) + ], + )), onTap: () { if (selectedApps.isNotEmpty) { toggleAppSelected(listedApps[index].app); From e49c09c0ff14525671facf87b7ba0de4e990d432 Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Wed, 1 Mar 2023 21:55:04 -0500 Subject: [PATCH 3/3] Increment version --- lib/main.dart | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index e992e75..2d79ce8 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -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.11.5'; +const String currentVersion = '0.11.6'; const String currentReleaseTag = 'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES diff --git a/pubspec.yaml b/pubspec.yaml index b948450..ffbcd1d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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.11.5+124 # When changing this, update the tag in main() accordingly +version: 0.11.6+125 # When changing this, update the tag in main() accordingly environment: sdk: '>=2.18.2 <3.0.0'