Giter Club home page Giter Club logo

eclipseloading's Introduction

EclipseLoading

🌞 日食加载动画

设计来自1982200-Solar-Eclipse

预览

eclipseloading.gif

思路

日食思路1: 先画好太阳,并在太阳右边紧贴着画一个和太阳一样大的白色圆,然后使用属性动画把白色圆往左移动,逐渐覆盖在太阳上,就形成了日食动画。

但是这个思路两个弊端:第一,白色圆的颜色必须和背景色一样。第二,白色圆和背景重复绘制了相同的区域。

日食思路2: 先画好太阳,用一个和太阳一样大圆形的 path 对太阳进行裁剪(裁剪掉 path 内的部分),然后通过属性动画向左移动 path 达到日食的效果。并且同时避免了上面两个问题。

使用

<me.bakumon.library.EclipseLoadingView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>

设置太阳颜色

  1. 自定义属性
app:sunColor="@color/colorAccent"
  1. java 代码
eclipseLoadingView.setSunColor(sunColor);

eclipseloading's People

Contributors

bakumon avatar

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.