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


Java WindowInsets.consumeSystemWindowInsets方法代碼示例

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


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

示例1: onApplyWindowInsets

import android.view.WindowInsets; //導入方法依賴的package包/類
@Override
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
    int l = insets.getSystemWindowInsetLeft();
    int t = insets.getSystemWindowInsetTop();
    int r = insets.getSystemWindowInsetRight();

    toolbar.setPadding(l, toolbar.getPaddingTop() + t, 0, 0);

    final boolean ltr = recyclerView.getLayoutDirection() == View.LAYOUT_DIRECTION_LTR;

    setPadding(getPaddingLeft(), getPaddingTop(), getPaddingEnd() + (ltr ? r : 0),
            getPaddingBottom()
    );

    setOnApplyWindowInsetsListener(null);
    return insets.consumeSystemWindowInsets();
}
 
開發者ID:Assassinss,項目名稱:Interessant,代碼行數:18,代碼來源:InsetsDrawerLayout.java

示例2: onApplyWindowInsets

import android.view.WindowInsets; //導入方法依賴的package包/類
@Override
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
    int l = insets.getSystemWindowInsetLeft();
    int t = insets.getSystemWindowInsetTop();
    int r = insets.getSystemWindowInsetRight();
    int b = insets.getSystemWindowInsetBottom();
    toolbar.setPadding(l, t, 0, 0);

    recyclerView.setPaddingRelative(recyclerView.getPaddingLeft() + l,
            recyclerView.getPaddingTop(),
            recyclerView.getPaddingRight(),
            recyclerView.getPaddingBottom() + b);

    final boolean ltr = recyclerView.getLayoutDirection() == View.LAYOUT_DIRECTION_LTR;

    setPadding(getPaddingLeft(), getPaddingTop(), getPaddingEnd() + (ltr ? r : 0),
            getPaddingBottom()
    );

    setOnApplyWindowInsetsListener(null);
    return insets.consumeSystemWindowInsets();
}
 
開發者ID:Assassinss,項目名稱:pretty-girl,代碼行數:23,代碼來源:InsetCoordinatorLayout.java

示例3: onApplyWindowInsets

import android.view.WindowInsets; //導入方法依賴的package包/類
@Override
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
    int b = insets.getSystemWindowInsetBottom();
    int r = insets.getSystemWindowInsetRight();

    pictureInfoLayout.setPadding(
            pictureInfoLayout.getPaddingLeft(),
            pictureInfoLayout.getPaddingTop(),
            pictureInfoLayout.getPaddingRight() + r,
            pictureInfoLayout.getPaddingBottom() + b);

    setOnApplyWindowInsetsListener(null);

    return insets.consumeSystemWindowInsets();
}
 
開發者ID:Assassinss,項目名稱:Moment,代碼行數:16,代碼來源:InsetsFrameLayout.java

示例4: onApplyWindowInsets

