List of usage examples for android.view View requestApplyInsets
public void requestApplyInsets()
From source file:com.google.samples.apps.ourstreets.view.ViewUtils.java
/** * Applies top window insets for a view. * * @param view The view to apply insets for. *///from w ww . j av a 2 s . com public static void applyTopWindowInsetsForView(@NonNull final View view) { view.setOnApplyWindowInsetsListener(new View.OnApplyWindowInsetsListener() { @Override public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) { v.setPadding(v.getPaddingLeft(), insets.getSystemWindowInsetTop() + v.getPaddingTop(), v.getPaddingRight(), v.getPaddingBottom()); return insets; } }); view.requestApplyInsets(); }