本文整理了Java中android.support.v7.widget.Toolbar.setBackgroundDrawable()
方法的一些代码示例,展示了Toolbar.setBackgroundDrawable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Toolbar.setBackgroundDrawable()
方法的具体详情如下:
包路径:android.support.v7.widget.Toolbar
类名称:Toolbar
方法名:setBackgroundDrawable
暂无
代码示例来源:origin: aa112901/remusic
@Override
public void setBackgroundDrawable(Drawable background) {
super.setBackgroundDrawable(background);
if (mBackgroundHelper != null) {
mBackgroundHelper.setBackgroundDrawableExternal(background);
}
}
代码示例来源:origin: qiujuer/Genius-Android
private void initToolbar() {
// ToolBar
RipAnimDrawable ripAnim = new RipAnimDrawable();
ripAnim.setColor(getResources().getColor(R.color.cyan_600));
ripAnim.setFluCount(0, 0, 0, 36);
Toolbar toolbar = (Toolbar) findViewById(R.id.title);
toolbar.setBackgroundDrawable(ripAnim);
toolbar.setTitle(getTitle());
toolbar.inflateMenu(R.menu.menu_main);
toolbar.setOnMenuItemClickListener(this);
}
代码示例来源:origin: GrenderG/Color-O-Matic
void updateToolbar(int oldColor, int newColor) {
final TransitionDrawable transition = new TransitionDrawable(new ColorDrawable[]{
new ColorDrawable(oldColor), new ColorDrawable(newColor)
});
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
toolbar.setBackground(transition);
} else {
toolbar.setBackgroundDrawable(transition);
}
transition.startTransition(300);
}
代码示例来源:origin: Kunzisoft/AndroidClearChroma
private void updateToolbarAndStatusBar(int newColor) {
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
toolbar.setBackground(new ColorDrawable(newColor));
}
else {
toolbar.setBackgroundDrawable(new ColorDrawable(newColor));
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().setStatusBarColor(darkenColor(newColor));
}
}
内容来源于网络,如有侵权,请联系作者删除!