mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-06 12:34:24 +00:00
[android] Fixed unnecessary overhead when showing search categories
The filtering was related to virtual "promo" categories that are not used anymore Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
committed by
Konstantin Pastbin
parent
aa71668eab
commit
9ad94eb95c
@@ -74,7 +74,7 @@ class CategoriesAdapter extends RecyclerView.Adapter<CategoriesAdapter.ViewHolde
|
|||||||
final Activity activity = fragment.requireActivity();
|
final Activity activity = fragment.requireActivity();
|
||||||
final String packageName = activity.getPackageName();
|
final String packageName = activity.getPackageName();
|
||||||
|
|
||||||
final String[] keys = getAllCategories();
|
final String[] keys = DisplayedCategories.nativeGetKeys();
|
||||||
final int numKeys = keys.length;
|
final int numKeys = keys.length;
|
||||||
|
|
||||||
mCategoryResIds = new int[numKeys];
|
mCategoryResIds = new int[numKeys];
|
||||||
@@ -93,25 +93,6 @@ class CategoriesAdapter extends RecyclerView.Adapter<CategoriesAdapter.ViewHolde
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
|
||||||
private static String[] getAllCategories()
|
|
||||||
{
|
|
||||||
String[] searchCategories = DisplayedCategories.nativeGetKeys();
|
|
||||||
int amountSize = searchCategories.length;
|
|
||||||
String[] allCategories = new String[amountSize];
|
|
||||||
|
|
||||||
for (int i = 0, j = 0; i < amountSize; i++)
|
|
||||||
{
|
|
||||||
if (allCategories[i] == null)
|
|
||||||
{
|
|
||||||
allCategories[i] = searchCategories[j];
|
|
||||||
j++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return allCategories;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressLint("DiscouragedApi")
|
@SuppressLint("DiscouragedApi")
|
||||||
@StringRes
|
@StringRes
|
||||||
private static int getStringResIdByKey(@NonNull Resources resources, @NonNull String packageName,
|
private static int getStringResIdByKey(@NonNull Resources resources, @NonNull String packageName,
|
||||||
|
|||||||
Reference in New Issue
Block a user