feat: Added support for Tabletop (Flex Mode/Half Open) in Player [#1313]
Commit Message
- Added Jetpack WindowManager dependency
- Changed Player Activity & Layout to support Tabletop
Feature Overview
In the player page, when the device goes to Tabletop/Flex Mode/Half Open, the player screen will only occupy the top half of the screen.
This can be achieved by implementing fold-aware logic in the activity.
Code Changes
Added WindowManager dependency in the player module. In the activity_player.xml, the root view is moved inside a constraint layout so that it can be managed easily to fill the top half of the screen by setting the layout_constraintHeight_percent to 0.5.
In the PlayerActivity.kt, WindowInfoTracker & windowLayoutInfo changes are used to determine the fold mode and change the layout accordingly.
Screen Record
https://github.com/user-attachments/assets/a600d436-f2b4-4a6f-a474-29a29a3f699f
Additional Info
Screen Record in Samsung Z Fold in Samsung Remote Test Lab.
If anyone is interested, check out the Universal Signed APK
Works perfectly on my Galaxy Fold 7. Thanks @srdalai!