Skip to content

Instantly share code, notes, and snippets.

@Reacoder
Created August 8, 2014 08:29
Show Gist options
  • Save Reacoder/5e04804df31eaa3dfef3 to your computer and use it in GitHub Desktop.
Save Reacoder/5e04804df31eaa3dfef3 to your computer and use it in GitHub Desktop.
自定义seekBar
<?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 android:shape="rectangle" >
<solid android:color="#a0a0a0" />
<corners android:radius="0dp" />
</shape>
</item>
<item android:id="@android:id/secondaryProgress">
<clip>
<shape android:shape="rectangle" >
<solid android:color="#f0f0f0" />
<corners android:radius="0dp" />
</shape>
</clip>
</item>
<item android:id="@android:id/progress">
<clip>
<shape android:shape="rectangle" >
<solid android:color="#ff5555" />
<corners android:radius="0dp" />
</shape>
</clip>
</item>
</layer-list>
<SeekBar
android:id="@+id/mediacontroller_progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="24dp"
android:maxHeight="2dp"
android:progressDrawable="@drawable/seekbar"
android:thumb="@drawable/seekbar_thumb" />
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/btn_video_slider_selected" android:state_pressed="true"/>
<item android:drawable="@drawable/btn_video_slider_normal" android:state_focused="false" android:state_pressed="false"/>
</selector>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment