实施类似Google-Play-Music的动画(播放列表项旁边的3条形图)

Ash*_*lak 5 animation android

我想实现这样的事情。这样我就可以控制它的颜色,条数,速度等。

以下是显示在Google Play音乐应用中当前正在播放的项目旁边的动画。

我将以类似的方式进行播放:在音乐应用程序中当前正在播放的歌曲旁边。

在此处输入图片说明

Yoa*_*erg 6

有一个名为Mini Equalizer Library for Android 的库可提供此功能。

1

您需要将视图添加到您的布局中:

<es.claucookie.miniequalizerlibrary.EqualizerView
    xmlns:custom="http://schemas.android.com/apk/res-auto"
        android:id="@+id/equalizer_view"
        android:layout_width="30dp"
        android:layout_height="30dp"
        custom:foregroundColor="@color/link_text_material_light"
        custom:animDuration="3500"/>
Run Code Online (Sandbox Code Playgroud)

要开始动画,请使用以下代码:

EqualizerView equalizer = (EqualizerView) findViewById(R.id.equalizer_view);
equalizer.animateBars(); // Whenever you want to tart the animation
equalizer.stopBars(); // When you want equalizer stops animating
Run Code Online (Sandbox Code Playgroud)

此外,还有另一个名为AndroidVuMeter 的库,它似乎有更多选择。

2

只需将视图添加到您的布局中。

<io.gresse.hugo.vumeterlibrary.VuMeterView
    android:layout_width="300dp"
    android:layout_height="300dp"
    android:paddingLeft="20dp"
    android:paddingRight="20dp"
    android:paddingBottom="40dp"
    android:id="@+id/vumeter"
    vumeter:stopSize="5dp"
    vumeter:speed="10"
    vumeter:blockNumber="5"
    vumeter:blockSpacing="20dp"
    vumeter:backgroundColor="#33b5e5"
    vumeter:startOff="false"/>
Run Code Online (Sandbox Code Playgroud)