Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devices with a landscape default orientation #19

Open
swift-kim opened this issue Jan 13, 2023 · 4 comments
Open

Devices with a landscape default orientation #19

swift-kim opened this issue Jan 13, 2023 · 4 comments

Comments

@swift-kim
Copy link
Member

swift-kim commented Jan 13, 2023

https://api.flutter.dev/flutter/services/DeviceOrientation.html

According to the Flutter official documentation, the default orientation of a device is defined as the orientation in which its boot logo is displayed upright. In other words, the default orientation of most TV devices (and some common devices) is technically landscapeLeft, but we're currently assuming that the default orientation of a device is always portraitUp regardless of the actual screen size.

A correct implementation will be like this: swift-kim@4bf08c8

However, applying this change will break some (cross-platform) apps and packages which are developed only for mobile and always assume portraitUp as a default orientation (example: youtube_player_iframe). How should we deal with this problem? Should we apply the patch anyway?

@JSUYA
Copy link
Member

JSUYA commented Jan 17, 2023

https://api.flutter.dev/flutter/services/DeviceOrientation.html

According to the Flutter official documentation, the default orientation of a device is defined as the orientation in which its boot logo is displayed upright. In other words, the default orientation of most TV devices (and some common devices) is technically landscapeLeft, but we're currently assuming that the default orientation of a device is always portraitUp regardless of the actual screen size.

According to flutter documentation you mentioned, the default orientation has nothing to do with aspect ratio.
How about using TV_PROFILE macro since the normal case is portrait and for TV's logo orientation is landscape.

@swift-kim
Copy link
Member Author

@JSUYA Please understand the definition of the words "portrait" and "landscape" and read the documentation again. Also please refer to https://api.flutter.dev/flutter/widgets/MediaQueryData/orientation.html.

@JSUYA
Copy link
Member

JSUYA commented Jan 20, 2023

Application can resize size . If we run a 400x300 flutter application(platformview or multi windows...) on a screen with a longer height (mobile, portrait), the app will recognize landscape as default. Are you intending this?

Also please refer to https://api.flutter.dev/flutter/widgets/MediaQueryData/orientation.html.

This is the device's screen size.

@swift-kim
Copy link
Member Author

Are you intending this?

Basically yes. Only the current width and height matter. On Tizen, there's no predefined constant like Android's ActivityInfo.SCREEN_ORIENTATION_PORTRAIT so the embedder should manually compute the current orientation.

This is the device's screen size.

Hmm.. I provided the link because it explains that "landscape" indicates "width > height" by definition. The size in the code refers to the logical window size.

FYI) MediaQuery.of(context).orientation is quite frequently used by Flutter apps to detect the current orientation.

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

No branches or pull requests

2 participants