add product manager

This commit is contained in:
wangcongtao
2020-05-21 14:49:30 +08:00
parent 9c7042246c
commit e1a83c6b8f
35 changed files with 360 additions and 353 deletions

View File

@@ -72,7 +72,11 @@ public class BackToMainHomeManager {
params.x = AbsMogoApplication.getApp().getResources().getDimensionPixelOffset( R.dimen.module_back_main_home_icon_left );
params.y = AbsMogoApplication.getApp().getResources().getDimensionPixelOffset( R.dimen.module_back_main_home_icon_top );
params.gravity = Gravity.LEFT | Gravity.CENTER;
params.type = getFitWindowParamsType();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
params.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
} else {
params.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
}
params.format = PixelFormat.RGBA_8888;
params.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
windowManager.addView( mBackView, params );
@@ -83,18 +87,4 @@ public class BackToMainHomeManager {
WindowManagerViewHelper.removeView( mBackView );
}
private static int getFitWindowParamsType() {
int type;
if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1 ) {
// Need request permission.
type = WindowManager.LayoutParams.TYPE_PHONE;
} else if ( Build.MODEL.equalsIgnoreCase( "MI 5" ) ) {
// MI 5 phone not display crawler dot in android 7.0
type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
} else {
// It's will be dismissed automatically 3s after showing in Android 25.
type = WindowManager.LayoutParams.TYPE_TOAST;
}
return type;
}
}