Git Product home page Git Product logo

leavesloading's Introduction

LeavesLoading

1. 创意原型

Gif 原图:

效果图:

基本实现了原图的效果

2. 如何添加进项目中

  • 方式一:

    下载 LeavesLoading Library 拷贝进工程中。

  • 方式二:

    在 project 的 build.gradle 中:

    allprojects {
      	repositories {
      		...
      		maven { url 'https://jitpack.io' }
      	}
      }

    在 app 的 build.gradle 中:

     implementation 'com.github.LinYaoTian:LeavesLoading:1.0.1'

3. 如何使用

3.1 简单使用

在布局文件中

 <com.rdc.leavesloading.LeavesLoading
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/myleaf"/>

在 Activity 中

LeavesLoading leavesLoading = findViewById(R.id.myleaf);
leavesLoading.setProgress(50);

3.2 方法

方法名 描述
setLeafSrc(int resId) 设置叶子图片
setFanSrc(int resId) 设置风扇图片
setProgress(int progress) 设置进度
setProgressColor(int color) 设置进度条颜色
setLeafNum(int num) 设置叶片数目
setLeafFloatTime(long time) 设置叶子飘动一个周期所花时间
setLeafRotateTime(long time) 设置叶子旋转一周所花时间
setFanRotateSpeed(int speed) 设置风扇旋转速度
setFanStroke(int color) 设置风扇外圈颜色
setBgColor(int color) 设置背景颜色

3.3 Attributes属性(在布局文件中调用)

Attributes forma describe
leafSrc reference 叶子图片
leafNum integer 叶子数目
fanSrc reference 风扇图片
bgColor color 背景颜色
progress integer 进度值(0-100)
progressColor color 进度条颜色
leafFloatSpeed integer 叶子飘动一个周期所花时间
leafRotateSpeed integer 叶子旋转一周所花时间
fanRotateSpeed integer 设置风扇旋转速度
fanStrokeColor color 风扇外圈颜色

4. About Me

作者掘金博客:Lin_YT

leavesloading's People

Contributors

linyaotian avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

waelchateur

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.