AnimatedCircleLoadingView, 动画圆形加载视图

分享于 

4分钟阅读

GitHub

  繁體 雙語
An animated circle loading view
  • 源代码名称:AnimatedCircleLoadingView
  • 源代码网址:http://www.github.com/jlmd/AnimatedCircleLoadingView
  • AnimatedCircleLoadingView源代码文档
  • AnimatedCircleLoadingView源代码下载
  • Git URL:
    git://www.github.com/jlmd/AnimatedCircleLoadingView.git
    Git Clone代码到本地:
    git clone http://www.github.com/jlmd/AnimatedCircleLoadingView
    Subversion代码到本地:
    $ svn co --depth empty http://www.github.com/jlmd/AnimatedCircleLoadingView
    Checked out revision 1.
    $ cd repo
    $ svn up trunk
    
    动画循环加载视图

    DownloadAndroid Arsenal

    determiante/indetermiante加载视图动画。 基于 android-watch-loading-animation,由 Nils Banner。

    它看起来如何

    gif

    gif

    用法

    将AnimatedCircleLoadingView添加到布局中,并将mainColor和secondaryColor定义为自定义属性:

    <com.github.jlmd.animatedcircleloadingview.AnimatedCircleLoadingView xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/circle_loading_view" android:layout_width="250dp" android:layout_height="250dp" android:background="@color/background" android:layout_centerInParent="true" app:animCircleLoadingView_mainColor="@color/main_color" app:animCircleLoadingView_secondaryColor="@color/secondary_color" app:animCircleLoadingView_textColor="@android:color/white"/>
    确定

    开始确定:

    animatedCircleLoadingView.startDeterminate();

    修改百分比:

    animatedCircleLoadingView.setPercent(10);

    如果百分比为 100,动画以成功动画结束。 出现错误时,必须调用 stopFailure() 方法,然后应用程序以失败动画结束。

    不确定

    开始不确定:

    animatedCircleLoadingView.startIndeterminate();

    成功后停止:

    animatedCircleLoadingView.stopOk();

    停止时停止:

    animatedCircleLoadingView.stopFailure();

    重置加载:

    animatedCircleLoadingView.resetLoading();

    Gradle依赖项

    将知识库添加到 build.gradle

    repositories {
     maven {
     url "http://dl.bintray.com/jlmd/maven" }
    }

    添加对你的build.gradle的依赖项

    compile 'com.github.jlmd:AnimatedCircleLoadingView:1.1.5@aar'

    José Luis Martín joseluis.martind@gmail.com

    许可证

    
    Copyright 2015 José Luis Martín
    
    
    
    Licensed under the Apache License, Version 2.0 (the"License");
    
    
    you may not use this file except in compliance with the License.
    
    
    You may obtain a copy of the License at
    
    
    
     http://www.apache.org/licenses/LICENSE-2.0
    
    
    
    Unless required by applicable law or agreed to in writing, software
    
    
    distributed under the License is distributed on an"AS IS" BASIS,
    
    
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    
    
    See the License for the specific language governing permissions and
    
    
    limitations under the License.
    
    
    
    

    VIEW  animate  Animated    
    相关文章