当前位置: 首页>>代码示例>>Java>>正文


Java WindowInsets.consumeSystemWindowInsets方法代码示例

本文整理汇总了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();
}
 
开发者ID:Assassinss,项目名称:Interessant,代码行数:18,代码来源:InsetsDrawerLayout.java

示例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();
}
 
开发者ID:Assassinss,项目名称:pretty-girl,代码行数:23,代码来源:InsetCoordinatorLayout.java

示例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();
}
 
开发者ID:Assassinss,项目名称:Moment,代码行数:16,代码来源:InsetsFrameLayout.java

示例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();
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:31,代码来源:InsetsFrameLayout.java

示例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();
  }
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:11,代码来源:DrawerLayoutCompatApi21.java

示例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();
}
 
开发者ID:jzhu1224,项目名称:DeckView,代码行数:13,代码来源:DeckView.java

示例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();
}
 
开发者ID:Hamz-a,项目名称:MyCTFWriteUps,代码行数:15,代码来源:DrawerLayoutCompatApi21.java

示例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();
}
 
开发者ID:JakeWharton,项目名称:Telecine,代码行数:9,代码来源:OverlayView.java

示例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();
}
 
开发者ID:rogues-dev,项目名称:superglue,代码行数:7,代码来源:DrawerLayoutCompatApi21.java

示例10: onApplyWindowInsets

import android.view.WindowInsets; //导入方法依赖的package包/类
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
    ((DrawerLayoutImpl) v).setChildInsets(insets, insets.getSystemWindowInsetTop() > 0);
    return insets.consumeSystemWindowInsets();
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:5,代码来源:DrawerLayoutCompatApi21.java

示例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();
}
 
开发者ID:GigigoGreenLabs,项目名称:permissionsModule,代码行数:7,代码来源:DrawerLayoutCompatApi21.java

示例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();
}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:7,代码来源:DrawerLayoutContainer.java

示例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();
}
 
开发者ID:Mishiranu,项目名称:Dashchan,代码行数:7,代码来源:DrawerLayout.java

示例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();
}
 
开发者ID:williamwebb,项目名称:debugdrawer,代码行数:7,代码来源:DrawerLayoutCompatApi21.java


注:本文中的android.view.WindowInsets.consumeSystemWindowInsets方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。