本文整理汇总了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);
}
}
}
示例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);
}
示例3: getFitsSystemWindows
import android.view.View; //导入方法依赖的package包/类
public static boolean getFitsSystemWindows(View view) {
return view.getFitsSystemWindows();
}
示例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();
}
示例5: jumpDispatch
import android.view.View; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@TargetApi(19)
public static boolean jumpDispatch(View child) {
return !child.getFitsSystemWindows() && !isHandleContainer(child);
}