Skip to content

feat: improve landscape UI for tablets and phones#145

Open
Chanceium wants to merge 1 commit intoDodoraApp:mainfrom
Chanceium:feat/tablet-landscape-ui
Open

feat: improve landscape UI for tablets and phones#145
Chanceium wants to merge 1 commit intoDodoraApp:mainfrom
Chanceium:feat/tablet-landscape-ui

Conversation

@Chanceium
Copy link

  • Unlock device rotation (orientation: 'default' in Expo config)
  • Add orientation/screenSize to Android configChanges to prevent activity recreation
  • Stabilize breakpoint detection using shorter dimension (min of width/height) so rotating a phone doesn't jump to tablet tier; TV always returns 'tv' via Platform.isTV
  • Add isLandscape to useResponsiveLayout and adjust grid columns per orientation
  • Scale hero and cover image heights proportionally in landscape
  • Add side-by-side details layout (poster left, info right) for landscape phones/tablets
  • Compact tab bar on phones in landscape to save vertical space
  • Include left/right safe area edges in landscape for notch/punch-hole handling
  • Constrain tablet landscape content width in ResponsiveLayout sidebar mode
  • Replace static Dimensions.get('window') with reactive useWindowDimensions in MediaDetailsHeader

Summary

Adds proper landscape support for Android tablets and phones. Previously the app was locked to portrait orientation, so landscape was just the portrait layout stretched

Testing

  • Android Tablet
  • Needs testing on TV

- Unlock device rotation (orientation: 'default' in Expo config)
- Add orientation/screenSize to Android configChanges to prevent activity recreation
- Stabilize breakpoint detection using shorter dimension (min of width/height) so rotating a phone doesn't jump to tablet tier; TV always returns 'tv' via Platform.isTV
- Add isLandscape to useResponsiveLayout and adjust grid columns per orientation
- Scale hero and cover image heights proportionally in landscape
- Add side-by-side details layout (poster left, info right) for landscape phones/tablets
- Compact tab bar on phones in landscape to save vertical space
- Include left/right safe area edges in landscape for notch/punch-hole handling
- Constrain tablet landscape content width in ResponsiveLayout sidebar mode
- Replace static Dimensions.get('window') with reactive useWindowDimensions in MediaDetailsHeader
Copy link
Contributor

@Kombustor Kombustor left a comment

Choose a reason for hiding this comment

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

Thank you, awesome contribution! 🥳

paddingBottom: bottom,
paddingTop: 10,
height: 65 + bottom,
paddingBottom: compactTabs ? 2 : bottom,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we even need this 2 here? Isn't the marginBottom: -2 on the icon just equaling this out?

paddingTop: 10,
height: 65 + bottom,
paddingBottom: compactTabs ? 2 : bottom,
paddingTop: compactTabs ? 4 : 10,
Copy link
Contributor

Choose a reason for hiding this comment

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

I moved these constants to the theme on master, please adjust this accordingly

? width * 0.5
: undefined;
: breakpoint === 'tablet' && isLandscape
? Math.min(width * 0.75, 1000)
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't hardcode, use theme

<ScrollView>
<Box flexDirection="row" padding="l" gap="l" position="relative">
{/* Left column: poster */}
<Box width={isMobile ? 140 : 180}>
Copy link
Contributor

Choose a reason for hiding this comment

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

don't hardcode, use theme

const isLandscape = width > height;

// In landscape, scale hero height to avoid consuming the entire viewport
const heroHeight = isLandscape ? Math.min(HERO_HEIGHT, height * 0.7) : HERO_HEIGHT;
Copy link
Contributor

Choose a reason for hiding this comment

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

is in theme on master now


// Grid columns based on breakpoint
// Grid columns based on breakpoint + orientation
const columns = useMemo(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

this was unused and got removed on master

}, [isTV, isTablet, isLandscape]);

// Max content width
const containerMaxWidth = useMemo(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

this was unused and got removed on master

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.

2 participants