當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。