美文网首页自定义View
一个模仿网易云音乐的竖线动画View

一个模仿网易云音乐的竖线动画View

作者: limuyang2 | 来源:发表于2018-07-19 09:28 被阅读192次

    先放上地址GitHub,欢迎star,欢迎给我发issues
    也欢迎star我的另外一个库LDialog

    MusicAnimLine

    在使用网易云音乐的时候,偶然发现iOS版<网易云音乐>的垂直线条动画view,觉得挺好看,很有动感,所以将其模仿到了Android上。实现的方法比较笨拙,代码写得还不够好,欢迎多多指教。

    预览

    iOS网易云 原版

    NeteaseIOS.jpg

    模仿实现效果

    image

    获取

    先在 build.gradle 的 repositories 添加:

    allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
        }
    }
    

    再在dependencies添加:

    dependencies {
        implementation 'com.github.limuyang2:MusicAnimLine:0.1'
    }
    

    使用

    <top.limuyang2.musicanimlineview.MusicAnimLineView
        android:id="@+id/lineView"
        android:layout_width="150dp"
            android:layout_height="150dp"
            app:isAutoPlay="false"
            app:line_color="#22b1f9"
            app:line_width="3dp" />
    

    属性说明

    属性 说明
    app:line_width 竖线宽度(单位DP)
    app:line_color 竖线颜色
    app:animDuration 动画时长
    app:isAutoPlay 是否自动播放
    方法 startAnim() 播放动画

    License

    2018 limuyang
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    
       http://www.apache.org/licenses/LICENSE-2.0
    
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    

    相关文章

      网友评论

      • 码农淏:差一点我就给star了
        然后发现不是iOS是安卓。。
        limuyang2:@码农淏 哈哈,IOS我也弄个,按道理来说,IOS做动画更容易啊
      • 世道无情:不错,已star!
        limuyang2:谢谢鼓励

      本文标题:一个模仿网易云音乐的竖线动画View

      本文链接:https://www.haomeiwen.com/subject/zxpzpftx.html