一个Android半圆和满圆加载效果的视图:SimpleArcLoader

qeuk2769 9年前

一个Android半圆和满圆加载效果的视图。

使用说明:

Gradle

  dependencies {        compile 'com.leo.simplearcloader:simplearcloader:1.0.0'    }

例子 1

在对话框中显示

SimpleArcDialog mDialog = new SimpleArcDialog(this);  mDialog.setConfiguration(new ArcConfiguration(this));  mDialog.show();

例子 2

普通用法

<com.leo.simplearcloader.SimpleArcLoader    android:visibility="visible"    android:id="@+id/loader"    android:layout_centerInParent="true"    android:layout_width="60dp"    android:layout_height="60dp"    custom:arc_style="simple_arc"    custom:arc_speed="medium"    custom:arc_margin="3dp">  </com.leo.simplearcloader.SimpleArcLoader>

例子 3

使用ArcConfiguration自定义 Dialog/SimpleArcLoader视图

ArcConfiguration configuration = new ArcConfiguration(context);  configuration.setLoaderStyle(SimpleArcLoader.STYLE.COMPLETE_ARC);  configuration.setText("Please wait..");    // Using this configuration with Dialog   mDialog.setConfiguration(configuration);    // Using this configuration with ArcLoader  mSimpleArcLoader.refreshArcLoaderDrawable(configuration);

你可以使用ArcConfiguration的方法自定义 Arc/Dialog -

  • setLoaderStyle(SimpleArcLoader.STYLE mLoaderStyle)

  • setArcMargin(int mArcMargin)

  • setArcWidthInPixel(int mStrokeWidth)

  • setColors(int[] colors)

  • setTypeFace(Typeface typeFace)

  • setText(String mText)

  • setTextColor(int mTextColor)

  • setTextSize(int size)

  • setAnimationSpeedWithIndex(int mAnimationIndex) Values to be passed SimpleArcLoader.SPEED_SLOW, SimpleArcLoader.SPEED_MEDIUM, SimpleArcLoader.SPEED_FAST

Developed By


</div>

项目地址: https://github.com/generic-leo/SimpleArcLoader