MusicAnimLine
在使用網(wǎng)易云音樂的時候,偶然發(fā)現(xiàn)iOS版<網(wǎng)易云音樂>的垂直線條動畫view,覺得挺好看,很有動感,所以將其模仿到了Android上。實現(xiàn)的方法比較笨拙,代碼寫得還不夠好,歡迎多多指教。
預(yù)覽
iOS網(wǎng)易云 原版
NeteaseIOS.jpg
模仿實現(xiàn)效果
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.