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


Java View.getFitsSystemWindows方法代码示例

本文整理汇总了Java中android.view.View.getFitsSystemWindows方法的典型用法代码示例。如果您正苦于以下问题:Java View.getFitsSystemWindows方法的具体用法?Java View.getFitsSystemWindows怎么用?Java View.getFitsSystemWindows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.View的用法示例。


在下文中一共展示了View.getFitsSystemWindows方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onMeasure

import android.view.View; //导入方法依赖的package包/类
@SuppressLint("NewApi")
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    int widthSize = MeasureSpec.getSize(widthMeasureSpec);
    int heightSize = MeasureSpec.getSize(heightMeasureSpec);

    setMeasuredDimension(widthSize, heightSize);

    final boolean applyInsets = lastInsets != null && Build.VERSION.SDK_INT >= 21;

    final int childCount = getChildCount();
    for (int i = 0; i < childCount; i++) {
        final View child = getChildAt(i);

        if (child.getVisibility() == GONE) {
            continue;
        }

        final LayoutParams lp = (LayoutParams) child.getLayoutParams();

        if (applyInsets) {
            if (child.getFitsSystemWindows()) {
                dispatchChildInsets(child, lastInsets, lp.gravity);
            } else if (child.getTag() == null) {
                applyMarginInsets(lp, lastInsets, lp.gravity, Build.VERSION.SDK_INT >= 21);
            }
        }

        if (drawerLayout != child) {
            final int contentWidthSpec = MeasureSpec.makeMeasureSpec(widthSize - lp.leftMargin - lp.rightMargin, MeasureSpec.EXACTLY);
            final int contentHeightSpec = MeasureSpec.makeMeasureSpec(heightSize - lp.topMargin - lp.bottomMargin, MeasureSpec.EXACTLY);
            child.measure(contentWidthSpec, contentHeightSpec);
        } else {
            child.setPadding(0, 0, 0, 0);
            final int drawerWidthSpec = getChildMeasureSpec(widthMeasureSpec, minDrawerMargin + lp.leftMargin + lp.rightMargin, lp.width);
            final int drawerHeightSpec = getChildMeasureSpec(heightMeasureSpec, lp.topMargin + lp.bottomMargin, lp.height);
            child.measure(drawerWidthSpec, drawerHeightSpec);
        }
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:41,代码来源:DrawerLayoutContainer.java

示例2: jumpDispatch

import android.view.View; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@TargetApi(19)
private boolean jumpDispatch(View child) {
    return !child.getFitsSystemWindows() &&
            !(child instanceof QMUIWindowInsetLayout) &&
            !(child instanceof CoordinatorLayout);
}
 
开发者ID:coopese,项目名称:qmui,代码行数:8,代码来源:QMUIWindowInsetHelper.java

示例3: getFitsSystemWindows

import android.view.View; //导入方法依赖的package包/类
public static boolean getFitsSystemWindows(View view) {
    return view.getFitsSystemWindows();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:4,代码来源:ViewCompatJB.java

示例4: onMeasure

import android.view.View; //导入方法依赖的package包/类
@SuppressLint("NewApi")
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    int widthSize = MeasureSpec.getSize(widthMeasureSpec);
    int heightSize = MeasureSpec.getSize(heightMeasureSpec);

    setMeasuredDimension(widthSize, heightSize);

    final boolean applyInsets = lastInsets != null && Build.VERSION.SDK_INT >= 21;

    final int childCount = getChildCount();
    for (int i = 0; i < childCount; i++) {
        final View child = getChildAt(i);

        if (child.getVisibility() == GONE) {
            continue;
        }

        final LayoutParams lp = (LayoutParams) child.getLayoutParams();

        if (applyInsets) {
            if (child.getFitsSystemWindows()) {
                dispatchChildInsets(child, lastInsets, lp.gravity);
            } else if (child.getTag() == null) {
                applyMarginInsets(lp, lastInsets, lp.gravity, Build.VERSION.SDK_INT >= 21);
            }
        }

        if (drawerLayout != child) {
            final int contentWidthSpec = MeasureSpec.makeMeasureSpec(widthSize - lp.leftMargin - lp.rightMargin, MeasureSpec.EXACTLY);
            final int contentHeightSpec = MeasureSpec.makeMeasureSpec(heightSize - lp.topMargin - lp.bottomMargin, MeasureSpec.EXACTLY);
            child.measure(contentWidthSpec, contentHeightSpec);
        } else {
            child.setPadding(0, 0, 0, 0);
            final int drawerWidthSpec = getChildMeasureSpec(widthMeasureSpec, minDrawerMargin + lp.leftMargin + lp.rightMargin, lp.width);
            final int drawerHeightSpec = getChildMeasureSpec(heightMeasureSpec, lp.topMargin + lp.bottomMargin, lp.height);
            child.measure(drawerWidthSpec, drawerHeightSpec);
        }
    }
    //Telegram
    updateListBG();
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:43,代码来源:DrawerLayoutContainer.java

示例5: jumpDispatch

import android.view.View; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@TargetApi(19)
public static boolean jumpDispatch(View child) {
    return !child.getFitsSystemWindows() && !isHandleContainer(child);
}
 
开发者ID:QMUI,项目名称:QMUI_Android,代码行数:6,代码来源:QMUIWindowInsetHelper.java


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