SeekBar进度条和ImageButton

 先展示一张效果图,下面贴出代码:

seekbar_style.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <gradient android:startColor="#e0ca92"
        android:endColor="#faeaaf"/>
    <corners android:radius="2dp"/>
</shape>

thumb.xml 

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval">
    <solid android:color="#ffffff" />
    <size android:width="25dp"
          android:height="25dp"/>
</shape>

 main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".MainActivity">
<TextView
    android:id="@+id/current_music"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textSize="16sp"
    android:textColor="#ffffff"
    android:padding="10dip"
    android:text="this is Textview..."
    />
    <Gallery
        android:id="@+id/gallery"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:spacing="16dp"
       >

    </Gallery>
    <SeekBar
        android:id="@+id/seekbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:progressDrawable="@drawable/seekbar_style"
        android:thumb="@drawable/thumb"
        android:progress="5"
        android:secondaryProgress="0"
        android:max="100"/>
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="00:00"
        android:id="@+id/current_time_text"/>
    <TextView
        android:id="@+id/end_time_text"
        android:text="00:00"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>
    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
    <ImageButton
        android:id="@+id/btStart"
        android:layout_width="wrap_content"
        android:layout_height="80dp"
        android:layout_weight="1"
        android:scaleType="fitXY"
        android:src="@drawable/start"/>

    <ImageButton
        android:id="@+id/pause"
        android:layout_width="wrap_content"
        android:layout_height="80dp"
        android:layout_weight="1"
        android:scaleType="fitXY"
        android:src="@drawable/pause"/>
        <ImageButton
            android:id="@+id/before"
            android:layout_width="wrap_content"
            android:layout_height="80dp"
            android:layout_weight="1"
            android:scaleType="fitXY"
            android:src="@drawable/navigate_before"/>
        <ImageButton
            android:id="@+id/next"
            android:layout_width="wrap_content"
            android:layout_height="80dp"
            android:layout_weight="1"
            android:scaleType="fitXY"
            android:src="@drawable/next"/>
        <ImageButton
            android:id="@+id/btStop"
            android:layout_width="wrap_content"
            android:layout_height="80dp"
            android:layout_weight="1"
            android:scaleType="fitXY"
            android:src="@drawable/stop"/>
</LinearLayout>
</LinearLayout>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值