Skip to content

Commit

Permalink
Truncate left side of underscore from version name; add ellipsis to p…
Browse files Browse the repository at this point in the history
…ackage and version if too large
  • Loading branch information
alesimula committed Nov 9, 2021
1 parent 3cab422 commit f88eb94
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/apk_installer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -297,15 +297,15 @@ class ApkReader {
else if (oldVersionCode != null) {
data.execute(() => GState.apkInstallType.update((_) => (oldVersionCode < versionCode) ? InstallType.UPDATE :
(oldVersionCode > versionCode) ? InstallType.DOWNGRADE : InstallType.REINSTALL));
String oldVersion = insDump.find(r'(^|\n|\s)versionName=\s*([^\n\s$]*)(\s|\n|$)', 2) ?? "???";
String oldVersion = insDump.find(r'(^|\n|\s)versionName=\s*([^\n\s_$]*)', 2) ?? "???";
data.execute(() => GState.oldVersion.update((_) => oldVersion));
}
else data.execute(() => GState.apkInstallType.update((_) => InstallType.INSTALL));
}).onError((_, __) => data.execute(() => GState.apkInstallType.update((_) => InstallType.UNKNOWN)));
}
//else data.execute(() => GState.apkInstallType.update((_) => InstallType.INSTALL));

data.execute(() => GState.version.update((_) => info?.find(r"(^|\n|\s)versionName=\s*'([^'\n\s$]*)", 2) ?? ""));
data.execute(() => GState.version.update((_) => info?.find(r"(^|\n|\s)versionName=\s*'([^'\n\s_$]*)", 2) ?? ""));
data.execute(() => GState.activity.update((_) => dump.find(r"(^|\n)launchable-activity:.*name='([^'\n\s$]*)", 2) ?? ""));

String? application = dump.find(r'(^|\n)application:\s*(.*)');
Expand Down Expand Up @@ -464,7 +464,8 @@ class _ApkInstallerState extends State<ApkInstaller> {
const SizedBox(height: 10),
const Text("Do you want to install this application?"),
const SizedBox(height: 10),
Text("Version: ${oldVersion.isNotEmpty ? '$oldVersion => ' : ''}$version\nPackage: $package", style: TextStyle(color: FluentTheme.of(context).disabledColor) ),
Text("Version:\u00A0${oldVersion.isNotEmpty ? '$oldVersion\u00A0=>\u00A0' : ''}${version.replaceAll(' ', '\u00A0')}", style: TextStyle(color: FluentTheme.of(context).disabledColor), overflow: TextOverflow.ellipsis, maxLines: 1),
Text("Package:\u00A0$package", style: TextStyle(color: FluentTheme.of(context).disabledColor), overflow: TextOverflow.ellipsis, maxLines: 1),
/*ListView(
padding: EdgeInsets.only(
bottom: kPageDefaultVerticalPadding,
Expand Down

0 comments on commit f88eb94

Please sign in to comment.