FLAG_LAYOUT_NO_LIMITS . Android KitKat API. :
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Window window = getWindow();
window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
}
, FLAG_FULLSCREEN , - , FULLSCREEN , ( ). . LAYOUT_NO_LIMIT , .
, .
API ViewCompat.setOnApplyWindowInsetListener , android:fitsSystemWindows="true", . .
ViewCompat.setOnApplyWindowInsetsListener(toolbar, (v, insets) -> {
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) v.getLayoutParams();
params.topMargin = insets.getSystemWindowInsetTop();
return insets.consumeSystemWindowInsets();
});
, FrameLayout, LinearLayout RelativeLayout, , (, DrawerLayout, CoordinatorLayout). , , . onApplyWindowInsets.
@TargetApi(Build.VERSION_CODES.KITKAT)
@Override
public WindowInsets onApplyWindowInsets(WindowInsets insets) {
int childCount = getChildCount();
for (int index = 0; index < childCount; ++index)
getChildAt(index).dispatchApplyWindowInsets(insets);
// let children know about WindowInsets
return insets;
}
: OnApplyWindowInsetsListener, WindowInsets