让任何Android View实现闪烁效果:Shimmer effect for Android

jopen 9年前

Shimmer 是一个Java库提供了一种简便的方式来在你的Android app中为任何view增加一种闪烁效果。它非常适用于作为一个不显眼的加载指示器。它最初由非死book开发。

Shimmer for Android实现成一个布局, 这意味着你可以简单地在任何中View嵌套ShimmerFrameLayout标签,然后从你的代码中启动动画。

用法:

The following snippet shows how you can useShimmerFrameLayout

<com.非死book.shimmer.ShimmerFrameLayout       android:id=“@+id/shimmer_view_container”       android:layout_width=“wrap_content”       android:layout_height="wrap_content"  >       ...(your complex view here)...  </com.非死book.shimmer.ShimmerFrameLayout>


In your code, you can then start the animation:

ShimmerFrameLayout container =     (ShimmerFrameLayout) findViewById(R.id.shimmer_view_container);  container.startShimmerAnimation();

项目主页:http://www.open-open.com/lib/view/home/1426080125185