Java Code Examples for android.view.View.requestApplyInsets()

The following are Jave code examples for showing how to use requestApplyInsets() of the android.view.View class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: BBSSDK-for-Android   File: StatusBarCompatLollipop.java   Source Code and License Vote up 7 votes
/**
 * set StatusBarColor
 * <p>
 * 1. set Flags to call setStatusBarColor
 * 2. call setSystemUiVisibility to clear translucentStatusBar's Flag.
 * 3. set FitsSystemWindows to false
 */
static void setStatusBarColor(Activity activity, int statusColor, boolean isLight) {
	Window window = activity.getWindow();

	window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
	window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
	window.setStatusBarColor(statusColor);
	int options = View.SYSTEM_UI_FLAG_VISIBLE;
	if (isLight) {
		options = options | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
	}
	window.getDecorView().setSystemUiVisibility(options);
	ViewGroup contentview = (ViewGroup) window.findViewById(Window.ID_ANDROID_CONTENT);
	View childview = contentview.getChildAt(0);
	if (childview != null) {
		childview.setFitsSystemWindows(false);
		childview.requestApplyInsets();
	}
}
 
Example 2
Project: letv   File: ViewCompatLollipop.java   Source Code and License Vote up 4 votes
public static void requestApplyInsets(View view) {
    view.requestApplyInsets();
}
 
Example 3
Project: boohee_v5.6   File: ViewCompatLollipop.java   Source Code and License Vote up 4 votes
public static void requestApplyInsets(View view) {
    view.requestApplyInsets();
}