前方高清大图~~~~
绘制的图片资源:
// 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;