本文整理了Java中android.view.View.isLayoutRequested()
方法的一些代码示例,展示了View.isLayoutRequested()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。View.isLayoutRequested()
方法的具体详情如下:
包路径:android.view.View
类名称:View
方法名:isLayoutRequested
暂无
代码示例来源:origin: bumptech/glide
if (waitForLayout && view.isLayoutRequested()) {
return PENDING_SIZE;
if (!view.isLayoutRequested() && paramSize == LayoutParams.WRAP_CONTENT) {
if (Log.isLoggable(TAG, Log.INFO)) {
Log.i(TAG, "Glide treats LayoutParams.WRAP_CONTENT as a request for an image the size of"
代码示例来源:origin: bumptech/glide
if (waitForLayout && view.isLayoutRequested()) {
return PENDING_SIZE;
if (!view.isLayoutRequested() && paramSize == LayoutParams.WRAP_CONTENT) {
if (Log.isLoggable(TAG, Log.INFO)) {
Log.i(TAG, "Glide treats LayoutParams.WRAP_CONTENT as a request for an image the size of"
代码示例来源:origin: facebook/litho
private static void performLayoutOnChildrenIfNecessary(ComponentHost host) {
for (int i = 0, count = host.getChildCount(); i < count; i++) {
final View child = host.getChildAt(i);
if (child.isLayoutRequested()) {
// The hosting view doesn't allow children to change sizes dynamically as
// this would conflict with the component's own layout calculations.
child.measure(
MeasureSpec.makeMeasureSpec(child.getWidth(), MeasureSpec.EXACTLY),
MeasureSpec.makeMeasureSpec(child.getHeight(), MeasureSpec.EXACTLY));
child.layout(child.getLeft(), child.getTop(), child.getRight(), child.getBottom());
}
if (child instanceof ComponentHost) {
performLayoutOnChildrenIfNecessary((ComponentHost) child);
}
}
}
代码示例来源:origin: square/assertj-android
public S hasLayoutRequested() {
isNotNull();
assertThat(actual.isLayoutRequested()) //
.overridingErrorMessage("Expected to have layout requested but was not") //
.isTrue();
return myself;
}
代码示例来源:origin: square/assertj-android
public S hasNoLayoutRequested() {
isNotNull();
assertThat(actual.isLayoutRequested()) //
.overridingErrorMessage("Expected to not have layout requested but had") //
.isFalse();
return myself;
}
代码示例来源:origin: facebook/litho
((View) content).isLayoutRequested()) {
final View view = (View) content;
applyBoundsToMountContent(
代码示例来源:origin: chentao0707/SimplifyReader
mMotionPosition == position;
final boolean updateChildPressed = isPressed != child.isPressed();
final boolean needToMeasure = !recycled || updateChildSelected || child.isLayoutRequested();
代码示例来源:origin: facebook/litho
private static void updateBoundsForMountedLayoutOutput(
LayoutOutput layoutOutput, LayoutState layoutState, BitSet skipMounting, MountItem item) {
// MountState should never update the bounds of the top-level host as this
// should be done by the ViewGroup containing the LithoView.
if (layoutOutput.getId() == ROOT_HOST_ID) {
return;
}
getActualBounds(layoutOutput, layoutState, skipMounting, sTempRect);
final boolean forceTraversal =
Component.isMountViewSpec(layoutOutput.getComponent())
&& ((View) item.getBaseContent()).isLayoutRequested();
applyBoundsToMountContent(
item.getMountableContent(),
sTempRect.left,
sTempRect.top,
sTempRect.right,
sTempRect.bottom,
forceTraversal /* force */);
}
代码示例来源:origin: UweTrottmann/SeriesGuide
@Override
protected void layoutChildren() {
super.layoutChildren();
if (mFloatView != null) {
if (mFloatView.isLayoutRequested() && !mFloatViewOnMeasured) {
// Have to measure here when usual android measure
// pass is skipped. This happens during a drag-sort
// when layoutChildren is called directly.
measureFloatView();
}
mFloatView.layout(0, 0, mFloatView.getMeasuredWidth(), mFloatView.getMeasuredHeight());
mFloatViewOnMeasured = false;
}
}
代码示例来源:origin: UweTrottmann/SeriesGuide
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
// Log.d("mobeta", "onMeasure called");
if (mFloatView != null) {
if (mFloatView.isLayoutRequested()) {
measureFloatView();
}
mFloatViewOnMeasured = true; // set to false after layout
}
mWidthMeasureSpec = widthMeasureSpec;
}
代码示例来源:origin: UweTrottmann/SeriesGuide
/**
*
*/
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int height = MeasureSpec.getSize(heightMeasureSpec);
int width = MeasureSpec.getSize(widthMeasureSpec);
int heightMode = MeasureSpec.getMode(heightMeasureSpec);
final View child = getChildAt(0);
if (child == null) {
setMeasuredDimension(0, width);
return;
}
if (child.isLayoutRequested()) {
// Always let child be as tall as it wants.
measureChild(child, widthMeasureSpec,
MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
}
if (heightMode == MeasureSpec.UNSPECIFIED) {
ViewGroup.LayoutParams lp = getLayoutParams();
if (lp.height > 0) {
height = lp.height;
} else {
height = child.getMeasuredHeight();
}
}
setMeasuredDimension(width, height);
}
代码示例来源:origin: xiepeijie/SwipeCardView
addViewInLayout(child, 0, lp, true);
final boolean needToMeasure = child.isLayoutRequested();
if (needToMeasure) {
int childWidthSpec = getChildMeasureSpec(getWidthMeasureSpec(),
代码示例来源:origin: com.facebook.testing.screenshot/core
private void layoutInternal() {
do {
mView.measure(mWidthMeasureSpec, mHeightMeasureSpec);
layoutView();
} while (mView.isLayoutRequested());
}
代码示例来源:origin: com.squareup.assertj/assertj-android
public S hasLayoutRequested() {
isNotNull();
assertThat(actual.isLayoutRequested()) //
.overridingErrorMessage("Expected to have layout requested but was not") //
.isTrue();
return myself;
}
代码示例来源:origin: com.squareup.assertj/assertj-android
public S hasNoLayoutRequested() {
isNotNull();
assertThat(actual.isLayoutRequested()) //
.overridingErrorMessage("Expected to not have layout requested but had") //
.isFalse();
return myself;
}
代码示例来源:origin: vanilla-music/vanilla
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
// Log.d("mobeta", "onMeasure called");
if (mFloatView != null) {
if (mFloatView.isLayoutRequested()) {
measureFloatView();
}
mFloatViewOnMeasured = true; // set to false after layout
}
mWidthMeasureSpec = widthMeasureSpec;
}
代码示例来源:origin: devinhu/androidone
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
// Log.d("mobeta", "onMeasure called");
if (mFloatView != null) {
if (mFloatView.isLayoutRequested()) {
measureFloatView();
}
mFloatViewOnMeasured = true; // set to false after layout
}
mWidthMeasureSpec = widthMeasureSpec;
}
代码示例来源:origin: yukuku/androidbible
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
//Log.d("mobeta", "onMeasure called");
if (mFloatView != null) {
if (mFloatView.isLayoutRequested()) {
measureFloatView();
}
mFloatViewOnMeasured = true; //set to false after layout
}
mWidthMeasureSpec = widthMeasureSpec;
}
代码示例来源:origin: yomguy/servestream
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
// Log.d("mobeta", "onMeasure called");
if (mFloatView != null) {
if (mFloatView.isLayoutRequested()) {
measureFloatView();
}
mFloatViewOnMeasured = true; // set to false after layout
}
mWidthMeasureSpec = widthMeasureSpec;
}
代码示例来源:origin: namndbka/QDict
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
// Log.d("mobeta", "onMeasure called");
if (mFloatView != null) {
if (mFloatView.isLayoutRequested()) {
measureFloatView();
}
mFloatViewOnMeasured = true; // set to false after layout
}
mWidthMeasureSpec = widthMeasureSpec;
}
内容来源于网络,如有侵权,请联系作者删除!