手摸手教你写Slack的Loading动画

Overview

What's SlackLoadingView ?

Imitate Slack loading animation.

Android Arsenal

Demo

Article

手摸手教你写Slack的Loading动画

##Build #####Step 1

repositories {
    maven {
        url 'https://dl.bintray.com/wangyuwei/maven'
    }
}

#####Step 2

compile 'me.wangyuwei:SlackLoadingView:1.0.1'

##License

Copyright [2016] [JeasonWong of copyright owner]

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.
You might also like...
Comments
  • 最后面算px和dp转换的dp2px方法里面返回有个0.5f什么意思。。

    最后面算px和dp转换的dp2px方法里面返回有个0.5f什么意思。。

    private int dp2px(Context context, float dp) { final float scale = context.getResources().getDisplayMetrics().density; return (int) (dp * scale + 0.5f); } 感觉没多大用啊

    opened by 516457377 4
  • mAnimList中的数据一直增加

    mAnimList中的数据一直增加

    mAnimList每次执行完一个循环后,就会添加四个元素,一直死循环的话,animatorList不会存放太多的animator吗。

    可以在SlackLoadingView第302行代码中

    lineWidthAnim.addListener(new AnimatorListener() {
                @Override
                public void onAnimationEnd(Animator animation) {
                    Log.d("@=>", "动画4结束");
                    if (mStatus == STATUS_LOADING) {
                        mStep++;
                        mAnimList.clear();//加上这行吗
                        startCRLCAnim();
                    }
                }
            });
    
    opened by xingstarx 0
Owner
巴掌
巴掌