android.support.v4.app.ActivityCompat#getDrawable ( )源码实例Demo

下面列出了android.support.v4.app.ActivityCompat#getDrawable ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: FileManager   文件: BaseToolBar.java
public void setCenterDrawableRight(int ResId) {
    Drawable drawable = ActivityCompat.getDrawable(mContext, ResId);
    //要加这句才能显示
    drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
    centerView.setCompoundDrawables(null, null, drawable, null);
    centerView.setClickable(true);
}
 
源代码2 项目: FileManager   文件: BaseToolBar.java
public void setRightDrawableRight(int ResId) {
    Drawable drawable = ActivityCompat.getDrawable(mContext, ResId);
    //要加这句才能显示
    drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
    rightView.setCompoundDrawables(null, null, drawable, null);
    rightView.setClickable(true);
}
 
源代码3 项目: FileManager   文件: BaseToolBar.java
public void setLeftDrawableRight(int ResId) {
    Drawable drawable = ActivityCompat.getDrawable(mContext, ResId);
    //要加这句才能显示
    drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
    leftView.setCompoundDrawables(null, null, drawable, null);
    leftView.setClickable(true);
}
 
源代码4 项目: FileManager   文件: DividerGridItemDecoration.java
public DividerGridItemDecoration(Context context) {
    mDivider = ActivityCompat.getDrawable(context, R.drawable.divider_bg);
}