Skip to content

Foldable camera profiles for Duo, Island, and Status Glance - #1265

Merged
sameerasw merged 35 commits into
sameerasw:developfrom
kalanihelekunihi:codex/foldable-island-profiles
Oct 6, 2026
Merged

sameerasw merged 35 commits into
sameerasw:developfrom
kalanihelekunihi:codex/foldable-island-profiles

Conversation

@kalanihelekunihi

Copy link
Copy Markdown
Contributor

Why

Foldables can have a cover-display front camera and a separate inner-display front camera. On the Pixel 11 Pro Fold, the active screen changes between a 1080 × 2342 cover panel and a 2076 × 2152 inner panel, and the camera moves relative to the top edge as the phone rotates. A single camera offset can make Duo, Island, or Status Glance align on one screen while covering content on the other.

What changed

  • Show foldable placement controls only when the device advertises a hinge-angle sensor or Google's dual-front-camera foldable feature. Single-screen phones keep the existing settings UI.
  • Save manual camera placement separately for each active display in Island and Status Glance, extending Duo's existing per-display behavior.
  • Add optional portrait/landscape placement overrides for Duo, Island, and Status Glance. Unconfigured overrides inherit the display profile and then the old global setting, preserving existing preferences.
  • Add a per-display, per-orientation hide switch. Island and Status Glance retain their landscape-hidden default; Duo remains visible by default. Duo keeps its display listener while hidden so rotation or unfolding can restore it.
  • Document behavior, fallback, and the limitation of resolution-based display identity in docs/foldable-camera-profiles.md.

Validation

  • :app:compileReleaseKotlin passed with a temporary local compileSdkMinor = 0 against installed Android 37.0. The committed project setting remains Android 37.1; Google returned HTTP 502 when Gradle tried to download that platform.
  • xmllint --noout app/src/main/res/values/strings.xml and git diff --check passed.
  • No patched APK was installed on the phone, so physical UI behavior across fold and rotation remains to be tested.

feuersternX and others added 30 commits October 5, 2026 00:31
@sameerasw

Copy link
Copy Markdown
Owner

Hi! How does this affect the existing fold support in island?

@kalanihelekunihi

Copy link
Copy Markdown
Contributor Author

This extends Island’s existing fold support by giving each display its own saved camera placement, while retaining the existing configuration-change handling and cutout detection.

On my Pixel 11 Pro Fold, the cover and inner cameras have different cutout sizes and positions. With current main, I’m seeing automatic placement use the cover camera’s size and position on the inner screen. One display may need centered placement while the other needs corner placement. The resolver requests the exterior display’s cutout for both interior and exterior screens.

Currently, Island’s manual X/Y offsets, camera-size scale, and left/center/right selection are shared. Correcting the inner camera therefore also changes the cover-screen settings. This PR saves those values per display using the display-profile mechanism Duo already uses. Status Glance also gains per-display X/Y offsets.

You adjust the cover screen, unfold, and adjust the inner screen. Folding or unfolding selects the appropriate profile automatically. “Separate portrait and landscape placement” optionally gives each display separate orientation settings, including offsets, size and left/center/right anchoring. This lets centered and corner cameras have different configurations.

Existing global settings remain the fallback, and automatic cutout detection remains available. There’s also a per-screen/per-orientation hide option.

…and-profiles

# Conflicts:
#	app/build.gradle.kts
#	app/src/main/java/com/sameerasw/essentials/island/plugins/timer/TimerPlugin.kt
#	app/src/main/java/com/sameerasw/essentials/island/service/IslandCoordinator.kt
#	app/src/main/java/com/sameerasw/essentials/island/state/IslandController.kt
#	app/src/main/java/com/sameerasw/essentials/services/LiveUpdateSnoozer.kt
#	app/src/main/java/com/sameerasw/essentials/services/NotificationListener.kt
#	app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSettingsUI.kt
#	app/src/main/java/com/sameerasw/essentials/ui/features/display/IslandSubSettingsUI.kt
#	app/src/main/java/com/sameerasw/essentials/utils/DeviceUtils.kt

@sameerasw sameerasw left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contributions <3

@sameerasw
sameerasw merged commit ebcbfad into sameerasw:develop Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants