当前位置: 首页>>代码示例>>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;未经允许,请勿转载。