element-hq / element-hq/element-x-android

Publish room shortcuts

Open
#1,586 2 comments 7 reactions 0 assignees View on GitHub
Android OS - nice to have help wanted T-Enhancement
Dominant language
Kotlin
Stars
2.4k
Forks
624
Avg merge
1d 14h
Merged PRs (30d)
149

Description

### Your use case

#### What would you like to do?

Publish room shortcuts -- the links to rooms that appear when you long press an app icon, or that appear in the sharing menu (sharing shortcuts).

![Example screenshot of shortcuts on home screen from Android docs](https://github.com/vector-im/element-x-android/assets/34610081/40592b3f-bf47-441c-bddf-e722e7a17fde)

![Example screenshot of sharing shortcuts from Android docs](https://github.com/vector-im/element-x-android/assets/34610081/2e20e05c-9b5c-4e56-bc19-1113adb16b1f)

#### Why would you like to do it?

Feature parity with the old Element Android, and would fix #1547 since notifications must be associated with a shortcut to be considered conversations (see https://developer.android.com/develop/ui/views/notifications/conversations).

#### How would you like to achieve it?

Shortcut creation in the old Element Android is handled in [this class](https://github.com/vector-im/element-android/blob/develop/vector/src/main/java/im/vector/app/features/home/ShortcutsHandler.kt). On initialization, the app pushes the entire list of rooms as shortcuts as ordered on the room list screen.

The [Android docs](https://developer.android.com/training/sharing/direct-share-targets) recommend re-pushing the shortcut on every incoming/outgoing message.

I put together a [quick implementation](https://github.com/dkter/element-x-android/commit/5609de631620b2315a81e2bd946df61607d37475) just to see if this would fix #1547 -- it just pushes a room shortcut every time a notification is sent. Probably not an ideal/permanent solution (though this does seem to be how Discord handles things) but it does work and does fix #1547

### Have you considered any alternatives?

_No response_

### Additional context

_No response_

### Are you willing to provide a PR?

No

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.