本文整理汇总了Java中android.view.View.requestApplyInsets方法的典型用法代码示例。如果您正苦于以下问题:Java View.requestApplyInsets方法的具体用法?Java View.requestApplyInsets怎么用?Java View.requestApplyInsets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.View
的用法示例。
在下文中一共展示了View.requestApplyInsets方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setStatusBarColor
import android.view.View; //导入方法依赖的package包/类
/**
* 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();
}
}
示例2: requestApplyInsets
import android.view.View; //导入方法依赖的package包/类
public static void requestApplyInsets(View view) {
view.requestApplyInsets();
}