/** * {@inheritDoc} */ @Override public void setShowBackground(boolean show) { if (mBackgroundDrawable.getShowBackground() != show) { mBackgroundDrawable.setShowBackground(show); mSecondaryProgressDrawable.setShowBackground(!show); } }
/** * Set whether the current drawable should show a background. The default is {@code true}. * * @param show Whether background should be shown, or ignored if the progress drawable does not * implement {@link ShowBackgroundDrawable}. */ public void setShowProgressBackground(boolean show) { Drawable drawable = getCurrentDrawable(); if (drawable instanceof ShowBackgroundDrawable) { ((ShowBackgroundDrawable) drawable).setShowBackground(show); } Drawable indeterminateDrawable = getIndeterminateDrawable(); if (indeterminateDrawable instanceof ShowBackgroundDrawable) { ((ShowBackgroundDrawable) indeterminateDrawable).setShowBackground(show); } }