flutter-tizen / embedder

Flutter embedder for Tizen
BSD 3-Clause "New" or "Revised" License
5 stars 7 forks source link

Scaling factor #55

Open adamdama opened 4 months ago

adamdama commented 4 months ago

We are experimenting with delivering Flutter apps to Tizen based TVs. During our exploration we found that the app is being scaled up by a factor of 1.6 which seems to be coming from this code: https://github.com/flutter-tizen/embedder/blob/c382987e93537a3be6b0c11eff4076ce4af6980b/flutter/shell/platform/tizen/flutter_tizen_view.cc#L61

This is making our app elements look too big even though the window size is correct at 1920 x 1080.

Is there a recommended approach to adjusting this scale in the Flutter app globally? Or do we need to adjust the widget and height of every widget when deployed to Tizen?

swift-kim commented 4 months ago

As far as I remember, the DPI came from the TV UI design guideline, so the scale factor (pixel ratio) has a constant value regardless of the screen size. You may find the widgets too big if you have a large screen TV. All other built-in apps should follow the same design guidelines and therefore have the same look and feel. Maybe I need to check out the latest guidelines again.

This issue and the workaround suggested by ardera may help, but it doesn't seem to work as desired in all cases. The easiest way would be to build the embedder by yourself by adjusting the hardcoded value. You will need a Linux machine or WSL, or you can even use the GitHub Actions CI if you don't want to set up the build environment locally. Otherwise we can consider adding a dedicated API to the C# embedding but the implementation may take some time.