android.view.View.drawableStateChanged()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(163)

本文整理了Java中android.view.View.drawableStateChanged()方法的一些代码示例,展示了View.drawableStateChanged()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。View.drawableStateChanged()方法的具体详情如下:
包路径:android.view.View
类名称:View
方法名:drawableStateChanged

View.drawableStateChanged介绍

暂无

代码示例

代码示例来源:origin: google/ExoPlayer

@Override
protected void drawableStateChanged() {
 super.drawableStateChanged();
 updateDrawableState();
}

代码示例来源:origin: qiujuer/Genius-Android

@Override
protected void drawableStateChanged() {
  super.drawableStateChanged();
  updateFromDrawableState();
}

代码示例来源:origin: jdsjlzx/LRecyclerView

@Override
protected void drawableStateChanged() {
  super.drawableStateChanged();
  updateDrawableState();
}

代码示例来源:origin: rey5137/material

@Override
protected void drawableStateChanged() {
  super.drawableStateChanged();
  if(mBackground != null)
    mBackground.setState(getDrawableState());
  if(mIcon != null)
    mIcon.setState(getDrawableState());
  if(mPrevIcon != null)
    mPrevIcon.setState(getDrawableState());
}

代码示例来源:origin: ZieIony/Carbon

@Override
protected void drawableStateChanged() {
  super.drawableStateChanged();
  if (rippleDrawable != null && rippleDrawable.getStyle() != RippleDrawable.Style.Background)
    rippleDrawable.setState(getDrawableState());
  if (stateAnimator != null)
    stateAnimator.setState(getDrawableState());
  if (tint != null && tint instanceof AnimatedColorStateList)
    ((AnimatedColorStateList) tint).setState(getDrawableState());
  if (backgroundTint != null && backgroundTint instanceof AnimatedColorStateList)
    ((AnimatedColorStateList) backgroundTint).setState(getDrawableState());
  if (ambientShadow != null && ambientShadowColor != null)
    ambientShadowColorFilter = new PorterDuffColorFilter(ambientShadowColor.getColorForState(getDrawableState(), ambientShadowColor.getDefaultColor()), PorterDuff.Mode.MULTIPLY);
  if (spotShadow != null && spotShadowColor != null)
    spotShadowColorFilter = new PorterDuffColorFilter(spotShadowColor.getColorForState(getDrawableState(), spotShadowColor.getDefaultColor()), PorterDuff.Mode.MULTIPLY);
}

代码示例来源:origin: dongjunkun/GanK

@Override
protected void drawableStateChanged() {
  super.drawableStateChanged();
  updateDrawableState();
}

代码示例来源:origin: bzsome/VirtualApp-x326

@Override
protected void drawableStateChanged() {
  super.drawableStateChanged();
  updateDrawableState();
}

代码示例来源:origin: com.willowtreeapps/oak-demos

@Override
protected void drawableStateChanged() {
  super.drawableStateChanged();
  updateDrawableState();
}

代码示例来源:origin: com.actionbarsherlock/actionbarsherlock

@Override
protected void drawableStateChanged() {
  super.drawableStateChanged();
  updateDrawableState();
}

代码示例来源:origin: darkskygit/VirtualApp

@Override
protected void drawableStateChanged() {
  super.drawableStateChanged();
  updateDrawableState();
}

代码示例来源:origin: PrivacyApps/document-viewer

@Override
protected void drawableStateChanged() {
  super.drawableStateChanged();
  if (mTextColor != null && mTextColor.isStateful()) {
    updateTextColors();
  }
}

代码示例来源:origin: MCMrARM/revolution-irc

@Override
protected void drawableStateChanged() {
  super.drawableStateChanged();
  if (mScrollbarDrawable.setState(getDrawableState()))
    invalidate();
}

代码示例来源:origin: derry/delion

@Override
  protected void drawableStateChanged() {
    super.drawableStateChanged();
    if (mRefineIcon != null && mRefineIcon.isStateful()) {
      mRefineIcon.setState(getDrawableState());
    }
  }
};

代码示例来源:origin: marverenic/Jockey

@Override
protected void drawableStateChanged() {
  super.drawableStateChanged();
  if (mThumb != null && mThumb.isStateful()) {
    int[] state = getDrawableState();
    mThumb.setState(state);
  }
  invalidate();
}

代码示例来源:origin: enginebai/SwagPoints

@Override
protected void drawableStateChanged() {
  super.drawableStateChanged();
  if (mIndicatorIcon != null && mIndicatorIcon.isStateful()) {
    int[] state = getDrawableState();
    mIndicatorIcon.setState(state);
  }
  invalidate();
}

代码示例来源:origin: GoodieBag/ProtractorView

@Override
protected void drawableStateChanged() {
  super.drawableStateChanged();
  if (mThumb != null && mThumb.isStateful()) {
    int[] state = getDrawableState();
    mThumb.setState(state);
  }
  invalidate();
}

代码示例来源:origin: YiiGuxing/CompositionAvatar

@Override
protected void drawableStateChanged() {
  super.drawableStateChanged();
  boolean invalidate = false;
  for (DrawableInfo drawable : mDrawables) {
    Drawable d = drawable.mDrawable;
    if (d.isStateful() && d.setState(getDrawableState())) {
      invalidate = true;
    }
  }
  if (invalidate) {
    invalidate();
  }
}

代码示例来源:origin: AlexMofer/ZxingScanView

@Override
protected void drawableStateChanged() {
  if (mOpenDrawable != null && mOpenDrawable.isStateful()) {
    mOpenDrawable.setState(getDrawableState());
  }
  if (mErrorDrawable != null && mErrorDrawable.isStateful()) {
    mErrorDrawable.setState(getDrawableState());
  }
  super.drawableStateChanged();
}

代码示例来源:origin: AlexMofer/ProjectX

@Override
protected void drawableStateChanged() {
  if (mOpenDrawable != null && mOpenDrawable.isStateful()) {
    mOpenDrawable.setState(getDrawableState());
  }
  if (mErrorDrawable != null && mErrorDrawable.isStateful()) {
    mErrorDrawable.setState(getDrawableState());
  }
  super.drawableStateChanged();
}

代码示例来源:origin: AlexMofer/SelectionView

@Override
protected void drawableStateChanged() {
  if (mBarBackground != null && mBarBackground.isStateful()) {
    mBarBackground.setState(getDrawableState());
  }
  if (mBarSlider != null && mBarSlider.isStateful()) {
    mBarSlider.setState(getDrawableState());
  }
  super.drawableStateChanged();
}

相关文章

View类方法