當前位置: 首頁>>代碼示例>>Java>>正文


Java WindowInsetsCompat.isConsumed方法代碼示例

本文整理匯總了Java中android.support.v4.view.WindowInsetsCompat.isConsumed方法的典型用法代碼示例。如果您正苦於以下問題:Java WindowInsetsCompat.isConsumed方法的具體用法?Java WindowInsetsCompat.isConsumed怎麽用?Java WindowInsetsCompat.isConsumed使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v4.view.WindowInsetsCompat的用法示例。


在下文中一共展示了WindowInsetsCompat.isConsumed方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: dispatchApplyWindowInsetsToBehaviors

import android.support.v4.view.WindowInsetsCompat; //導入方法依賴的package包/類
private WindowInsetsCompat dispatchApplyWindowInsetsToBehaviors(WindowInsetsCompat insets) {
  if (insets.isConsumed()) {
    return insets;
  }

  for (int i = 0, z = getChildCount(); i < z; i++) {
    final View child = getChildAt(i);
    if (ViewCompat.getFitsSystemWindows(child)) {
      final LayoutParams lp = (LayoutParams) child.getLayoutParams();
      final Behavior b = lp.getBehavior();

      if (b != null) {
        // If the view has a behavior, let it try first
        insets = b.onApplyWindowInsets(this, child, insets);
        if (insets.isConsumed()) {
          // If it consumed the insets, break
          break;
        }
      }
    }
  }

  return insets;
}
 
開發者ID:commonsguy,項目名稱:cwac-crossport,代碼行數:25,代碼來源:CoordinatorLayout.java

示例2: dispatchApplyWindowInsetsToBehaviors

import android.support.v4.view.WindowInsetsCompat; //導入方法依賴的package包/類
private WindowInsetsCompat dispatchApplyWindowInsetsToBehaviors(WindowInsetsCompat insets) {
    if (insets.isConsumed()) {
        return insets;
    }
    int z = getChildCount();
    for (int i = 0; i < z; i++) {
        View child = getChildAt(i);
        if (ViewCompat.getFitsSystemWindows(child)) {
            Behavior b = ((LayoutParams) child.getLayoutParams()).getBehavior();
            if (b != null) {
                insets = b.onApplyWindowInsets(this, child, insets);
                if (insets.isConsumed()) {
                    break;
                }
            } else {
                continue;
            }
        }
    }
    return insets;
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:22,代碼來源:CoordinatorLayout.java

示例3: setWindowInsets

import android.support.v4.view.WindowInsetsCompat; //導入方法依賴的package包/類
private void setWindowInsets(WindowInsetsCompat insets) {
    // Invalidate the total scroll range...
    mTotalScrollRange = INVALID_SCROLL_RANGE;
    mLastInsets = insets;

    // Now dispatch them to our children
    for (int i = 0, z = getChildCount(); i < z; i++) {
        final View child = getChildAt(i);
        insets = ViewCompat.dispatchApplyWindowInsets(child, insets);
        if (insets.isConsumed()) {
            break;
        }
    }
}
 
開發者ID:mobvoi,項目名稱:ticdesign,代碼行數:15,代碼來源:AppBarLayout.java

示例4: dispatchChildApplyWindowInsets

import android.support.v4.view.WindowInsetsCompat; //導入方法依賴的package包/類
private void dispatchChildApplyWindowInsets(WindowInsetsCompat insets) {
    if (insets.isConsumed()) {
        return;
    }

    for (int i = 0, z = getChildCount(); i < z; i++) {
        final View child = getChildAt(i);
        if (ViewCompat.getFitsSystemWindows(child)) {
            final LayoutParams lp = (LayoutParams) child.getLayoutParams();
            final Behavior b = lp.getBehavior();

            if (b != null) {
                // If the view has a behavior, let it try first
                insets = b.onApplyWindowInsets(this, child, insets);
                if (insets.isConsumed()) {
                    // If it consumed the insets, break
                    break;
                }
            }

            // Now let the view try and consume them
            insets = ViewCompat.dispatchApplyWindowInsets(child, insets);
            if (insets.isConsumed()) {
                break;
            }
        }
    }
}
 
開發者ID:mobvoi,項目名稱:ticdesign,代碼行數:29,代碼來源:CoordinatorLayout.java

示例5: setWindowInsets

import android.support.v4.view.WindowInsetsCompat; //導入方法依賴的package包/類
private void setWindowInsets(WindowInsetsCompat insets) {
    // Now dispatch them to our children
    for (int i = 0, z = getChildCount(); i < z; i++) {
        final View child = getChildAt(i);
        insets = ViewCompat.dispatchApplyWindowInsets(child, insets);
        if (insets.isConsumed()) {
            break;
        }
    }
}
 
開發者ID:xu6148152,項目名稱:binea_project_for_android,代碼行數:11,代碼來源:InsetsPercentRelativeLayout.java

示例6: setWindowInsets

import android.support.v4.view.WindowInsetsCompat; //導入方法依賴的package包/類
private void setWindowInsets(WindowInsetsCompat paramWindowInsetsCompat)
{
  boolean bool1 = true;
  int i = 0;
  if (this.mLastInsets != paramWindowInsetsCompat)
  {
    this.mLastInsets = paramWindowInsetsCompat;
    boolean bool2;
    if ((paramWindowInsetsCompat != null) && (paramWindowInsetsCompat.getSystemWindowInsetTop() > 0))
    {
      bool2 = bool1;
      this.mDrawStatusBarBackground = bool2;
      if ((this.mDrawStatusBarBackground) || (getBackground() != null)) {
        break label144;
      }
    }
    for (;;)
    {
      setWillNotDraw(bool1);
      if (paramWindowInsetsCompat.isConsumed()) {
        break label149;
      }
      int j = getChildCount();
      WindowInsetsCompat localWindowInsetsCompat = paramWindowInsetsCompat;
      while (i < j)
      {
        View localView = getChildAt(i);
        if (ViewCompat.getFitsSystemWindows(localView))
        {
          if ((((LayoutParams)localView.getLayoutParams()).mBehavior != null) && (localWindowInsetsCompat.isConsumed())) {
            break;
          }
          localWindowInsetsCompat = ViewCompat.dispatchApplyWindowInsets(localView, localWindowInsetsCompat);
          if (localWindowInsetsCompat.isConsumed()) {
            break;
          }
        }
        i++;
      }
      bool2 = false;
      break;
      label144:
      bool1 = false;
    }
    label149:
    requestLayout();
  }
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:49,代碼來源:CoordinatorLayout.java


注:本文中的android.support.v4.view.WindowInsetsCompat.isConsumed方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。