@TestTargetNew(
      level = TestLevel.COMPLETE,
      method = "setColorFilter",
      args = {android.graphics.ColorFilter.class})
  public void testSetColorFilter() {
    ColorFilter filter = new ColorFilter();
    mRotateDrawable.setColorFilter(filter);
    assertSame(
        filter, ((BitmapDrawable) mRotateDrawable.getDrawable()).getPaint().getColorFilter());

    mRotateDrawable.setColorFilter(null);
    assertNull(((BitmapDrawable) mRotateDrawable.getDrawable()).getPaint().getColorFilter());
  }
예제 #2
0
 public PlayingIndicator(Context context, AttributeSet attrs) {
   super(context, attrs);
   setImageResource(R.drawable.now_playing_indicator);
   mRotateDrawable = (RotateDrawable) getDrawable();
   if (!VersionUtils.hasLollipop()) {
     mRotateDrawable.setColorFilter(
         ThemeUtils.getColorAccent(getContext()), PorterDuff.Mode.SRC_IN);
   }
 }