java.lang.Object | |||
↳ | android.graphics.drawable.Drawable | ||
↳ | android.graphics.drawable.DrawableWrapper | ||
↳ | android.graphics.drawable.RotateDrawable |
A Drawable that can rotate another Drawable based on the current level value. The start and end angles of rotation can be controlled to map any circular arc to the level values range.
It can be defined in an XML file with the <rotate>
element.
For more information, see the guide to
Animation Resources.
XML Attributes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
android:drawable | Reference to a drawable resource to use for the frame. | ||||||||||
android:fromDegrees | setFromDegrees(float) | ||||||||||
android:pivotX | setPivotX(float) | ||||||||||
android:pivotY | setPivotY(float) | ||||||||||
android:toDegrees | setToDegrees(float) | ||||||||||
android:visible | Provides initial visibility state of the drawable; the default value is false. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new rotating drawable with no wrapped drawable.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Applies the specified theme to this Drawable and its children.
| |||||||||||
Draw in its bounds (set via setBounds) respecting optional effects such
as alpha (set via setAlpha) and color filter (set via setColorFilter).
| |||||||||||
Inflate this Drawable from an XML resource optionally styled by a theme.
| |||||||||||
Sets the start angle for rotation.
| |||||||||||
Sets the X position around which the drawable is rotated.
| |||||||||||
Sets whether the X pivot value represents a fraction of the drawable
width or an absolute value in pixels.
| |||||||||||
Sets the Y position around which the drawable is rotated.
| |||||||||||
Sets whether the Y pivot value represents a fraction of the drawable
height or an absolute value in pixels.
| |||||||||||
Sets the end angle for rotation.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Override this in your subclass to change appearance if you vary based
on level.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
android.graphics.drawable.DrawableWrapper
| |||||||||||
From class
android.graphics.drawable.Drawable
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
android.graphics.drawable.Drawable.Callback
|
Reference to a drawable resource to use for the frame. If not given, the drawable must be defined by the first child tag.
Must be a reference to another resource, in the form "@[+][package:]type:name
"
or to a theme attribute in the form "?[package:][type:]name
".
This corresponds to the global attribute
resource symbol drawable
.
Provides initial visibility state of the drawable; the default
value is false. See
setVisible(boolean, boolean)
.
Must be a boolean value, either "true
" or "false
".
This may also be a reference to a resource (in the form
"@[package:]type:name
") or
theme attribute (in the form
"?[package:][type:]name
")
containing a value of this type.
This corresponds to the global attribute
resource symbol visible
.
Creates a new rotating drawable with no wrapped drawable.
Applies the specified theme to this Drawable and its children.
Draw in its bounds (set via setBounds) respecting optional effects such as alpha (set via setAlpha) and color filter (set via setColorFilter).
canvas | The canvas to draw into |
---|
Inflate this Drawable from an XML resource optionally styled by a theme.
r | Resources used to resolve attribute values |
---|---|
parser | XML parser from which to inflate this Drawable |
attrs | Base set of attribute values |
theme | Theme to apply, may be null |
Sets the start angle for rotation.
fromDegrees | starting angle in degrees |
---|
Sets the X position around which the drawable is rotated.
pivotX | X position around which to rotate. If the X pivot is relative, the position represents a fraction of the drawable width. Otherwise, the position represents an absolute value in pixels. |
---|
Sets whether the X pivot value represents a fraction of the drawable width or an absolute value in pixels.
relative | true if the X pivot represents a fraction of the drawable width, or false if it represents an absolute value in pixels |
---|
Sets the Y position around which the drawable is rotated.
pivotY | Y position around which to rotate. If the Y pivot is relative, the position represents a fraction of the drawable height. Otherwise, the position represents an absolute value in pixels. |
---|
Sets whether the Y pivot value represents a fraction of the drawable height or an absolute value in pixels.
relative | True if the Y pivot represents a fraction of the drawable height, or false if it represents an absolute value in pixels |
---|
Sets the end angle for rotation.
toDegrees | ending angle in degrees |
---|
Override this in your subclass to change appearance if you vary based on level.