本文整理汇总了Java中android.view.WindowInsets.consumeSystemWindowInsets方法的典型用法代码示例。如果您正苦于以下问题:Java WindowInsets.consumeSystemWindowInsets方法的具体用法?Java WindowInsets.consumeSystemWindowInsets怎么用?Java WindowInsets.consumeSystemWindowInsets使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.WindowInsets
的用法示例。
在下文中一共展示了WindowInsets.consumeSystemWindowInsets方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onApplyWindowInsets
import android.view.WindowInsets; //导入方法依赖的package包/类
@Override
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
int l = insets.getSystemWindowInsetLeft();
int t = insets.getSystemWindowInsetTop();
int r = insets.getSystemWindowInsetRight();
toolbar.setPadding(l, toolbar.getPaddingTop() + t, 0, 0);
final boolean ltr = recyclerView.getLayoutDirection() == View.LAYOUT_DIRECTION_LTR;
setPadding(getPaddingLeft(), getPaddingTop(), getPaddingEnd() + (ltr ? r : 0),
getPaddingBottom()
);
setOnApplyWindowInsetsListener(null);
return insets.consumeSystemWindowInsets();
}
示例2: onApplyWindowInsets
import android.view.WindowInsets; //导入方法依赖的package包/类
@Override
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
int l = insets.getSystemWindowInsetLeft();
int t = insets.getSystemWindowInsetTop();
int r = insets.getSystemWindowInsetRight();
int b = insets.getSystemWindowInsetBottom();
toolbar.setPadding(l, t, 0, 0);
recyclerView.setPaddingRelative(recyclerView.getPaddingLeft() + l,
recyclerView.getPaddingTop(),
recyclerView.getPaddingRight(),
recyclerView.getPaddingBottom() + b);
final boolean ltr = recyclerView.getLayoutDirection() == View.LAYOUT_DIRECTION_LTR;
setPadding(getPaddingLeft(), getPaddingTop(), getPaddingEnd() + (ltr ? r : 0),
getPaddingBottom()
);
setOnApplyWindowInsetsListener(null);
return insets.consumeSystemWindowInsets();
}
示例3: onApplyWindowInsets
import android.view.WindowInsets; //导入方法依赖的package包/类
@Override
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
int b = insets.getSystemWindowInsetBottom();
int r = insets.getSystemWindowInsetRight();
pictureInfoLayout.setPadding(
pictureInfoLayout.getPaddingLeft(),
pictureInfoLayout.getPaddingTop(),
pictureInfoLayout.getPaddingRight() + r,
pictureInfoLayout.getPaddingBottom() + b);
setOnApplyWindowInsetsListener(null);
return insets.consumeSystemWindowInsets();
}
示例4: onApplyWindowInsets
import android.view.WindowInsets; //导入方法依赖的package包/类
@TargetApi(21)
public WindowInsets onApplyWindowInsets(WindowInsets insets) {
int childCount = getChildCount();
boolean hasChildForWindowInsets = false;
for(int i = 0x0; i < childCount; i = i + 0x1) {
View child = getChildAt(i);
if((child instanceof InsetsAware) && (((InsetsAware)child).shouldApplyWindowInsets())) {
hasChildForWindowInsets = true;
break;
}
}
if(!hasChildForWindowInsets) {
setPadding(insets.getSystemWindowInsetLeft(), insets.getSystemWindowInsetTop(), insets.getSystemWindowInsetRight(), insets.getSystemWindowInsetBottom());
for(int i = 0x0; i < childCount; i = i + 0x1) {
child = getChildAt(i);
if(child.getId() == 0x7f1000cc) {
child.setPadding(0x0, 0x0, 0x0, 0x0);
}
}
return insets.consumeSystemWindowInsets();
}
setPadding(0x0, 0x0, 0x0, 0x0);
for(int i = 0x0; i < childCount; i = i + 0x1) {
child = getChildAt(i);
if((isActionBar) || (wantsWindowInsets)) {
child.dispatchApplyWindowInsets(insets);
}
}
return insets.consumeSystemWindowInsets();
}
示例5: onApplyWindowInsets
import android.view.WindowInsets; //导入方法依赖的package包/类
public final WindowInsets onApplyWindowInsets(View paramView, WindowInsets paramWindowInsets)
{
DrawerLayoutImpl localDrawerLayoutImpl = (DrawerLayoutImpl)paramView;
if (paramWindowInsets.getSystemWindowInsetTop() > 0) {}
for (boolean bool = true;; bool = false)
{
localDrawerLayoutImpl.setChildInsets(paramWindowInsets, bool);
return paramWindowInsets.consumeSystemWindowInsets();
}
}
示例6: onApplyWindowInsets
import android.view.WindowInsets; //导入方法依赖的package包/类
@Override
@TargetApi(Build.VERSION_CODES.KITKAT_WATCH)
public WindowInsets onApplyWindowInsets(WindowInsets insets) {
// Update the configuration with the latest system insets and trigger a relayout
// mConfig.updateSystemInsets(insets.getSystemWindowInsets());
mConfig.updateSystemInsets(new Rect(insets.getSystemWindowInsetLeft(),
insets.getSystemWindowInsetTop(),
insets.getSystemWindowInsetRight(),
insets.getSystemWindowInsetBottom()));
requestLayout();
return insets.consumeSystemWindowInsets();
}
示例7: onApplyWindowInsets
import android.view.WindowInsets; //导入方法依赖的package包/类
public WindowInsets onApplyWindowInsets(View view, WindowInsets windowinsets)
{
view = (DrawerLayoutImpl)view;
boolean flag;
if (windowinsets.getSystemWindowInsetTop() > 0)
{
flag = true;
} else
{
flag = false;
}
view.setChildInsets(windowinsets, flag);
return windowinsets.consumeSystemWindowInsets();
}
示例8: onApplyWindowInsets
import android.view.WindowInsets; //导入方法依赖的package包/类
@Override public WindowInsets onApplyWindowInsets(WindowInsets insets) {
ViewGroup.LayoutParams lp = getLayoutParams();
lp.height = insets.getSystemWindowInsetTop();
listener.onResize();
return insets.consumeSystemWindowInsets();
}
示例9: onApplyWindowInsets
import android.view.WindowInsets; //导入方法依赖的package包/类
@Override
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
final DrawerLayoutImpl drawerLayout = (DrawerLayoutImpl) v;
drawerLayout.setChildInsets(insets, insets.getSystemWindowInsetTop() > 0);
return insets.consumeSystemWindowInsets();
}
示例10: onApplyWindowInsets
import android.view.WindowInsets; //导入方法依赖的package包/类
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
((DrawerLayoutImpl) v).setChildInsets(insets, insets.getSystemWindowInsetTop() > 0);
return insets.consumeSystemWindowInsets();
}
示例11: onApplyWindowInsets
import android.view.WindowInsets; //导入方法依赖的package包/类
@Override
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
final DrawerLayoutImpl drawerLayout = (DrawerLayoutImpl) v;
drawerLayout.setChildInsets(insets, insets.getSystemWindowInsetTop() > 0);
return insets.consumeSystemWindowInsets();
}
示例12: onApplyWindowInsets
import android.view.WindowInsets; //导入方法依赖的package包/类
@Override
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
final DrawerLayoutContainer drawerLayout = (DrawerLayoutContainer) v;
drawerLayout.setChildInsets(insets, insets.getSystemWindowInsetTop() > 0);
return insets.consumeSystemWindowInsets();
}
示例13: onApplyWindowInsets
import android.view.WindowInsets; //导入方法依赖的package包/类
@Override
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
final DrawerLayout drawerLayout = (DrawerLayout) v;
drawerLayout.setChildInsets(insets, insets.getSystemWindowInsetTop() > 0);
return insets.consumeSystemWindowInsets();
}
示例14: onApplyWindowInsets
import android.view.WindowInsets; //导入方法依赖的package包/类
@Override
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
final DrawerLayoutImpl drawerLayout = (DrawerLayoutImpl) v;
drawerLayout.setChildInsets(insets, insets.getSystemWindowInsetTop() > 0);
return insets.consumeSystemWindowInsets();
}