android - 实现类似动画的 Google-Play-Music(播放列表项旁边的 3 条频谱)

标签 android animation

我想实现这样的东西。这样我就可以控制它的颜色、条数、速度等。

下面是在 Google-Play-Music 应用程序中当前正在播放的项目旁边显示的动画。

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

enter image description here

最佳答案

有一个图书馆叫Mini Equalizer Library for Android它提供了这个功能。

1

您需要将 View 添加到布局中:

<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"/>

为了启动动画,使用这段代码:

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

另外,还有另一个库叫做 AndroidVuMeter这似乎有更多的选择。

2

只需将 View 添加到您的布局即可。

<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"/>

关于android - 实现类似动画的 Google-Play-Music(播放列表项旁边的 3 条频谱),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32564809/

相关文章:

android - 更新到 Kotlin 1.3.30 后 "Unresolved reference: Parcelize"

ios - 警报框上的动画

r - ggplotly 与直方图 - 无法使其工作

android - ADT:当包和类太多时构建失败

java - 致命异常 : IntentService[RegIntentService] after upgrading to com. android.support :support-v4:25. 0.1

swift - 如何停止我的 UIButton 动画 SWIFT

css - Tumblr 关注/仪表板按钮现在显示了吗?

javascript - 对点路径进行动画处理,一个点接一个点

没有 Wifi 热点或 Wifi 直连的 Android 广播/接收数据

安卓gradle : All buildTypes are getting executed at the same time