nk2IsHere / tinkoff_acquiring_sdk_flutter

Tinkoff Acquiring SDK bindings for Flutter
MIT License
3 stars 6 forks source link

Black background after minimize application on Android #6

Open mozerrr opened 3 years ago

mozerrr commented 3 years ago

Screenshot_20210204-013412

mozerrr commented 3 years ago

Узнал подробности, проблема касается самого флаттера, не знаю можно ли исправить в нативе. https://github.com/flutter/flutter/issues/74801 В таком случае неплохо было бы сделать поддержку полноэкранного режима модалки (параметр acqScreenViewType).

LuodiJackShen commented 3 years ago

This is not a flutter bug, there are two ways to solve this problem. 1、 Override the method getBackgroundMode in FlutterActivity:

public class MyFlutterActivity extends FlutterActivity {
  ....
    @NonNull
    protected FlutterActivityLaunchConfigs.BackgroundMode getBackgroundMode() {
        return FlutterActivityLaunchConfigs.BackgroundMode.transparent;
    }
   ....
}

2、Add extra to the Intent

     Intent intent = new Intent(this, FlutterActivity.class);
     intent.putExtra("background_mode","transparent");
     startActivity(intent);
xypeng12345 commented 3 years ago

This is not a flutter bug, there are two ways to solve this problem. 1、 Override the method getBackgroundMode in FlutterActivity:

public class MyFlutterActivity extends FlutterActivity {
  ....
    @NonNull
    protected FlutterActivityLaunchConfigs.BackgroundMode getBackgroundMode() {
        return FlutterActivityLaunchConfigs.BackgroundMode.transparent;
    }
   ....
}

2、Add extra to the Intent

     Intent intent = new Intent(this, FlutterActivity.class);
     intent.putExtra("background_mode","transparent");
     startActivity(intent);

这只能修复切换到后台的黑屏,对权限申请息屏亮屏后导致的黑屏无作用。