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

Add support for cutoff / notch

Open
#4,607 1 comment 1 reaction 0 assignees View on GitHub
Android OS - nice to have O-Occasional S-Major T-Defect
Dominant language
Kotlin
Stars
2.4k
Forks
624
Avg merge
1d 14h
Merged PRs (30d)
149

Description

### Steps to reproduce

1. Get a device with a notch (front camera on screen)
2. Open the room list / timeline
3. Rotate the device to landscape
4. Observe that the application content does not avoid the notch area

Also related, the PlayStore is rising a warning about some deprecated API usage:

Image

I believe that this is due to the usage of `fun ComponentActivity.enableEdgeToEdge()` in `MainActivity` and `PinUnlockActivity`. Not sure why this method is not used in the 2 other Activities `IncomingCallActivity` and `ElementCallActivity`.

On an emulator running API 35, we can see an issue in the rendering (on real device it seems to be fine):

Image

More details available here: https://developer.android.com/develop/ui/compose/system/insets

### Outcome

#### What did you expect?

The content of the application should have an offset to avoid the notch to hide UI elements

#### What happened instead?

The hardware front camera is eating some pixels.

### Your phone model

A device with a notch

### Operating system version

any

### Application version and app store

25.04.2 and before

### Homeserver

NA

### Will you send logs?

No

### Are you willing to provide a PR?

No

Contributor guide

Open the contributing guide

Research direction

Start by comparing enableEdgeToEdge() usage in MainActivity, PinUnlockActivity, IncomingCallActivity, and ElementCallActivity, then reproduce the landscape notch case on an API 35 emulator using the Compose system insets guidance. Done means content avoids the notch on notched devices and the deprecated API warning and API 35 rendering issue are addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.