[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:
Alexander Borsuk
2025-06-07 10:18:27 +02:00
committed by Konstantin Pastbin
parent aa71668eab
commit 9ad94eb95c

View File

@@ -74,7 +74,7 @@ class CategoriesAdapter extends RecyclerView.Adapter<CategoriesAdapter.ViewHolde
final Activity activity = fragment.requireActivity();
final String packageName = activity.getPackageName();
final String[] keys = getAllCategories();
final String[] keys = DisplayedCategories.nativeGetKeys();
final int numKeys = keys.length;
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")
@StringRes
private static int getStringResIdByKey(@NonNull Resources resources, @NonNull String packageName,