import android.view.WindowInsets; //導入方法依賴的package包/類
@TargetApi(21)
public WindowInsets onApplyWindowInsets(WindowInsets insets) {
  int childCount = getChildCount();
  boolean hasChildForWindowInsets = false;
  for(int i = 0x0; i < childCount; i = i + 0x1) {
    View child = getChildAt(i);
    if((child instanceof InsetsAware) && (((InsetsAware)child).shouldApplyWindowInsets())) {
      hasChildForWindowInsets = true;
      break;
    }
  }
  if(!hasChildForWindowInsets) {
    setPadding(insets.getSystemWindowInsetLeft(), insets.getSystemWindowInsetTop(), insets.getSystemWindowInsetRight(), insets.getSystemWindowInsetBottom());
    for(int i = 0x0; i < childCount; i = i + 0x1) {
      child = getChildAt(i);
      if(child.getId() == 0x7f1000cc) {
        child.setPadding(0x0, 0x0, 0x0, 0x0);
      }
    }
    return insets.consumeSystemWindowInsets();
  }
  setPadding(0x0, 0x0, 0x0, 0x0);
  for(int i = 0x0; i < childCount; i = i + 0x1) {
    child = getChildAt(i);
    if((isActionBar) || (wantsWindowInsets)) {
      child.dispatchApplyWindowInsets(insets);
    }
  }
  return insets.consumeSystemWindowInsets();
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:31,代碼來源:InsetsFrameLayout.java

示例5: onApplyWindowInsets

import android.view.WindowInsets; //導入方法依賴的package包/類
public final WindowInsets onApplyWindowInsets(View paramView, WindowInsets paramWindowInsets)
{
  DrawerLayoutImpl localDrawerLayoutImpl = (DrawerLayoutImpl)paramView;
  if (paramWindowInsets.getSystemWindowInsetTop() > 0) {}
  for (boolean bool = true;; bool = false)
  {
    localDrawerLayoutImpl.setChildInsets(paramWindowInsets, bool);
    return paramWindowInsets.consumeSystemWindowInsets();
  }
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:11,代碼來源:DrawerLayoutCompatApi21.java

示例6: onApplyWindowInsets

import android.view.WindowInsets; //導入方法依賴的package包/類
@Override
@TargetApi(Build.VERSION_CODES.KITKAT_WATCH)
public WindowInsets onApplyWindowInsets(WindowInsets insets) {
    // Update the configuration with the latest system insets and trigger a relayout
    // mConfig.updateSystemInsets(insets.getSystemWindowInsets());
    mConfig.updateSystemInsets(new Rect(insets.getSystemWindowInsetLeft(),
            insets.getSystemWindowInsetTop(),
            insets.getSystemWindowInsetRight(),
            insets.getSystemWindowInsetBottom()));
    requestLayout();
    return insets.consumeSystemWindowInsets();
}
 
開發者ID:jzhu1224,項目名稱:DeckView,代碼行數:13,代碼來源:DeckView.java

示例7: onApplyWindowInsets

import android.view.WindowInsets; //導入方法依賴的package包/類
public WindowInsets onApplyWindowInsets(View view, WindowInsets windowinsets)
{
    view = (DrawerLayoutImpl)view;
    boolean flag;
    if (windowinsets.getSystemWindowInsetTop() > 0)
    {
        flag = true;
    } else
    {
        flag = false;
    }
    view.setChildInsets(windowinsets, flag);
    return windowinsets.consumeSystemWindowInsets();
}
 
開發者ID:Hamz-a,項目名稱:MyCTFWriteUps,代碼行數:15,代碼來源:DrawerLayoutCompatApi21.java

示例8: onApplyWindowInsets

import android.view.WindowInsets; //導入方法依賴的package包/類
@Override public WindowInsets onApplyWindowInsets(WindowInsets insets) {
  ViewGroup.LayoutParams lp = getLayoutParams();
  lp.height = insets.getSystemWindowInsetTop();

  listener.onResize();

  return insets.consumeSystemWindowInsets();
}
 
開發者ID:JakeWharton,項目名稱:Telecine,代碼行數:9,代碼來源:OverlayView.java

示例9: onApplyWindowInsets

import android.view.WindowInsets; //導入方法依賴的package包/類
@Override
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
  final DrawerLayoutImpl drawerLayout = (DrawerLayoutImpl) v;
  drawerLayout.setChildInsets(insets, insets.getSystemWindowInsetTop() > 0);
  return insets.consumeSystemWindowInsets();
}
 
開發者ID:rogues-dev,項目名稱:superglue,代碼行數:7,代碼來源:DrawerLayoutCompatApi21.java

示例10: onApplyWindowInsets

import android.view.WindowInsets; //導入方法依賴的package包/類
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
    ((DrawerLayoutImpl) v).setChildInsets(insets, insets.getSystemWindowInsetTop() > 0);
    return insets.consumeSystemWindowInsets();
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:5,代碼來源:DrawerLayoutCompatApi21.java

示例11: onApplyWindowInsets

import android.view.WindowInsets; //導入方法依賴的package包/類
@Override
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
    final DrawerLayoutImpl drawerLayout = (DrawerLayoutImpl) v;
    drawerLayout.setChildInsets(insets, insets.getSystemWindowInsetTop() > 0);
    return insets.consumeSystemWindowInsets();
}
 
開發者ID:GigigoGreenLabs,項目名稱:permissionsModule,代碼行數:7,代碼來源:DrawerLayoutCompatApi21.java

示例12: onApplyWindowInsets

import android.view.WindowInsets; //導入方法依賴的package包/類
@Override
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
    final DrawerLayoutContainer drawerLayout = (DrawerLayoutContainer) v;
    drawerLayout.setChildInsets(insets, insets.getSystemWindowInsetTop() > 0);
    return insets.consumeSystemWindowInsets();
}
 
開發者ID:yeloapp,項目名稱:yelo-android,代碼行數:7,代碼來源:DrawerLayoutContainer.java

示例13: onApplyWindowInsets

import android.view.WindowInsets; //導入方法依賴的package包/類
@Override
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
	final DrawerLayout drawerLayout = (DrawerLayout) v;
	drawerLayout.setChildInsets(insets, insets.getSystemWindowInsetTop() > 0);
	return insets.consumeSystemWindowInsets();
}
 
開發者ID:Mishiranu,項目名稱:Dashchan,代碼行數:7,代碼來源:DrawerLayout.java

示例14: onApplyWindowInsets

import android.view.WindowInsets; //導入方法依賴的package包/類
@Override
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
	final DrawerLayoutImpl drawerLayout = (DrawerLayoutImpl) v;
	drawerLayout.setChildInsets(insets, insets.getSystemWindowInsetTop() > 0);
	return insets.consumeSystemWindowInsets();
}
 
開發者ID:williamwebb,項目名稱:debugdrawer,代碼行數:7,代碼來源:DrawerLayoutCompatApi21.java


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