Preface
This chapter is about Android. widget. absseekbar, translated by madgoat. Welcome to his blog: http://madgoat.cn/. thanks again! I look forward to your participation in Android API Chinese translation, contact me over140@gmail.com.
Statement
You are welcome to repost, but please keep the original source of the article :)
Madgoat: http://madgoat.cn/
Blog: http://www.cnblogs.com
Farmer's uncle: http://www.cnblogs.com/over140/
Version
Android 2.2 r1
Body
I. Structure
Public abstract class absseekbar extends ssssbar
Java. Lang. Object
Android. View. View
Android. widget. progressbar
Android. widget. absseekbar
Ii. Category Overview
This class is an abstract class. You can drag the seekbar and ratingbar to inherit the ratingbar.
Iii. Public Methods
Public int getkeyprogressincrement ()
Returns the progress value after the direction key changes.
By default, this value is obtained based on the maximum value.
Return Value
The progress value after the user presses the direction key to decrease or increase. The progress value is a positive number.
Public int getthumboffset ()
See
Setthumboffset (INT)
Public Boolean onkeydown (INT keycode, keyevent event)
Keyevent. Callback. onkeymultiple () is implemented by default. If the view is enabled and you can click it, when keycode_dpad_center or keycode_enter is released, the operation of this view is executed.
Parameters
The identifier used in keycode keyevent to indicate that the key is pressed
Keyevent object defined in the event key operation
Return Value
If you have processed the current event, true is returned. If you want to continue processing the next event receiver, false is returned;
Public Boolean ontouchevent (motionevent event)
Implement this method to handle events triggered by the touch screen.
Parameters
Event Action event
Return Value
If the event has been processed, true is returned. Otherwise, false is returned.
Public void setkeyprogressincrement (INT increment)
Set the added value of each change with the direction key (Note: After setting this value, you can use the button to modify the progress value to increase or decrease the increment size each time)
Parameters
Increment the amount to increment or decrement when the user presses the arrow keys.
Increment the value that is increased or decreased when the user presses the indicator key.
Public synchronized void setmax (INT max)
Set the progress bar range from 0 to Max.
Parameters
Maximum Value of the Max progress bar
Public void setthumb (drawable thumb)
Set thumb as the ending position of the Progress table displayed in seekbar (Note: for example)
If thumb is a valid printable object (for example, it is not a null value), you need to set the offset of thumb to half its width (see setthumboffset (INT ))
Parameters
Thumb can draw objects
Public void setthumboffset (INT thumboffset)
Set the offset of thumb to allow thumb to expand beyond the orbit range.
Parameters
The offset of thumboffset in pixels.
(Note: for example, the two figures also take the maximum value of seekbar)
When the default offset is half of the value of thumb:
Setthumboffset (0:
Iv. Protected Methods
Protected Boolean verifydrawable (drawable who)
If your view subclass displays its own visualization object, it will override this method and return true to display the printable object. This operation allows animation effects during painting.
Make sure that the corresponding method of the parent class needs to be called when the slave method is rewritten. (Note: Remember to call Super. verifydrawable (WHO ))
Parameters
Drawable ). If it is the object you want to display, true is returned; otherwise, the result of calling the parent class is returned.
Return Value
If the drawable object is already displayed in the view, true is returned. Otherwise, false is returned. Animation is not allowed here.
5. Download
5.1 PDF download
Http://download.csdn.net/source/2781801 (csdn)
5.2 download small icons
End
Madgoat has reviewed three articles in two days and now has received four more articles. He told me that he is learning and turning over now, this is also the reason why I encourage new beginners to join us, because it is not just a translation, but thanks again for sharing.