Scrolling bugfix #392, custom name #420, search archive label #421

This commit is contained in:
Imran Remtulla
2023-04-04 19:59:35 -04:00
parent dea635fa6a
commit e6b05d50b9
5 changed files with 24 additions and 18 deletions

View File

@@ -185,9 +185,11 @@ class GitHub extends AppSource {
Map<String, String> urlsWithDescriptions = {}; Map<String, String> urlsWithDescriptions = {};
for (var e in (jsonDecode(res.body)['items'] as List<dynamic>)) { for (var e in (jsonDecode(res.body)['items'] as List<dynamic>)) {
urlsWithDescriptions.addAll({ urlsWithDescriptions.addAll({
e['html_url'] as String: e['description'] != null e['html_url'] as String:
? e['description'] as String ((e['archived'] == true ? '[ARCHIVED] ' : '') +
: tr('noDescription') (e['description'] != null
? e['description'] as String
: tr('noDescription')))
}); });
} }
return urlsWithDescriptions; return urlsWithDescriptions;

View File

@@ -334,11 +334,10 @@ class _AddAppPageState extends State<AddAppPage> {
], ],
); );
Widget getSourcesListWidget() => Expanded( Widget getSourcesListWidget() => Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, children: [
children: [
const SizedBox( const SizedBox(
height: 48, height: 48,
), ),
@@ -365,16 +364,17 @@ class _AddAppPageState extends State<AddAppPage> {
fontStyle: FontStyle.italic), fontStyle: FontStyle.italic),
))) )))
.toList() .toList()
])); ]);
return Scaffold( return Scaffold(
backgroundColor: Theme.of(context).colorScheme.surface, backgroundColor: Theme.of(context).colorScheme.surface,
body: CustomScrollView(slivers: <Widget>[ body: CustomScrollView(shrinkWrap: true, slivers: <Widget>[
CustomAppBar(title: tr('addApp')), CustomAppBar(title: tr('addApp')),
SliverFillRemaining( SliverToBoxAdapter(
child: Padding( child: Padding(
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
getUrlInputRow(), getUrlInputRow(),

View File

@@ -147,7 +147,7 @@ class _AppPageState extends State<AppPage> {
height: 25, height: 25,
), ),
Text( Text(
app?.installedInfo?.name ?? app?.app.name ?? tr('app'), app?.app.name ?? tr('app'),
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: Theme.of(context).textTheme.displayLarge, style: Theme.of(context).textTheme.displayLarge,
), ),

View File

@@ -670,6 +670,9 @@ class AppsProvider with ChangeNotifier {
for (var app in apps) { for (var app in apps) {
AppInfo? info = await getInstalledInfo(app.id); AppInfo? info = await getInstalledInfo(app.id);
app.name = info?.name ?? app.name; app.name = info?.name ?? app.name;
if (app.additionalSettings['appName']?.toString().isNotEmpty == true) {
app.name = app.additionalSettings['appName'].toString().trim();
}
if (attemptToCorrectInstallStatus) { if (attemptToCorrectInstallStatus) {
app = getCorrectedInstallStatusAppIfPossible(app, info) ?? app; app = getCorrectedInstallStatusAppIfPossible(app, info) ?? app;
} }

View File

@@ -278,7 +278,8 @@ class AppSource {
return regExValidator(value); return regExValidator(value);
} }
]) ])
] ],
[GeneratedFormTextField('appName', label: tr('appName'), required: false)]
]; ];
// Previous 2 variables combined into one at runtime for convenient usage // Previous 2 variables combined into one at runtime for convenient usage
@@ -427,8 +428,10 @@ class SourceProvider {
throw NoAPKError(); throw NoAPKError();
} }
String apkVersion = apk.version.replaceAll('/', '-'); String apkVersion = apk.version.replaceAll('/', '-');
var name = currentApp?.name.trim() ?? var name = currentApp != null ? currentApp.name.trim() : '';
apk.names.name[0].toUpperCase() + apk.names.name.substring(1); name = name.isNotEmpty
? name
: apk.names.name[0].toUpperCase() + apk.names.name.substring(1);
return App( return App(
currentApp?.id ?? currentApp?.id ??
source.tryInferringAppId(standardUrl, source.tryInferringAppId(standardUrl,
@@ -436,9 +439,7 @@ class SourceProvider {
generateTempID(standardUrl, additionalSettings), generateTempID(standardUrl, additionalSettings),
standardUrl, standardUrl,
apk.names.author[0].toUpperCase() + apk.names.author.substring(1), apk.names.author[0].toUpperCase() + apk.names.author.substring(1),
name.trim().isNotEmpty name,
? name
: apk.names.name[0].toUpperCase() + apk.names.name.substring(1),
currentApp?.installedVersion, currentApp?.installedVersion,
apkVersion, apkVersion,
apk.apkUrls, apk.apkUrls,