vector 实现的play/pause按钮

vector 写的play/pause按钮

效果图:

具体代码:

 drawable/bg_icon_play.xml
<vector
    xmlns:android=
        "http://schemas.android.com/apk/res/android"
    xmlns:aapt=
        "http://schemas.android.com/aapt"
    android:width=
        "20dp"
    android:height=
        "24dp"
    android:viewportWidth=
        "20"
    android:viewportHeight=
        "24">
    <path
        android:pathData=
            "M19.47 11.03C20.17 11.46 20.17 12.53 19.47 12.96L1.57 23.84C0.87 24.27 0 23.74 0 22.88L0 1.11C0 0.25 0.87 -0.28 1.57 0.15L19.47 11.03Z"
        android:fillColor=
            "#FFFFFF"
        android:fillAlpha=
            "1"
        android:fillType=
            "evenOdd"/>
</vector>
 drawable/bg_icon_pause.xml
<!-- res/drawable/ic_pause_rounded.xml -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24">
    <!--
    pathData 中的 M6,19h4V5H6v14zm8-14v14h4V5h-4z 定义了两个垂直的矩形,表示暂停按钮
    通过使用 a2,2 来创建圆角效果,确保矩形的每个角都是圆的。
     -->
    <path
        android:fillColor="#FFF"
        android:pathData="M4,2h4a2,2 0 0,1 2,2v16a2,2 0 0,1 -2,2h-4a2,2 0 0,1 -2,-2V4a2,2 0 0,1 2,-2zM16,2h4a2,2 0 0,1 2,2v16a2,2 0 0,1 -2,2h-4a2,2 0 0,1 -2,-2V4a2,2 0 0,1 2,-2z" />
</vector>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值