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


Java ViewParent.isLayoutRequested方法代码示例

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


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

示例1: setState

import android.view.ViewParent; //导入方法依赖的package包/类
public final void setState(final  int state) {
    if (state == mState) {
        return;
    }
    if (mViewRef == null) {
        // The view is not laid out yet; modify mState and let onLayoutChild handle it later
        if (state == STATE_COLLAPSED || state == STATE_EXPANDED ||
                (mHideable && state == STATE_HIDDEN)) {
            mState = state;
        }
        return;
    }
    final V child = mViewRef.get();
    if (child == null) {
        return;
    }
    // Start the animation; wait until a pending layout if there is one.
    ViewParent parent = child.getParent();
    if (parent != null && parent.isLayoutRequested() && ViewCompat.isAttachedToWindow(child)) {
        child.post(new Runnable() {
            @Override
            public void run() {
                startSettlingAnimation(child, state);
            }
        });
    } else {
        startSettlingAnimation(child, state);
    }
}
 
开发者ID:Krupen,项目名称:FabulousFilter,代码行数:30,代码来源:ViewPagerBottomSheetBehavior.java

示例2: requestLayoutParent

import android.view.ViewParent; //导入方法依赖的package包/类
public static void requestLayoutParent(View view, boolean isAll) {
    ViewParent parent = view.getParent();
    while (parent != null && parent instanceof View) {
        if (!parent.isLayoutRequested()) {
            parent.requestLayout();
            if (!isAll) {
                break;
            }
        }
        parent = parent.getParent();
    }
}
 
开发者ID:jeasinlee,项目名称:AndroidBasicLibs,代码行数:13,代码来源:ViewUtils.java

示例3: setState

import android.view.ViewParent; //导入方法依赖的package包/类
/**
 * Sets the state of the bottom sheet. The bottom sheet will transition to that state with
 * animation.
 *
 * @param state One of {@link #STATE_COLLAPSED}, {@link #STATE_EXPANDED}, or
 *              {@link #STATE_HIDDEN}.
 */
public final void setState(final @State int state) {
    if (state == mState) {
        return;
    }
    if (mViewRef == null) {
        // The view is not laid out yet; modify mState and let onLayoutChild handle it later
        if (state == STATE_COLLAPSED || state == STATE_EXPANDED ||
                (mHideable && state == STATE_HIDDEN)) {
            mState = state;
        }
        return;
    }
    final V child = mViewRef.get();
    if (child == null) {
        return;
    }
    // Start the animation; wait until a pending layout if there is one.
    ViewParent parent = child.getParent();
    if (parent != null && parent.isLayoutRequested() && ViewCompat.isAttachedToWindow(child)) {
        child.post(new Runnable() {
            @Override
            public void run() {
                startSettlingAnimation(child, state);
            }
        });
    } else {
        startSettlingAnimation(child, state);
    }
}
 
开发者ID:OhMyLob,项目名称:Paper-Launcher,代码行数:37,代码来源:BottomSheetBehaviorV2.java

示例4: setState

import android.view.ViewParent; //导入方法依赖的package包/类
/**
 * Sets the state of the bottom sheet. The bottom sheet will transition to that state with
 * animation.
 *
   * @param state One of {@link #STATE_COLLAPSED}, {@link #STATE_EXPANDED}, or
   *              {@link #STATE_HIDDEN}.
 */
public final void setState(final @State int state) {
  if (state == mState) {
    return;
  }
  if (mViewRef == null) {
    // The view is not laid out yet; modify mState and let onLayoutChild handle it later
          if (state == STATE_COLLAPSED || state == STATE_EXPANDED ||
                  (mHideable && state == STATE_HIDDEN)) {
      mState = state;
    }
    return;
  }
  final V child = mViewRef.get();
  if (child == null) {
    return;
  }
  // Start the animation; wait until a pending layout if there is one.
  ViewParent parent = child.getParent();
  if (parent != null && parent.isLayoutRequested() && ViewCompat.isAttachedToWindow(child)) {
          child.post(new Runnable() {
          @Override
          public void run() {
            startSettlingAnimation(child, state);
          }
        });
  } else {
    startSettlingAnimation(child, state);
  }
}
 
开发者ID:commonsguy,项目名称:cwac-crossport,代码行数:37,代码来源:BottomSheetBehavior.java


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