Metro风格的加载效果:MetroLoading

jopen 9年前

Metro风格的加载效果:MetroLoading

使用说明:

1.设置 Gradle

dependencies {         compile 'com.mmga.metroloading:metroloading:1.0.0'      }

2.添加 MetroLoadingView到 layout

<com.mmga.metroloading.MetroLoadingView          android:id="@+id/loading"          android:layout_width="wrap_content"          android:layout_height="wrap_content"             app:transform_color="#ee00ff"          app:indicator_height="9dp"          app:indicator_width="4dp"          />

3.Use it as a normal custom view

  mLoading.start();

现在你应该能得到这样的动画:

1.original.gif



自定义

1.改变速度,间隔以及indicator

 app:number="3"      app:duration_in_mills="1500"      app:interval_in_mills="100"


5_speed.gif

2.淡入淡出

    app:fade="true"

2_fade.gif

3. 缩放

    app:transform="true"      app:transform_height="15dp"      app:transform_width="4dp"      app:transform_radius="3dp"

3_scale (1).gif

这里但尺寸是indicator移动到了View中间的大小。

4.添加阴影

    app:has_shadow = "true"      app:shadow_color="#666666"

4_shadow.gif

5.变色

    app:transform_color_mode="symmetry" //or linear or none       app:transform_color="#ee00ff"

6_linearColor.gif

transform_color_mode = linear

7_symmetryColor.gif

transform_color_mode = symmetry

6."教练! 我想玩球"

Take it

    app:indicator="circle" // or rectangle

以上的所有属性ball都可用

8_circle.gif

Options available in XML attributes:

Attribute Description
indicator shape of indicator,"rectangle" or "circle"
indicator_color color
indicator_width dimension
indicator_height dimension
indicator_radius dimension
duration_in_mills integer
interval_in_mills integer
number integer


transform boolean
transform_height dimension,the height when comes to the middle
transform_width dimension
transform_radius dimension


transform_color_mode "none","linear","symmetry"
transform_color the color in the end(linear) or middle(symmetry)
fade boolean


has_shadow boolean
shadow_color color

API available

Method
start()
stop()
isAnimating()

 


项目地址: https://github.com/mmga/MetroLoading