Поворот изображения Flutter на вывесках Android TV не работаетAndroid

Форум для тех, кто программирует под Android
Ответить
Anonymous
 Поворот изображения Flutter на вывесках Android TV не работает

Сообщение Anonymous »


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
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Android»