本文整理了Java中android.graphics.drawable.Drawable.isStateful()
方法的一些代码示例,展示了Drawable.isStateful()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Drawable.isStateful()
方法的具体详情如下:
包路径:android.graphics.drawable.Drawable
类名称:Drawable
方法名:isStateful
暂无
代码示例来源:origin: facebook/litho
@Override
public boolean isStateful() {
return mDrawable.isStateful();
}
代码示例来源:origin: rey5137/material
@Override
public boolean isStateful() {
return mDrawable != null && mDrawable.isStateful();
}
代码示例来源:origin: rey5137/material
@Override
public boolean isStateful() {
return mBackgroundDrawable != null && mBackgroundDrawable.isStateful();
}
代码示例来源:origin: facebook/litho
@Override
public boolean isStateful() {
return mDrawable != null && mDrawable.isStateful();
}
代码示例来源:origin: facebook/litho
@Override
public boolean isStateful() {
return mDrawable.isStateful();
}
代码示例来源:origin: koral--/android-gif-drawable
@Override
public boolean isStateful() {
return super.isStateful() || (mTint != null && mTint.isStateful());
}
代码示例来源:origin: nickbutcher/plaid
@Override
protected void drawableStateChanged() {
super.drawableStateChanged();
if (foreground != null && foreground.isStateful()) {
foreground.setState(getDrawableState());
}
}
代码示例来源:origin: nickbutcher/plaid
@Override
protected void drawableStateChanged() {
super.drawableStateChanged();
if (foreground != null && foreground.isStateful()) {
foreground.setState(getDrawableState());
}
}
代码示例来源:origin: nickbutcher/plaid
@Override
protected void drawableStateChanged() {
super.drawableStateChanged();
if (mForeground != null && mForeground.isStateful()) {
mForeground.setState(getDrawableState());
}
}
代码示例来源:origin: google/ExoPlayer
private void updateDrawableState() {
if (scrubberDrawable != null && scrubberDrawable.isStateful()
&& scrubberDrawable.setState(getDrawableState())) {
invalidate();
}
}
代码示例来源:origin: smuyyh/BookReader
@Override
protected void drawableStateChanged() {
super.drawableStateChanged();
final Drawable d = mMarginDrawable;
if (d != null && d.isStateful()) {
d.setState(getDrawableState());
}
}
代码示例来源:origin: aa112901/remusic
@Override
protected void drawableStateChanged() {
super.drawableStateChanged();
final Drawable d = mMarginDrawable;
if (d != null && d.isStateful()) {
d.setState(getDrawableState());
}
}
代码示例来源:origin: TangoAgency/material-intro-screen
@Override
protected void drawableStateChanged() {
super.drawableStateChanged();
final Drawable d = mMarginDrawable;
if (d != null && d.isStateful()) {
d.setState(getDrawableState());
}
}
代码示例来源:origin: facebook/litho
/**
* Sets the state on a drawable if it is clickable or should duplicate its parent's state.
*/
static void maybeSetDrawableState(View view, Drawable drawable, int flags, NodeInfo nodeInfo) {
final boolean shouldSetState = (nodeInfo != null && nodeInfo.hasTouchEventHandlers())
|| MountItem.isDuplicateParentState(flags);
if (shouldSetState && drawable.isStateful()) {
drawable.setState(view.getDrawableState());
}
}
代码示例来源:origin: mikepenz/MaterialDrawer
@Override
protected void drawableStateChanged() {
super.drawableStateChanged();
if (mMaskDrawable != null && mMaskDrawable.isStateful()) {
mMaskDrawable.setState(getDrawableState());
}
if (isDuplicateParentStateEnabled()) {
ViewCompat.postInvalidateOnAnimation(this);
}
}
代码示例来源:origin: facebook/litho
public void release(Drawable drawable, int resId) {
SimplePoolWithCount<Drawable> drawablesPool = mDrawableCache.get(resId);
if (drawablesPool == null) {
drawablesPool = new SimplePoolWithCount<>(DRAWABLES_POOL_MAX_ITEMS);
mDrawableCache.put(resId, drawablesPool);
}
// Reset a stateful drawable, and its animations, before being released.
if (drawable.isStateful()) {
drawable.setState(StateSet.WILD_CARD);
if (SDK_INT >= HONEYCOMB) {
drawable.jumpToCurrentState();
}
}
drawablesPool.release(drawable);
}
代码示例来源:origin: ZieIony/Carbon
private void updateBackgroundTint() {
Drawable background = getBackground();
if (background instanceof RippleDrawable)
background = ((RippleDrawable) background).getBackground();
if (background == null)
return;
Carbon.setTintList(background, backgroundTint);
Carbon.setTintMode(background, backgroundTintMode);
if (background.isStateful())
background.setState(getDrawableState());
}
代码示例来源:origin: ZieIony/Carbon
private void updateBackgroundTint() {
Drawable background = getBackground();
if (background instanceof RippleDrawable)
background = ((RippleDrawable) background).getBackground();
if (background == null)
return;
Carbon.setTintList(background, backgroundTint);
Carbon.setTintMode(background, backgroundTintMode);
if (background.isStateful())
background.setState(getDrawableState());
}
代码示例来源:origin: ZieIony/Carbon
private void updateBackgroundTint() {
Drawable background = getBackground();
if (background instanceof RippleDrawable)
background = ((RippleDrawable) background).getBackground();
if (background == null)
return;
Carbon.setTintList(background, backgroundTint);
Carbon.setTintMode(background, backgroundTintMode);
if (background.isStateful())
background.setState(getDrawableState());
}
代码示例来源:origin: ZieIony/Carbon
private void updateBackgroundTint() {
Drawable background = getBackground();
if (background instanceof RippleDrawable)
background = ((RippleDrawable) background).getBackground();
if (background == null)
return;
Carbon.setTintList(background, backgroundTint);
Carbon.setTintMode(background, backgroundTintMode);
if (background.isStateful())
background.setState(getDrawableState());
}
内容来源于网络,如有侵权,请联系作者删除!