Android 悬浮窗 WindowManager WindowManager.LayoutParamas

前方高清大图~~~~

Android 悬浮窗 WindowManager WindowManager.LayoutParamas

绘制的图片资源:

// draw bitmap
BitmapDrawable bmpDraw = (BitmapDrawable) getResources().getDrawable(R.drawable.hands);

// 悬浮窗配置

private WindowManager mWindowManager;
private WindowManager.LayoutParams mWindowParams;

//

mWindowManager = (WindowManager) context.getApplicationContext().getSystemService(Context.WINDOW_SERVICE);
mWindowParams = new WindowManager.LayoutParams();
// 设置window type TYPE_SYSTEM_ALERT = 下拉悬浮窗时不可见
mWindowParams.type = WindowManager.LayoutParams.TYPE_PHONE;
/*Window flag: even when this window is focusable (its FLAG_NOT_FOCUSABLE is not set),
* allow any pointer events outside of the window to be sent to the windows behind it. */
mWindowParams.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;

//
mWindowParams.gravity = Gravity.START | Gravity.TOP;
// 设置长 宽
mWindowParams.x =100;
mWindowParams.y = 100;
mWindowParams.width = 600;
mWindowParams.height = 600;
mWindowParams.alpha = 1f;

Android 悬浮窗 WindowManager WindowManager.LayoutParamas

  

Android 悬浮窗 WindowManager WindowManager.LayoutParamas

上一篇:JS判断字符串长度的5个方法


下一篇:【JSF框架】 是一种标准