Android icon indicating copy to clipboard operation
Android copied to clipboard

[Feature] Configurable shortcuts

Open ckardaris opened this issue 2 months ago • 3 comments

Currently, catima will provide a shortcut for the 3 most recently used cards.

It would be useful to one:

  • Make this number configurable
  • Make possible to give priority to favorite cards ahead of the recently used ones. The most recently used order would still be used (if the number of shortcuts is smaller than the number of favorites. In simple terms, the favorite tag would just move this entries higher in the shortcut list. If the number of favorites is smaller than the number of shortcuts, then non-favorite cards should appear in the shortcuts as normal.

I don't think per card configurability (i.e. being able to explicitly set a shortcut for a card) is a must, since in most cases making it a favorite would be enough.

ckardaris avatar Nov 01 '25 19:11 ckardaris

Make this number configurable

Not possible. As per Shortcut limitations: "Most supported launchers display up to four shortcuts at a time, including both static and dynamic shortcuts."

However, I guess it may most likely be safe to change the limit from 3 to 4: https://github.com/CatimaLoyalty/Android/blob/986ae4f0cb21a0cff71ee9114832fd993d792f57/app/src/main/java/protect/card_locker/ShortcutHelper.java#L24-L29

Make possible to give priority to favorite cards ahead of the recently used ones.

I'd rather limit the amount of settings, especially for such minor changes, as when an app gets too many settings it becomes hard to find the setting you need.

However, I think it makes sense to prioritize favourites always. That is probably the behaviour this code would've gotten if it wasn't simply older than the favourites support.

Summarizing, I think these changes would be good:

  1. First list all favourites (no group limit, based on in-app sort order), up to the max limit. If any spaces remain, fill them with recently used cards
  2. Up the limit to 4, as per Google documentation

TheLastProject avatar Nov 01 '25 20:11 TheLastProject

Summarizing, I think these changes would be good:

  1. First list all favourites (no group limit, based on in-app sort order), up to the max limit. If any spaces remain, fill them with recently used cards

I think there is no need to overcomplicate the rules for shortcuts. I see that already the "favorite" cards are displayed first, so maybe it makes sense to always use the main view (i.e. "All"` group) as a feed for the shortcuts. Otherwise, I would consider keeping the "most recently used" rule for favorites in shortcuts as well. It may be counter-intuitive to have in shortcuts:

  • Favorites in in-app order
  • Rest in most recently used order

What do you think?

  1. Up the limit to 4, as per Google documentation

Sounds good.

ckardaris avatar Nov 01 '25 20:11 ckardaris

Using both favourites and others all in most-recently-used makes sense too. Might very well be easier to code too :)

  1. Up the limit to 4, as per Google documentation

Sounds good

Looks like there is actually an API that can be used to count the amount of shortcuts we can use at most: https://developer.android.com/reference/androidx/core/content/pm/ShortcutManagerCompat#getMaxShortcutCountPerActivity(android.content.Context)

TheLastProject avatar Nov 01 '25 20:11 TheLastProject