Skip to content

Add callback to check what part of home screen is occluded #36

@8bitPit

Description

@8bitPit

Hi there, I hope this is the right place to ask a compatibility question about home screen apps. I'm one of the developers of the home screen app Niagara Launcher, and lately, we're trying to optimize our UX for foldable devices, including the Surface Duo.

The Problem

I noticed that when the Duo is unfolded, the home screen is displayed on both displays. If you launch an app, it occupies one of the two screens by default. Now half of our home screen is occluded by that app. I tried to find a callback method that notifies us about what part of the app is currently visible/occluded to the user but unfortunately to no avail. Microsoft Launcher, on the other hand, rearranges its layout after launching an app. I wish there was a public method for third-party launchers to check what parts of the home screen are visible to the user and what parts are occluded by other apps.

What callbacks I tried but did not fire on when the home screen is partially occluded:

  • ScreenInfoListener.onScreenInfoChanged(...) (from com.microsoft.device.dualscreen:screenmanager-windowmanager:1.0.0-beta4)
  • windowInfoRepository.windowLayoutInfo (from androidx.window:window:1.0.0-beta02)
  • OnApplyWindowInsetsListener.onApplyWindowInsets(...) (from the Android framework)

Illustrations

Niagara Launcher on both screens

Screenshot_1630572941

Half of Niagara's home screen is occluded when an app is launched

Screenshot_1630572961
Screenshot_1630572968

Microsoft Launcher can readjust its layout (e.g. the dock at the bottom) when an app is launched

Screenshot_1630573025
Screenshot_1630573028

Additional details

I tested this on the Surface Duo Emulator (SurfaceDuoEmulator_2021.816.1_windows).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions