System comes with the Seekbar is really ugly, the project needs, can only be customized, first come to Zhang
The first Seekbar background is the color, thumb is the picture, on the code:
[HTML]View Plaincopy
- <SeekBar
- android:id="@+id/timeline"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:focusable="true"
- android:maxheight="4.0dip"
- android:minheight="4.0dip"
- android:paddingleft="16.0dip"
- android:paddingright="16.0dip"
- android:progressdrawable="@drawable/po_seekbar"
- android:thumb="@drawable/seekbar_thumb" />
Drawable/po_seekbar.xml:
[HTML]View Plaincopy
- <? 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>
- <solid android:color="#ff51495e" />
- </shape>
- </Item>
- <item android:id="@*android:id/secondaryprogress">
- <clip>
- <shape>
- <solid android:color="#ff51495e" />
- </shape>
- </clip>
- </Item>
- <item android:id="@*android:id/progress">
- <clip>
- <shape>
- <solid android:color="#ff996dfe" />
- </shape>
- </clip>
- </Item>
- </layer-list>
Drawable/seekbar_thumb.xml:
[HTML]View Plaincopy
- <? XML version= "1.0" encoding="Utf-8"?>
- <selector
- xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_focused="true" android:state_pressed="false" android:drawable= "@drawable/seekbar_thumb_normal" />
- <item android:state_focused="true" android:state_pressed="true" Android: drawable="@drawable/seekbar_thumb_pressed" />
- <item android:state_focused="false" android:state_pressed="true" android:drawable= "@drawable/seekbar_thumb_pressed" />
- <item android:drawable="@drawable/seekbar_thumb_normal" />
- </selector>
Seekbar_thumb_pressed.png:
Seekbar_thumb_normal.png:
The 2nd and 3rd Seekbar are all picture implementations.
[HTML]View Plaincopy
- <SeekBar
- android:id="@+id/sb_detail_play_progress"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_centervertical="true"
- android:layout_gravity="center"
- android:paddingleft="15.0dip"
- android:paddingright="15.0dip"
- android:progressdrawable="@drawable/progress_holo_light"
- android:thumb="@drawable/detail_icon_schedule_ball" />
Drawable/progress_holo_light.xml:
[HTML]View Plaincopy
- <? 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/volumn_bg" />
- <item android:id="@*android:id/secondaryprogress">
- <scale android:drawable= "@drawable/volumn_front" android:scalewidth="100%" />
- </Item>
- <item android:id="@*android:id/progress">
- <scale android:drawable= "@drawable/volumn_primary" android:scalewidth="100%" />
- </Item>
- </layer-list>
Volumn_bg.9.png
Volumn_front.9.png
Volumn_primary.png
3rd One Seekbar
Here's a picture.
Demo Download Link: http://download.csdn.net/detail/w8320273/7800859
Customize the beautiful Android Seekbar style