From c376a7abeca9108e1ff80350a5b4ce634db7acf7 Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Sun, 19 Feb 2023 18:20:28 -0500 Subject: [PATCH 1/3] Longer version names bugfix for apps list UI --- lib/pages/apps.dart | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/pages/apps.dart b/lib/pages/apps.dart index 3ee67c6..e733439 100644 --- a/lib/pages/apps.dart +++ b/lib/pages/apps.dart @@ -266,6 +266,7 @@ class AppsPageState extends State { ) : null, title: Text( + maxLines: 1, listedApps[index].installedInfo?.name ?? listedApps[index].app.name, style: TextStyle( @@ -298,11 +299,14 @@ class AppsPageState extends State { Row( mainAxisSize: MainAxisSize.min, children: [ - Text( - '${listedApps[index].app.installedVersion ?? tr('notInstalled')}${listedApps[index].app.additionalSettings['trackOnly'] == true ? ' ${tr('estimateInBrackets')}' : ''}', - overflow: TextOverflow.ellipsis, - textAlign: TextAlign.end, - ) + Container( + constraints: const BoxConstraints( + maxWidth: 150), + child: Text( + '${listedApps[index].app.installedVersion ?? tr('notInstalled')}${listedApps[index].app.additionalSettings['trackOnly'] == true ? ' ${tr('estimateInBrackets')}' : ''}', + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.end, + )) ]), GestureDetector( onTap: changesUrl == null From b57f023739f6950d2cbf2e2b548b35ff9eaff64f Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Sun, 19 Feb 2023 18:46:30 -0500 Subject: [PATCH 2/3] Added prev. rel. and regex title filter support to APKMirror --- lib/app_sources/apkmirror.dart | 45 +++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/lib/app_sources/apkmirror.dart b/lib/app_sources/apkmirror.dart index cf4721a..6905023 100644 --- a/lib/app_sources/apkmirror.dart +++ b/lib/app_sources/apkmirror.dart @@ -1,7 +1,9 @@ import 'dart:io'; +import 'package:easy_localization/easy_localization.dart'; import 'package:html/parser.dart'; import 'package:http/http.dart'; +import 'package:obtainium/components/generated_form.dart'; import 'package:obtainium/custom_errors.dart'; import 'package:obtainium/providers/source_provider.dart'; @@ -9,6 +11,23 @@ class APKMirror extends AppSource { APKMirror() { host = 'apkmirror.com'; enforceTrackOnly = true; + + additionalSourceAppSpecificSettingFormItems = [ + [ + GeneratedFormSwitch('fallbackToOlderReleases', + label: tr('fallbackToOlderReleases'), defaultValue: true) + ], + [ + GeneratedFormTextField('filterReleaseTitlesByRegEx', + label: tr('filterReleaseTitlesByRegEx'), + required: false, + additionalValidators: [ + (value) { + return regExValidator(value); + } + ]) + ] + ]; } @override @@ -30,11 +49,31 @@ class APKMirror extends AppSource { String standardUrl, Map additionalSettings, ) async { + bool fallbackToOlderReleases = + additionalSettings['fallbackToOlderReleases'] == true; + String? regexFilter = + (additionalSettings['filterReleaseTitlesByRegEx'] as String?) + ?.isNotEmpty == + true + ? additionalSettings['filterReleaseTitlesByRegEx'] + : null; Response res = await get(Uri.parse('$standardUrl/feed')); if (res.statusCode == 200) { - var item = parse(res.body).querySelector('item'); - String? titleString = item?.querySelector('title')?.innerHtml; - String? dateString = item + var items = parse(res.body).querySelectorAll('item'); + dynamic targetRelease; + for (int i = 0; i < items.length; i++) { + if (!fallbackToOlderReleases && i > 0) break; + String? nameToFilter = items[i].querySelector('title')?.innerHtml; + if (regexFilter != null && + nameToFilter != null && + !RegExp(regexFilter).hasMatch(nameToFilter.trim())) { + continue; + } + targetRelease = items[i]; + break; + } + String? titleString = targetRelease?.querySelector('title')?.innerHtml; + String? dateString = targetRelease ?.querySelector('pubDate') ?.innerHtml .split(' ') From a2879f5bfa548b80510dcdfa2d3bf5673111dfe4 Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Sun, 19 Feb 2023 18:48:21 -0500 Subject: [PATCH 3/3] Increment version, update package --- lib/main.dart | 2 +- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index ff32826..bd13b3e 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.0'; +const String currentVersion = '0.11.1'; const String currentReleaseTag = 'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES diff --git a/pubspec.lock b/pubspec.lock index cab96e0..5434aa0 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -830,10 +830,10 @@ packages: dependency: "direct main" description: name: webview_flutter - sha256: f7ec234830f86d0ef2bd664e8460b0038b8c1a83ff076035cad74ac70273753c + sha256: dad1f2caa3272071275436984eb123276a6810dbe7cd6f4c60697640b56a4699 url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.0.4" webview_flutter_android: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index bdceeff..019ad6e 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.0+119 # When changing this, update the tag in main() accordingly +version: 0.11.1+120 # When changing this, update the tag in main() accordingly environment: sdk: '>=2.18.2 <3.0.0'