Skip to content

Fix tablet layout on fold/unfold#1926

Open
rybnikov wants to merge 1 commit intoDrKLO:masterfrom
rybnikov:fix/foldable-tablet-layout
Open

Fix tablet layout on fold/unfold#1926
rybnikov wants to merge 1 commit intoDrKLO:masterfrom
rybnikov:fix/foldable-tablet-layout

Conversation

@rybnikov
Copy link
Copy Markdown

Summary

  • Refresh tablet detection during configuration changes so foldable devices switch layouts immediately after unfolding.

Reproduction

  1. Launch the app on a foldable device (e.g., OPPO Find N5).
  2. Fold the device (phone layout).
  3. Unfold to tablet size.

Expected

  • Tablet layout activates immediately after unfolding.

Actual

  • Layout stays in phone mode until app restart/resume.

Fix

  • Tablet mode is cached via AndroidUtilities.isTablet().
  • On fold/unfold, the app gets a configuration change but the cached tablet flag isn’t refreshed.
  • Calling resetTabletFlag() + invalidateTabletMode() in onConfigurationChanged() re-evaluates tablet mode and rebuilds layout immediately.

Testing

  • Reproducible on other foldables.
  • Tested on OPPO Find N5 hardware (ColorOS 16).
  • Tested on Pixel Fold emulator.

Recalculate tablet mode on configuration changes so foldable devices
switch layouts immediately after unfolding.
@rybnikov
Copy link
Copy Markdown
Author

About 21 issue are connected to this bug https://bugs.telegram.org/?type=issues&query=unfold&sort=rate

rybnikov added a commit to rybnikov/Telegram that referenced this pull request Feb 27, 2026
- Change package name to com.rbnkv.foldogram
- Update app name to Foldogram/Foldogram Beta
- Bump version to 12.4.2-beta (6511)
- Add beta release checklist

This combines fixes from:
- PR DrKLO#1934: Fix fragment destruction with multiple instances
- PR DrKLO#1926: Fix tablet layout on fold/unfold
rybnikov added a commit to rybnikov/Telegram that referenced this pull request Mar 23, 2026
- Change package name to com.rbnkv.foldogram
- Update app name to Foldogram/Foldogram Beta
- Bump version to 12.4.2-beta (6511)
- Add beta release checklist

This combines fixes from:
- PR DrKLO#1934: Fix fragment destruction with multiple instances
- PR DrKLO#1926: Fix tablet layout on fold/unfold
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant