Suggestion: add launcher shortcut(s) #80

Closed
opened 2 months ago by eUgEntOptIc44 · 9 comments

TL;DR: adding shortcuts that appear on long-pressing the app's symbol in the device app launcher -> probably out-of-scope

Hi 👋,

today I first heared about the technical backgrounds of the android 'app shortcuts' -> the buttons appearing when long-pressing the app's symbol in the device app launcher. -> See black box in image below.

app shortcuts example from the android dev docs
image courtesy of google inc. (->source)

As far as I understood this is about defining 'shortcuts' using intents in a shortcuts.xml resource file. (->source)

So by adding a intent to open the weatherwarning activity it should be able to be added as a shortcut to shortcuts.xml.

**TL;DR:** adding shortcuts that appear on long-pressing the app's symbol in the device app launcher -> probably out-of-scope Hi 👋, today I first heared about the technical backgrounds of the android 'app shortcuts' -> the buttons appearing when long-pressing the app's symbol in the device app launcher. -> See black box in image below. ![app shortcuts example from the android dev docs](https://codeberg.org/attachments/4fe2d587-994c-49b9-aba3-3269c652fc19) image courtesy of google inc. (->[source](https://developer.android.com/images/guide/topics/ui/shortcuts/pinned-shortcuts.png)) As far as I understood this is about defining 'shortcuts' using **intents** in a `shortcuts.xml` resource file. (->[source](https://developer.android.com/guide/topics/ui/shortcuts/creating-shortcuts#static)) So by adding a intent to open the [*weatherwarning*](https://codeberg.org/Starfish/TinyWeatherForecastGermany/src/branch/master/app/src/main/res/layout/activity_weatherwarning.xml) activity it should be able to be added as a shortcut to `shortcuts.xml`.
Poster

as noted above: priority of this idea from my personal point-of-view is pretty low as this time. More a nice to have. As I came up with quite a lot of issues and ideas recently I just wanted to hightlight that I don't wan't to waste anyone's time it's more a collection of ideas so that (future) readers of these might engage and (further) contribute by posting feedback, technical know-how or opinions.

as noted above: priority of this idea from my personal point-of-view is pretty low as this time. More a nice to have. As I came up with quite a lot of issues and ideas recently I just wanted to hightlight that I don't wan't to waste anyone's time it's more a collection of ideas so that (future) readers of these might engage and (further) contribute by posting feedback, technical know-how or opinions.
Starfish added the
enhancement
label 2 months ago
Owner

However, on the other side, this seems quite easy to implement. However, it requires API 25, so I will probably need to try to do it dynamically (see https://developer.android.com/reference/android/content/pm/ShortcutManager ) , so that it does not break anything on devices with a lower api. :-)

The app still supports api 19 aka 4.4 :-)

However, on the other side, this seems quite easy to implement. However, it requires API 25, so I will probably need to try to do it dynamically (see https://developer.android.com/reference/android/content/pm/ShortcutManager ) , so that it does not break anything on devices with a lower api. :-) The app still supports api 19 aka 4.4 :-)
Poster

@Starfish

a dynamic implementation sounds great!

@Starfish a dynamic implementation sounds great!
Owner

It turned out that the static implementation is fine, I found out (was not aware of it) that you can also make different xml files for different apis.

It took me about 30 minutes, and it is done now. 👍

See ac1e981a9a

It turned out that the static implementation is fine, I found out (was not aware of it) that you can also make different xml files for different apis. It took me about 30 minutes, and it is done now. 👍 See https://codeberg.org/Starfish/TinyWeatherForecastGermany/commit/ac1e981a9ab518af183c2b2557f578307f8ce8e1
Starfish closed this issue 2 months ago
Poster

@Starfish

It took me about 30 minutes, and it is done now. 👍

great news! looking forward to next release

@Starfish >It took me about 30 minutes, and it is done now. 👍 great news! looking forward to next release
Owner

If you like to have a preview, I just built a userdebug having them already :-)

If you like to have a preview, I just built a userdebug having them already :-)
Poster

sucessfully tested the feature seconds ago:
app shortcuts demo

Plus: can confirm that the app is flawlessly working on Android-x86 (Wikipedia) (android 9) 🥳 !


low-prio comment following

But for some reason the read map marker appears pretty big...
big red map marker on rainradar map

**sucessfully** tested the feature seconds ago: ![app shortcuts demo](/attachments/70ff350e-8fda-4e9e-a56b-a57b0b1de414) Plus: can confirm that the app is flawlessly working on [**Android-x86**](https://www.android-x86.org) ([Wikipedia](https://en.wikipedia.org/wiki/Android-x86)) (android 9) 🥳 ! ------ *low-prio comment following* But for some reason the read map marker appears pretty big... ![big red map marker on rainradar map](/attachments/9bda0696-d389-4777-a389-d7d67efa9cf4)
Owner

This is because the pin has a static size of 42 pixels, will change it to dp.

This is because the pin has a static size of 42 pixels, will change it to dp.
Owner

Fixed 67c5681fb1

Fixed https://codeberg.org/Starfish/TinyWeatherForecastGermany/commit/67c5681fb16b4b55967f85e0adde31717da10299
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.