SeekBar configuration file:
Xml Code
Copy codeThe Code is as follows: <SeekBar
Android: id = "@ + id/player_seekbar"
Android: layout_width = "245px"
Android: layout_height = "25px"
Android: progressDrawable = "@ drawable/seekbar_style"
Android: thumb = "@ drawable/thumb"
Android: paddingLeft = "16px"
Android: paddingRight = "15px"
Android: paddingTop = "5px"
Android: paddingBottom = "5px"
Android: progress = "0"
Android: max = "0"
Android: secondaryProgress = "0"
/>
Android: progressDrawable = "@ drawable/seekbar_style" Background
Seekbar_style is configured as follows:
Xml CodeCopy codeThe Code is as follows: <? Xml version = "1.0" encoding = "UTF-8"?>
<Layer-list xmlns: android = "http://schemas.android.com/apk/res/android">
<Item android: id = "@ android: id/background">
<Shape>
<Corners android: radius = "5dip"/>
<Gradient
Android: startColor = "# ff9d9e9d"
Android: centerColor = "# ff5a5d5a"
Android: centery= "0.75"
Android: endColor = "# ff747674"
Android: Angular = "270"
/>
</Shape>
</Item>
<Item android: id = "@ android: id/secondaryProgress">
<Clip>
<Shape>
<Corners android: radius = "5dip"/>
<Gradient
Android: startColor = "#80ffd300"
Android: centerColor = "#80ffb600"
Android: centery= "0.75"
Android: endColor = "# a0ffcb00"
Android: Angular = "270"
/>
</Shape>
</Clip>
</Item>
<Item android: id = "@ android: id/progress">
<Clip>
<Shape>
<Corners android: radius = "5dip"/>
<Gradient
Android: startColor = "# ff0099CC"
Android: centerColor = "# ff3399CC"
Android: centery= "0.75"
Android: endColor = "# ff6699CC"
Android: Angular = "270"
/>
</Shape>
</Clip>
</Item>
</Layer-list>
Or, use the following image:
Xml CodeCopy codeThe Code is as follows: <? Xml version = "1.0" encoding = "UTF-8"?>
<Layer-list xmlns: android = "http://schemas.android.com/apk/res/android">
<Item android: id = "@ android: id/background"
Android: drawable = "@ drawable/progress_bg"/>
<Item android: id = "@ android: id/secondaryProgress"
Android: drawable = "@ drawable/second_progress">
</Item>
<Item android: id = "@ android: id/progress"
Android: drawable = "@ drawable/first_progress">
</Item>
</Layer-list>
Square
Xml CodeCopy codeThe Code is as follows: <layer-list xmlns: android = "http://schemas.android.com/apk/res/android">
<Item android: id = "@ android: id/background"
Android: drawable = "@ drawable/progress_bg"/>
<Item android: id = "@ android: id/secondaryProgress">
<Clip android: drawable = "@ drawable/second_progress"/>
</Item>
<Item android: id = "@ android: id/progress">
<Clip android: drawable = "@ drawable/first_progress"/>
</Item>
</Layer-list>
Android: thumb = "@ drawable/thumb" is the moving ball.
The configuration is as follows:
Xml CodeCopy codeThe Code is as follows: <? Xml version = "1.0" encoding = "UTF-8"?>
<Selector xmlns: android = "http://schemas.android.com/apk/res/android">
<! -- Press status -->
<Item
Android: state_focused = "true"
Android: state_pressed = "true"
Android: drawable = "@ drawable/thumb_pressed"/>
<! -- Normal no-focus status -->
<Item
Android: state_focused = "false"
Android: state_pressed = "false"
Android: drawable = "@ drawable/thumb_normal"/>
<! -- With Focus -->
<Item
Android: state_focused = "true"
Android: state_pressed = "false"
Android: drawable = "@ drawable/thumb_focused"/>
<! -- Focus -->
<Item
Android: state_focused = "true"
Android: drawable = "@ drawable/thumb_focused"/>
</Selector>