Поворот изображения Flutter на вывесках Android TV не работает ⇐ Android
Поворот изображения Flutter на вывесках Android TV не работает
Wrote a sample android app in Flutter 3.16.7 - to rotate images on android device, using below peace of code. The same works well on android cell phone or tablet, but the intent is for this to run on android signage TV. But it doesn't. Any help would be appreciated.
SystemChrome.setPreferredOrientations([ DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeRight ]); So i also tried using android native code - but that also doesn't seem to work as expected.
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, channelOrientation).setMethodCallHandler { call, result -> when (call.method) { setLandscapeRight -> { this.activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE } setLandscapeLeft -> { this.activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE } setPortraitUp -> { this.activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT } setPortraitDown -> { this.activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT } } } } The code snippet is expected to rotate the images in 90/ 180/270 degrees on a signage android TV. It works well on android phone or tablet but not TV
Источник: https://stackoverflow.com/questions/781 ... oesnt-work
Wrote a sample android app in Flutter 3.16.7 - to rotate images on android device, using below peace of code. The same works well on android cell phone or tablet, but the intent is for this to run on android signage TV. But it doesn't. Any help would be appreciated.
SystemChrome.setPreferredOrientations([ DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeRight ]); So i also tried using android native code - but that also doesn't seem to work as expected.
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, channelOrientation).setMethodCallHandler { call, result -> when (call.method) { setLandscapeRight -> { this.activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE } setLandscapeLeft -> { this.activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE } setPortraitUp -> { this.activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT } setPortraitDown -> { this.activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT } } } } The code snippet is expected to rotate the images in 90/ 180/270 degrees on a signage android TV. It works well on android phone or tablet but not TV
Источник: https://stackoverflow.com/questions/781 ... oesnt-work
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Поворот и масштабирование изображения, чтобы оно «поместилось» в контейнере div
Anonymous » » в форуме CSS - 0 Ответы
- 10 Просмотры
-
Последнее сообщение Anonymous
-