Skip to content

Fix: FAB buttons shrinking and opening vertically in landscape mode on Contributions screen#6756

Open
Shoaibkhalid65 wants to merge 4 commits intocommons-app:mainfrom
Shoaibkhalid65:fix/fab-orientation-reset-landscape-contributions
Open

Fix: FAB buttons shrinking and opening vertically in landscape mode on Contributions screen#6756
Shoaibkhalid65 wants to merge 4 commits intocommons-app:mainfrom
Shoaibkhalid65:fix/fab-orientation-reset-landscape-contributions

Conversation

@Shoaibkhalid65
Copy link
Contributor

Fixes #6755

Problem

On the Contributions screen, FAB buttons (camera, gallery, custom gallery) correctly open
horizontally in landscape mode on first visit. After navigating to another tab and returning,
the FABs revert to vertical orientation and appear shrunk or partially hidden. Same behaviour
occurs in the Contributions tab of the Profile screen.

Root Cause

onConfigurationChanged correctly sets fabLayout.orientation to HORIZONTAL in landscape,
but onCreateView always inflates the layout with the XML default (vertical). When the user
navigates away and returns, onCreateView runs again resetting orientation to vertical, while
onConfigurationChanged does not fire since orientation hasn't changed.

Fix

Added orientation check in onCreateView to set fabLayout.orientation based on current
device orientation, consistent with what onConfigurationChanged already does.

Demo

Before:

fabs_broken_land_contributions.mp4

After:

fixed_broken_fabs_land_contributions.mp4

Tested on: [Samsung a07] | Android [16]

@THORzero9
Copy link

@Shoaibkhalid65
Tested this PR on a device running Android 15.
The FAB menu now switches to horizontal orientation in landscape. After reverting back from landscape it instantly switches to vertical orientation too without clipping off any buttons.
Works as expected and maintains UI integrity across tab navigation.
Looks good to me.

@Shoaibkhalid65
Copy link
Contributor Author

@Shoaibkhalid65 Tested this PR on a device running Android 15. The FAB menu now switches to horizontal orientation in landscape. After reverting back from landscape it instantly switches to vertical orientation too without clipping off any buttons. Works as expected and maintains UI integrity across tab navigation. Looks good to me.

Thank you for testing and confirming! Appreciate the feedback.

@github-actions
Copy link

✅ Generated APK variants!

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.

[Bug]: FAB buttons shrink/hide and open vertically instead of horizontally on Contributions screen in landscape mode after navigation

3 participants