Add ProgressBar methods to set tileable Drawables
BUG: 8349406 Change-Id: I068ac291c8db19f3c8991675f141ccfc0c7b29b2
This commit is contained in:
@@ -31778,11 +31778,13 @@ package android.widget {
|
||||
method public android.os.Parcelable onSaveInstanceState();
|
||||
method public synchronized void setIndeterminate(boolean);
|
||||
method public void setIndeterminateDrawable(android.graphics.drawable.Drawable);
|
||||
method public void setIndeterminateDrawableTiled(android.graphics.drawable.Drawable);
|
||||
method public void setInterpolator(android.content.Context, int);
|
||||
method public void setInterpolator(android.view.animation.Interpolator);
|
||||
method public synchronized void setMax(int);
|
||||
method public synchronized void setProgress(int);
|
||||
method public void setProgressDrawable(android.graphics.drawable.Drawable);
|
||||
method public void setProgressDrawableTiled(android.graphics.drawable.Drawable);
|
||||
method public synchronized void setSecondaryProgress(int);
|
||||
}
|
||||
|
||||
|
||||
@@ -259,10 +259,9 @@ public class ProgressBar extends View {
|
||||
|
||||
Drawable drawable = a.getDrawable(R.styleable.ProgressBar_progressDrawable);
|
||||
if (drawable != null) {
|
||||
drawable = tileify(drawable, false);
|
||||
// Calling this method can set mMaxHeight, make sure the corresponding
|
||||
// XML attribute for mMaxHeight is read after calling this method
|
||||
setProgressDrawable(drawable);
|
||||
setProgressDrawableTiled(drawable);
|
||||
}
|
||||
|
||||
|
||||
@@ -291,8 +290,7 @@ public class ProgressBar extends View {
|
||||
|
||||
drawable = a.getDrawable(R.styleable.ProgressBar_indeterminateDrawable);
|
||||
if (drawable != null) {
|
||||
drawable = tileifyIndeterminate(drawable);
|
||||
setIndeterminateDrawable(drawable);
|
||||
setIndeterminateDrawableTiled(drawable);
|
||||
}
|
||||
|
||||
mOnlyIndeterminate = a.getBoolean(
|
||||
@@ -465,11 +463,9 @@ public class ProgressBar extends View {
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Define the drawable used to draw the progress bar in
|
||||
* indeterminate mode.</p>
|
||||
* Define the drawable used to draw the progress bar in indeterminate mode.
|
||||
*
|
||||
* @param d the new drawable
|
||||
*
|
||||
* @see #getIndeterminateDrawable()
|
||||
* @see #setIndeterminate(boolean)
|
||||
*/
|
||||
@@ -486,6 +482,25 @@ public class ProgressBar extends View {
|
||||
postInvalidate();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the tileable drawable used to draw the progress bar in
|
||||
* indeterminate mode.
|
||||
* <p>
|
||||
* If the drawable is a BitmapDrawable or contains BitmapDrawables, a
|
||||
* tiled copy will be generated for display as a progress bar.
|
||||
*
|
||||
* @param d the new drawable
|
||||
* @see #getIndeterminateDrawable()
|
||||
* @see #setIndeterminate(boolean)
|
||||
*/
|
||||
public void setIndeterminateDrawableTiled(Drawable d) {
|
||||
if (d != null) {
|
||||
d = tileifyIndeterminate(d);
|
||||
}
|
||||
|
||||
setIndeterminateDrawable(d);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Get the drawable used to draw the progress bar in
|
||||
@@ -501,11 +516,9 @@ public class ProgressBar extends View {
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Define the drawable used to draw the progress bar in
|
||||
* progress mode.</p>
|
||||
* Define the drawable used to draw the progress bar in progress mode.
|
||||
*
|
||||
* @param d the new drawable
|
||||
*
|
||||
* @see #getProgressDrawable()
|
||||
* @see #setIndeterminate(boolean)
|
||||
*/
|
||||
@@ -544,6 +557,25 @@ public class ProgressBar extends View {
|
||||
doRefreshProgress(R.id.secondaryProgress, mSecondaryProgress, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the tileable drawable used to draw the progress bar in
|
||||
* progress mode.
|
||||
* <p>
|
||||
* If the drawable is a BitmapDrawable or contains BitmapDrawables, a
|
||||
* tiled copy will be generated for display as a progress bar.
|
||||
*
|
||||
* @param d the new drawable
|
||||
* @see #getProgressDrawable()
|
||||
* @see #setIndeterminate(boolean)
|
||||
*/
|
||||
public void setProgressDrawableTiled(Drawable d) {
|
||||
if (d != null) {
|
||||
d = tileify(d, false);
|
||||
}
|
||||
|
||||
setProgressDrawable(d);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The drawable currently used to draw the progress bar
|
||||
|
||||
Reference in New Issue
Block a user