Giter VIP home page Giter VIP logo

pacmanloadingview's Introduction

PacmanLoadingView

A pacman loading view(一个吃豆豆的loading view)。

Api reqeust MIT Licence Blog



gif

中文

使用

在根目录的build.gradle添加这一句代码:

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

在app目录下的build.gradle添加依赖使用:

dependencies {
    implementation 'com.github.samlss:PacmanLoadingView:1.12'
}

布局中使用:

<com.iigo.library.PacmanLoadingView
                    android:id="@+id/plv_loading_1"
                    android:layout_width="80dp"
                    android:layout_height="80dp"
                    app:eater_color="@android:color/holo_red_light"
                    app:peas_color="@android:color/holo_red_light"
                    app:speed="normal" />

代码中使用:

  pacmanLoadingView.start(); //开始动画,需要调用该接口开始动画
  pacmanLoadingView.stop(); //结束动画
  pacmanLoadingView.setEaterColor(Color.BLACK); //设置吃东西的圆的颜色
  pacmanLoadingView.setPeasColor(Color.BLUE); //设置豆的颜色

属性说明:

属性 说明
eater_color 吃东西的圆的颜色
peas_color 豆豆的颜色
speed 吃的速度(normal正常,fast快,slow慢)

如果不能满足你的需要,你可以下载源码自行修改。

English

Use

Add it in your root build.gradle at the end of repositories:

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

Add it in your app build.gradle at the end of repositories:

dependencies {
    implementation 'com.github.samlss:PacmanLoadingView:1.12'
}

in layout.xml:

<com.iigo.library.PacmanLoadingView
                    android:id="@+id/plv_loading_1"
                    android:layout_width="80dp"
                    android:layout_height="80dp"
                    app:eater_color="@android:color/holo_red_light"
                    app:peas_color="@android:color/holo_red_light"
                    app:speed="normal" />

in java code:

  pacmanLoadingView.start(); //start loading animation, need to call this method to start anim.
  pacmanLoadingView.stop(); //stop loading animation
  pacmanLoadingView.setEaterColor(Color.BLACK); //set the eater's color
  pacmanLoadingView.setPeasColor(Color.BLUE); //set the pea's color

Attributes description:

attr description
eater_color the eater's color
peas_color the pea's color
speed the eating speed(normal,fast,slow)

If you can not meet your needs, you can download the source code to modify it.

pacmanloadingview's People

Contributors

samlss avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

newpersonking

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.