mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-10-22 10:23:45 +02:00
Merge pull request #568 from ImranR98/dev
App ID Filter (#564), Apps Page Bottom Buttons Menu UI Changes
This commit is contained in:
@@ -180,6 +180,7 @@
|
|||||||
"yesMarkUpdated": "Ja, als aktualisiert markieren",
|
"yesMarkUpdated": "Ja, als aktualisiert markieren",
|
||||||
"fdroid": "F-Droid Official",
|
"fdroid": "F-Droid Official",
|
||||||
"appIdOrName": "App ID oder Name",
|
"appIdOrName": "App ID oder Name",
|
||||||
|
"appId": "App ID",
|
||||||
"appWithIdOrNameNotFound": "Es wurde keine App mit dieser ID oder diesem Namen gefunden",
|
"appWithIdOrNameNotFound": "Es wurde keine App mit dieser ID oder diesem Namen gefunden",
|
||||||
"reposHaveMultipleApps": "Repos können mehrere Apps enthalten",
|
"reposHaveMultipleApps": "Repos können mehrere Apps enthalten",
|
||||||
"fdroidThirdPartyRepo": "F-Droid Third-Party Repo",
|
"fdroidThirdPartyRepo": "F-Droid Third-Party Repo",
|
||||||
|
@@ -180,6 +180,7 @@
|
|||||||
"yesMarkUpdated": "Yes, Mark as Updated",
|
"yesMarkUpdated": "Yes, Mark as Updated",
|
||||||
"fdroid": "F-Droid Official",
|
"fdroid": "F-Droid Official",
|
||||||
"appIdOrName": "App ID or Name",
|
"appIdOrName": "App ID or Name",
|
||||||
|
"appId": "App ID",
|
||||||
"appWithIdOrNameNotFound": "No App was found with that ID or Name",
|
"appWithIdOrNameNotFound": "No App was found with that ID or Name",
|
||||||
"reposHaveMultipleApps": "Repos may contain multiple Apps",
|
"reposHaveMultipleApps": "Repos may contain multiple Apps",
|
||||||
"fdroidThirdPartyRepo": "F-Droid Third-Party Repo",
|
"fdroidThirdPartyRepo": "F-Droid Third-Party Repo",
|
||||||
|
@@ -180,6 +180,7 @@
|
|||||||
"yesMarkUpdated": "Sí, Marcar como Actualizada",
|
"yesMarkUpdated": "Sí, Marcar como Actualizada",
|
||||||
"fdroid": "Repositorio oficial de F-Droid",
|
"fdroid": "Repositorio oficial de F-Droid",
|
||||||
"appIdOrName": "ID o Nombre de la Aplicación",
|
"appIdOrName": "ID o Nombre de la Aplicación",
|
||||||
|
"appId": "ID de la Aplicación",
|
||||||
"appWithIdOrNameNotFound": "No se han encontrado aplicaciones con esa ID o nombre",
|
"appWithIdOrNameNotFound": "No se han encontrado aplicaciones con esa ID o nombre",
|
||||||
"reposHaveMultipleApps": "Los repositorios pueden contener varias aplicaciones",
|
"reposHaveMultipleApps": "Los repositorios pueden contener varias aplicaciones",
|
||||||
"fdroidThirdPartyRepo": "Rpositorios de terceros de F-Droid",
|
"fdroidThirdPartyRepo": "Rpositorios de terceros de F-Droid",
|
||||||
|
@@ -180,6 +180,7 @@
|
|||||||
"yesMarkUpdated": "بله، علامت گذاری به عنوان به روز شده",
|
"yesMarkUpdated": "بله، علامت گذاری به عنوان به روز شده",
|
||||||
"fdroid": "F-Droid Official",
|
"fdroid": "F-Droid Official",
|
||||||
"appIdOrName": "شناسه یا نام برنامه",
|
"appIdOrName": "شناسه یا نام برنامه",
|
||||||
|
"appId": "App ID",
|
||||||
"appWithIdOrNameNotFound": "هیچ برنامه ای با آن شناسه یا نام یافت نشد",
|
"appWithIdOrNameNotFound": "هیچ برنامه ای با آن شناسه یا نام یافت نشد",
|
||||||
"reposHaveMultipleApps": "مخازن ممکن است شامل چندین برنامه باشد",
|
"reposHaveMultipleApps": "مخازن ممکن است شامل چندین برنامه باشد",
|
||||||
"fdroidThirdPartyRepo": "مخازن شخص ثالث F-Droid",
|
"fdroidThirdPartyRepo": "مخازن شخص ثالث F-Droid",
|
||||||
|
@@ -180,6 +180,7 @@
|
|||||||
"yesMarkUpdated": "Oui, marquer comme mis à jour",
|
"yesMarkUpdated": "Oui, marquer comme mis à jour",
|
||||||
"fdroid": "F-Droid Official",
|
"fdroid": "F-Droid Official",
|
||||||
"appIdOrName": "ID ou nom de l'application",
|
"appIdOrName": "ID ou nom de l'application",
|
||||||
|
"appId": "ID de l'application",
|
||||||
"appWithIdOrNameNotFound": "Aucune application n'a été trouvée avec cet identifiant ou ce nom",
|
"appWithIdOrNameNotFound": "Aucune application n'a été trouvée avec cet identifiant ou ce nom",
|
||||||
"reposHaveMultipleApps": "Les dépôts peuvent contenir plusieurs applications",
|
"reposHaveMultipleApps": "Les dépôts peuvent contenir plusieurs applications",
|
||||||
"fdroidThirdPartyRepo": "Dépôt tiers F-Droid",
|
"fdroidThirdPartyRepo": "Dépôt tiers F-Droid",
|
||||||
|
@@ -180,6 +180,7 @@
|
|||||||
"yesMarkUpdated": "Igen, megjelölés frissítettként",
|
"yesMarkUpdated": "Igen, megjelölés frissítettként",
|
||||||
"fdroid": "F-Droid Official",
|
"fdroid": "F-Droid Official",
|
||||||
"appIdOrName": "App ID vagy név",
|
"appIdOrName": "App ID vagy név",
|
||||||
|
"appId": "App ID",
|
||||||
"appWithIdOrNameNotFound": "Nem található app ezzel az azonosítóval vagy névvel",
|
"appWithIdOrNameNotFound": "Nem található app ezzel az azonosítóval vagy névvel",
|
||||||
"reposHaveMultipleApps": "A repók több alkalmazást is tartalmazhatnak",
|
"reposHaveMultipleApps": "A repók több alkalmazást is tartalmazhatnak",
|
||||||
"fdroidThirdPartyRepo": "F-Droid Harmadik-fél Repo",
|
"fdroidThirdPartyRepo": "F-Droid Harmadik-fél Repo",
|
||||||
|
@@ -180,6 +180,7 @@
|
|||||||
"yesMarkUpdated": "Sì, contrassegna come aggiornato",
|
"yesMarkUpdated": "Sì, contrassegna come aggiornato",
|
||||||
"fdroid": "F-Droid Official",
|
"fdroid": "F-Droid Official",
|
||||||
"appIdOrName": "ID o nome dell'App",
|
"appIdOrName": "ID o nome dell'App",
|
||||||
|
"appId": "ID dell'App",
|
||||||
"appWithIdOrNameNotFound": "Non è stata trovata alcuna App con quell'ID o nome",
|
"appWithIdOrNameNotFound": "Non è stata trovata alcuna App con quell'ID o nome",
|
||||||
"reposHaveMultipleApps": "I repository possono contenere più App",
|
"reposHaveMultipleApps": "I repository possono contenere più App",
|
||||||
"fdroidThirdPartyRepo": "Repository F-Droid di terze parti",
|
"fdroidThirdPartyRepo": "Repository F-Droid di terze parti",
|
||||||
|
@@ -180,6 +180,7 @@
|
|||||||
"yesMarkUpdated": "はい、アップデート済みとしてマークします",
|
"yesMarkUpdated": "はい、アップデート済みとしてマークします",
|
||||||
"fdroid": "F-Droid Official",
|
"fdroid": "F-Droid Official",
|
||||||
"appIdOrName": "アプリのIDまたは名前",
|
"appIdOrName": "アプリのIDまたは名前",
|
||||||
|
"appId": "App ID",
|
||||||
"appWithIdOrNameNotFound": "そのIDや名前を持つアプリは見つかりませんでした",
|
"appWithIdOrNameNotFound": "そのIDや名前を持つアプリは見つかりませんでした",
|
||||||
"reposHaveMultipleApps": "リポジトリには複数のアプリが含まれることがあります",
|
"reposHaveMultipleApps": "リポジトリには複数のアプリが含まれることがあります",
|
||||||
"fdroidThirdPartyRepo": "F-Droid サードパーティリポジトリ",
|
"fdroidThirdPartyRepo": "F-Droid サードパーティリポジトリ",
|
||||||
|
@@ -180,6 +180,7 @@
|
|||||||
"yesMarkUpdated": "是,标记为已更新",
|
"yesMarkUpdated": "是,标记为已更新",
|
||||||
"fdroid": "F-Droid 官方存储库",
|
"fdroid": "F-Droid 官方存储库",
|
||||||
"appIdOrName": "应用 ID 或名称",
|
"appIdOrName": "应用 ID 或名称",
|
||||||
|
"appId": "App ID",
|
||||||
"appWithIdOrNameNotFound": "未找到符合此 ID 或名称的应用",
|
"appWithIdOrNameNotFound": "未找到符合此 ID 或名称的应用",
|
||||||
"reposHaveMultipleApps": "存储库中可能包含多个应用",
|
"reposHaveMultipleApps": "存储库中可能包含多个应用",
|
||||||
"fdroidThirdPartyRepo": "F-Droid 第三方存储库",
|
"fdroidThirdPartyRepo": "F-Droid 第三方存储库",
|
||||||
|
@@ -61,8 +61,6 @@ class AppsPageState extends State<AppsPage> {
|
|||||||
var settingsProvider = context.watch<SettingsProvider>();
|
var settingsProvider = context.watch<SettingsProvider>();
|
||||||
var sourceProvider = SourceProvider();
|
var sourceProvider = SourceProvider();
|
||||||
var listedApps = appsProvider.getAppValues().toList();
|
var listedApps = appsProvider.getAppValues().toList();
|
||||||
var currentFilterIsUpdatesOnly =
|
|
||||||
filter.isIdenticalTo(updatesOnlyFilter, settingsProvider);
|
|
||||||
|
|
||||||
refresh() {
|
refresh() {
|
||||||
HapticFeedback.lightImpact();
|
HapticFeedback.lightImpact();
|
||||||
@@ -129,6 +127,11 @@ class AppsPageState extends State<AppsPage> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (filter.idFilter.isNotEmpty) {
|
||||||
|
if (!app.app.id.contains(filter.idFilter)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (filter.categoryFilter.isNotEmpty &&
|
if (filter.categoryFilter.isNotEmpty &&
|
||||||
filter.categoryFilter
|
filter.categoryFilter
|
||||||
.intersection(app.app.categories.toSet())
|
.intersection(app.app.categories.toSet())
|
||||||
@@ -882,10 +885,17 @@ class AppsPageState extends State<AppsPage> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getMainBottomButtonsRow() {
|
getMainBottomButtons() {
|
||||||
return Row(
|
return [
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
IconButton(
|
||||||
children: [
|
visualDensity: VisualDensity.compact,
|
||||||
|
onPressed: getMassObtainFunction(),
|
||||||
|
tooltip: selectedAppIds.isEmpty
|
||||||
|
? tr('installUpdateApps')
|
||||||
|
: tr('installUpdateSelectedApps'),
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.file_download_outlined,
|
||||||
|
)),
|
||||||
IconButton(
|
IconButton(
|
||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
onPressed: selectedAppIds.isEmpty
|
onPressed: selectedAppIds.isEmpty
|
||||||
@@ -897,15 +907,6 @@ class AppsPageState extends State<AppsPage> {
|
|||||||
tooltip: tr('removeSelectedApps'),
|
tooltip: tr('removeSelectedApps'),
|
||||||
icon: const Icon(Icons.delete_outline_outlined),
|
icon: const Icon(Icons.delete_outline_outlined),
|
||||||
),
|
),
|
||||||
IconButton(
|
|
||||||
visualDensity: VisualDensity.compact,
|
|
||||||
onPressed: getMassObtainFunction(),
|
|
||||||
tooltip: selectedAppIds.isEmpty
|
|
||||||
? tr('installUpdateApps')
|
|
||||||
: tr('installUpdateSelectedApps'),
|
|
||||||
icon: const Icon(
|
|
||||||
Icons.file_download_outlined,
|
|
||||||
)),
|
|
||||||
IconButton(
|
IconButton(
|
||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
onPressed: selectedAppIds.isEmpty ? null : launchCategorizeDialog(),
|
onPressed: selectedAppIds.isEmpty ? null : launchCategorizeDialog(),
|
||||||
@@ -918,8 +919,7 @@ class AppsPageState extends State<AppsPage> {
|
|||||||
tooltip: tr('more'),
|
tooltip: tr('more'),
|
||||||
icon: const Icon(Icons.more_horiz),
|
icon: const Icon(Icons.more_horiz),
|
||||||
),
|
),
|
||||||
],
|
];
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
showFilterDialog() async {
|
showFilterDialog() async {
|
||||||
@@ -941,6 +941,12 @@ class AppsPageState extends State<AppsPage> {
|
|||||||
required: false,
|
required: false,
|
||||||
defaultValue: vals['author'])
|
defaultValue: vals['author'])
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
GeneratedFormTextField('appId',
|
||||||
|
label: tr('appId'),
|
||||||
|
required: false,
|
||||||
|
defaultValue: vals['appId'])
|
||||||
|
],
|
||||||
[
|
[
|
||||||
GeneratedFormSwitch('upToDateApps',
|
GeneratedFormSwitch('upToDateApps',
|
||||||
label: tr('upToDateApps'),
|
label: tr('upToDateApps'),
|
||||||
@@ -986,50 +992,33 @@ class AppsPageState extends State<AppsPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getFilterButtonsRow() {
|
getFilterButtonsRow() {
|
||||||
|
var isFilterOff = filter.isIdenticalTo(neutralFilter, settingsProvider);
|
||||||
return Row(
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
getSelectAllButton(),
|
getSelectAllButton(),
|
||||||
const VerticalDivider(),
|
|
||||||
Expanded(
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
scrollDirection: Axis.horizontal,
|
|
||||||
child: getMainBottomButtonsRow())),
|
|
||||||
const VerticalDivider(),
|
|
||||||
IconButton(
|
IconButton(
|
||||||
visualDensity: VisualDensity.compact,
|
color: Theme.of(context).colorScheme.primary,
|
||||||
onPressed: () {
|
style: const ButtonStyle(visualDensity: VisualDensity.compact),
|
||||||
|
tooltip: isFilterOff ? tr('filter') : tr('filterActive'),
|
||||||
|
onPressed: isFilterOff
|
||||||
|
? showFilterDialog
|
||||||
|
: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
if (currentFilterIsUpdatesOnly) {
|
|
||||||
filter = AppsFilter();
|
filter = AppsFilter();
|
||||||
} else {
|
|
||||||
filter = updatesOnlyFilter;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
tooltip: currentFilterIsUpdatesOnly
|
icon: Icon(isFilterOff
|
||||||
? tr('removeOutdatedFilter')
|
? Icons.filter_list_rounded
|
||||||
: tr('showOutdatedOnly'),
|
: Icons.filter_list_off_rounded)),
|
||||||
icon: Icon(
|
const SizedBox(
|
||||||
currentFilterIsUpdatesOnly
|
width: 10,
|
||||||
? Icons.update_disabled_rounded
|
|
||||||
: Icons.update_rounded,
|
|
||||||
color: Theme.of(context).colorScheme.primary,
|
|
||||||
),
|
),
|
||||||
),
|
const VerticalDivider(),
|
||||||
TextButton.icon(
|
Expanded(
|
||||||
style: const ButtonStyle(visualDensity: VisualDensity.compact),
|
child: Row(
|
||||||
label: Text(
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
filter.isIdenticalTo(neutralFilter, settingsProvider)
|
children: getMainBottomButtons(),
|
||||||
? tr('filter')
|
)),
|
||||||
: tr('filterActive'),
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight:
|
|
||||||
filter.isIdenticalTo(neutralFilter, settingsProvider)
|
|
||||||
? FontWeight.normal
|
|
||||||
: FontWeight.bold),
|
|
||||||
),
|
|
||||||
onPressed: showFilterDialog,
|
|
||||||
icon: const Icon(Icons.filter_list_rounded))
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1072,6 +1061,7 @@ class AppsPageState extends State<AppsPage> {
|
|||||||
class AppsFilter {
|
class AppsFilter {
|
||||||
late String nameFilter;
|
late String nameFilter;
|
||||||
late String authorFilter;
|
late String authorFilter;
|
||||||
|
late String idFilter;
|
||||||
late bool includeUptodate;
|
late bool includeUptodate;
|
||||||
late bool includeNonInstalled;
|
late bool includeNonInstalled;
|
||||||
late Set<String> categoryFilter;
|
late Set<String> categoryFilter;
|
||||||
@@ -1080,6 +1070,7 @@ class AppsFilter {
|
|||||||
AppsFilter(
|
AppsFilter(
|
||||||
{this.nameFilter = '',
|
{this.nameFilter = '',
|
||||||
this.authorFilter = '',
|
this.authorFilter = '',
|
||||||
|
this.idFilter = '',
|
||||||
this.includeUptodate = true,
|
this.includeUptodate = true,
|
||||||
this.includeNonInstalled = true,
|
this.includeNonInstalled = true,
|
||||||
this.categoryFilter = const {},
|
this.categoryFilter = const {},
|
||||||
@@ -1089,6 +1080,7 @@ class AppsFilter {
|
|||||||
return {
|
return {
|
||||||
'appName': nameFilter,
|
'appName': nameFilter,
|
||||||
'author': authorFilter,
|
'author': authorFilter,
|
||||||
|
'appId': idFilter,
|
||||||
'upToDateApps': includeUptodate,
|
'upToDateApps': includeUptodate,
|
||||||
'nonInstalledApps': includeNonInstalled,
|
'nonInstalledApps': includeNonInstalled,
|
||||||
'sourceFilter': sourceFilter
|
'sourceFilter': sourceFilter
|
||||||
@@ -1098,6 +1090,7 @@ class AppsFilter {
|
|||||||
setFormValuesFromMap(Map<String, dynamic> values) {
|
setFormValuesFromMap(Map<String, dynamic> values) {
|
||||||
nameFilter = values['appName']!;
|
nameFilter = values['appName']!;
|
||||||
authorFilter = values['author']!;
|
authorFilter = values['author']!;
|
||||||
|
idFilter = values['appId']!;
|
||||||
includeUptodate = values['upToDateApps'];
|
includeUptodate = values['upToDateApps'];
|
||||||
includeNonInstalled = values['nonInstalledApps'];
|
includeNonInstalled = values['nonInstalledApps'];
|
||||||
sourceFilter = values['sourceFilter'];
|
sourceFilter = values['sourceFilter'];
|
||||||
@@ -1106,6 +1099,7 @@ class AppsFilter {
|
|||||||
bool isIdenticalTo(AppsFilter other, SettingsProvider settingsProvider) =>
|
bool isIdenticalTo(AppsFilter other, SettingsProvider settingsProvider) =>
|
||||||
authorFilter.trim() == other.authorFilter.trim() &&
|
authorFilter.trim() == other.authorFilter.trim() &&
|
||||||
nameFilter.trim() == other.nameFilter.trim() &&
|
nameFilter.trim() == other.nameFilter.trim() &&
|
||||||
|
idFilter.trim() == other.idFilter.trim() &&
|
||||||
includeUptodate == other.includeUptodate &&
|
includeUptodate == other.includeUptodate &&
|
||||||
includeNonInstalled == other.includeNonInstalled &&
|
includeNonInstalled == other.includeNonInstalled &&
|
||||||
settingsProvider.setEqual(categoryFilter, other.categoryFilter) &&
|
settingsProvider.setEqual(categoryFilter, other.categoryFilter) &&
|
||||||
|
Reference in New Issue
Block a user