6 Star 3 Fork 1

HarmonyOS-TPC / AnimatedCircleLoadingView

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 2.23 KB
一键复制 编辑 原始数据 按行查看 历史
shzgitee 提交于 2021-07-19 15:05 . style: 增加组件效果动态图

Animated Circle Loading View

A determiante/indetermiante loading view animation.

Gradle

allprojects{
    repositories{
        mavenCentral()
    }
}
implementation 'io.openharmony.tpc.thirdlib:AnimatedCircleLoadingView:1.0.2'

Usage


Add AnimatedCircleLoadingView to your layout and define mainColor and secondaryColor as custom attributes:

<com.github.jlmd.animatedcircleloadingview.AnimatedCircleLoadingView
        ohos:id="$+id:circle_loading_view"
        ohos:width="250vp"
        ohos:height="250vp"
        ohos:background_element="$color:background"
        ohos:center_in_parent="true"
        ohos:mainColor="$color:main_color"
        ohos:secondaryColor="$color:secondary_color"
        ohos:textColor="white"
        />

Determinate

Start determinate:

animatedCircleLoadingView.startAnimated();

Modify percent:

animatedCircleLoadingView.setPercent(10);

If percent is 100, the animation ends with success animation. On error you must call stopFailure() method, then the application ends with failure animation.

Indeterminate

Start indeterminate:

animatedCircleLoadingView.startIndeterminate();

Stop with success:

animatedCircleLoadingView.stopOk();

Stop with failure:

animatedCircleLoadingView.stopFailure();

Reset loading:

animatedCircleLoadingView.resetLoading();

License

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.
1
https://gitee.com/HarmonyOS-tpc/AnimatedCircleLoadingView.git
git@gitee.com:HarmonyOS-tpc/AnimatedCircleLoadingView.git
HarmonyOS-tpc
AnimatedCircleLoadingView
AnimatedCircleLoadingView
master

搜索帮助