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


Java DrawableCompat.setLayoutDirection方法代碼示例

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


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

示例1: setStatusBarScrim

import android.support.v4.graphics.drawable.DrawableCompat; //導入方法依賴的package包/類
/**
 * Set the drawable to use for the status bar scrim from resources.
 * Providing null will disable the scrim functionality.
 * <p>
 * <p>This scrim is only shown when we have been given a top system inset.</p>
 *
 * @param drawable the drawable to display
 * @see #getStatusBarScrim()
 */
public void setStatusBarScrim(@Nullable Drawable drawable) {
    if (mStatusBarScrim != drawable) {
        if (mStatusBarScrim != null) {
            mStatusBarScrim.setCallback(null);
        }
        mStatusBarScrim = drawable != null ? drawable.mutate() : null;
        if (mStatusBarScrim != null) {
            if (mStatusBarScrim.isStateful()) {
                mStatusBarScrim.setState(getDrawableState());
            }
            DrawableCompat.setLayoutDirection(mStatusBarScrim,
                    ViewCompat.getLayoutDirection(this));
            mStatusBarScrim.setVisible(getVisibility() == VISIBLE, false);
            mStatusBarScrim.setCallback(this);
            mStatusBarScrim.setAlpha(mScrimAlpha);
        }
        ViewCompat.postInvalidateOnAnimation(this);
    }
}
 
開發者ID:coopese,項目名稱:qmui,代碼行數:29,代碼來源:QMUICollapsingTopBarLayout.java

示例2: setStatusBarBackground

import android.support.v4.graphics.drawable.DrawableCompat; //導入方法依賴的package包/類
/**
   * Set a drawable to draw in the insets area for the status bar.
   * Note that this will only be activated if this DrawerLayout fitsSystemWindows.
 *
 * @param bg Background drawable to draw behind the status bar
 */
public void setStatusBarBackground(@Nullable final Drawable bg) {
  if (mStatusBarBackground != bg) {
    if (mStatusBarBackground != null) {
      mStatusBarBackground.setCallback(null);
    }
    mStatusBarBackground = bg != null ? bg.mutate() : null;
    if (mStatusBarBackground != null) {
      if (mStatusBarBackground.isStateful()) {
        mStatusBarBackground.setState(getDrawableState());
      }
              DrawableCompat.setLayoutDirection(mStatusBarBackground,
                      ViewCompat.getLayoutDirection(this));
      mStatusBarBackground.setVisible(getVisibility() == VISIBLE, false);
      mStatusBarBackground.setCallback(this);
    }
    ViewCompat.postInvalidateOnAnimation(this);
  }
}
 
開發者ID:commonsguy,項目名稱:cwac-crossport,代碼行數:25,代碼來源:CoordinatorLayout.java

示例3: setStatusBarBackground

import android.support.v4.graphics.drawable.DrawableCompat; //導入方法依賴的package包/類
public void setStatusBarBackground(@Nullable Drawable bg) {
    Drawable drawable = null;
    if (this.mStatusBarBackground != bg) {
        if (this.mStatusBarBackground != null) {
            this.mStatusBarBackground.setCallback(null);
        }
        if (bg != null) {
            drawable = bg.mutate();
        }
        this.mStatusBarBackground = drawable;
        if (this.mStatusBarBackground != null) {
            if (this.mStatusBarBackground.isStateful()) {
                this.mStatusBarBackground.setState(getDrawableState());
            }
            DrawableCompat.setLayoutDirection(this.mStatusBarBackground, ViewCompat.getLayoutDirection(this));
            this.mStatusBarBackground.setVisible(getVisibility() == 0, false);
            this.mStatusBarBackground.setCallback(this);
        }
        ViewCompat.postInvalidateOnAnimation(this);
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:22,代碼來源:CoordinatorLayout.java

示例4: setStatusBarScrim

import android.support.v4.graphics.drawable.DrawableCompat; //導入方法依賴的package包/類
public void setStatusBarScrim(@Nullable Drawable drawable) {
    Drawable drawable2 = null;
    if (this.mStatusBarScrim != drawable) {
        if (this.mStatusBarScrim != null) {
            this.mStatusBarScrim.setCallback(null);
        }
        if (drawable != null) {
            drawable2 = drawable.mutate();
        }
        this.mStatusBarScrim = drawable2;
        if (this.mStatusBarScrim != null) {
            if (this.mStatusBarScrim.isStateful()) {
                this.mStatusBarScrim.setState(getDrawableState());
            }
            DrawableCompat.setLayoutDirection(this.mStatusBarScrim, ViewCompat.getLayoutDirection(this));
            this.mStatusBarScrim.setVisible(getVisibility() == 0, false);
            this.mStatusBarScrim.setCallback(this);
            this.mStatusBarScrim.setAlpha(this.mScrimAlpha);
        }
        ViewCompat.postInvalidateOnAnimation(this);
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:23,代碼來源:CollapsingToolbarLayout.java

示例5: mirror

import android.support.v4.graphics.drawable.DrawableCompat; //導入方法依賴的package包/類
private boolean mirror(Drawable drawable, int layoutDirection) {
    if (drawable == null || !DrawableCompat.isAutoMirrored(drawable)) {
        return false;
    }
    DrawableCompat.setLayoutDirection(drawable, layoutDirection);
    return true;
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:8,代碼來源:DrawerLayout.java


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