Java Code Examples for android.view.WindowManager.LayoutParams#FLAG_WATCH_OUTSIDE_TOUCH

The following examples show how to use android.view.WindowManager.LayoutParams#FLAG_WATCH_OUTSIDE_TOUCH . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PopupDialog.java    From Noyze with Apache License 2.0 6 votes vote down vote up
private static WindowManager.LayoutParams getWindowLayoutParams() {
	int flags = (LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH	|
			     LayoutParams.FLAG_DIM_BEHIND			);
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
		flags |= LayoutParams.FLAG_HARDWARE_ACCELERATED;
	if (!BuildConfig.DEBUG) flags |= LayoutParams.FLAG_SECURE;
	LayoutParams WPARAMS = new WindowManager.LayoutParams(
		LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT,
		LayoutParams.TYPE_SYSTEM_ALERT, flags, PixelFormat.TRANSLUCENT);
	final int windowAnimations = getInternalStyle("Animation_Dialog");
	if (windowAnimations > 0) WPARAMS.windowAnimations = windowAnimations;
	WPARAMS.dimAmount = 0.6f;
	WPARAMS.packageName = PopupDialog.class.getPackage().getName();
	WPARAMS.setTitle(TAG);
	WPARAMS.gravity = Gravity.CENTER;
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO)
		WPARAMS.screenBrightness = WPARAMS.buttonBrightness = LayoutParams.BRIGHTNESS_OVERRIDE_NONE;
	return WPARAMS;
}
 
Example 2
Source File: StatusBarVolumePanel.java    From Noyze with Apache License 2.0 6 votes vote down vote up
@Override public WindowManager.LayoutParams getWindowLayoutParams() {
	int flags = (LayoutParams.FLAG_NOT_FOCUSABLE		|
                    LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH  |
                    LayoutParams.FLAG_NOT_TOUCH_MODAL      |
                    LayoutParams.FLAG_LAYOUT_INSET_DECOR   |
			     LayoutParams.FLAG_LAYOUT_IN_SCREEN		|
			     LayoutParams.FLAG_SHOW_WHEN_LOCKED	    );
	LayoutParams WPARAMS = new WindowManager.LayoutParams(
		LayoutParams.MATCH_PARENT, mStatusBarHeight, 0, 0,
		LayoutParams.TYPE_SYSTEM_ERROR, flags, PixelFormat.TRANSLUCENT);
	WPARAMS.windowAnimations = android.R.style.Animation_Dialog;
	WPARAMS.packageName = getContext().getPackageName();
	WPARAMS.setTitle(TAG);
       WPARAMS.rotationAnimation = LayoutParams.ROTATION_ANIMATION_JUMPCUT;
	WPARAMS.gravity = (Gravity.FILL_HORIZONTAL | Gravity.TOP);
	WPARAMS.screenBrightness = WPARAMS.buttonBrightness = LayoutParams.BRIGHTNESS_OVERRIDE_NONE;
	return WPARAMS;
}
 
Example 3
Source File: PopupDialog.java    From Noyze with Apache License 2.0 6 votes vote down vote up
private static WindowManager.LayoutParams getWindowLayoutParams() {
	int flags = (LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH	|
			     LayoutParams.FLAG_DIM_BEHIND			);
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
		flags |= LayoutParams.FLAG_HARDWARE_ACCELERATED;
	if (!BuildConfig.DEBUG) flags |= LayoutParams.FLAG_SECURE;
	LayoutParams WPARAMS = new WindowManager.LayoutParams(
		LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT,
		LayoutParams.TYPE_SYSTEM_ALERT, flags, PixelFormat.TRANSLUCENT);
	final int windowAnimations = getInternalStyle("Animation_Dialog");
	if (windowAnimations > 0) WPARAMS.windowAnimations = windowAnimations;
	WPARAMS.dimAmount = 0.6f;
	WPARAMS.packageName = PopupDialog.class.getPackage().getName();
	WPARAMS.setTitle(TAG);
	WPARAMS.gravity = Gravity.CENTER;
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO)
		WPARAMS.screenBrightness = WPARAMS.buttonBrightness = LayoutParams.BRIGHTNESS_OVERRIDE_NONE;
	return WPARAMS;
}
 
Example 4
Source File: StatusBarVolumePanel.java    From Noyze with Apache License 2.0 6 votes vote down vote up
@Override public WindowManager.LayoutParams getWindowLayoutParams() {
	int flags = (LayoutParams.FLAG_NOT_FOCUSABLE		|
                    LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH  |
                    LayoutParams.FLAG_NOT_TOUCH_MODAL      |
                    LayoutParams.FLAG_LAYOUT_INSET_DECOR   |
			     LayoutParams.FLAG_LAYOUT_IN_SCREEN		|
			     LayoutParams.FLAG_SHOW_WHEN_LOCKED	    );
	LayoutParams WPARAMS = new WindowManager.LayoutParams(
		LayoutParams.MATCH_PARENT, mStatusBarHeight, 0, 0,
		LayoutParams.TYPE_SYSTEM_ERROR, flags, PixelFormat.TRANSLUCENT);
	WPARAMS.windowAnimations = android.R.style.Animation_Dialog;
	WPARAMS.packageName = getContext().getPackageName();
	WPARAMS.setTitle(TAG);
       WPARAMS.rotationAnimation = LayoutParams.ROTATION_ANIMATION_JUMPCUT;
	WPARAMS.gravity = (Gravity.FILL_HORIZONTAL | Gravity.TOP);
	WPARAMS.screenBrightness = WPARAMS.buttonBrightness = LayoutParams.BRIGHTNESS_OVERRIDE_NONE;
	return WPARAMS;
}