项目
在 GitHub 查看
qintong91/InsLoadingAnimation
关于
Imitation of instagram and weibo avator animation of loading for Android.
设计与媒体实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README-zh.md
原文InsLoadingAnimation
简介
InsLoadingAnimation 是仿instagram和微博的头像点击进行加载的Android动画。更多信息以及代码分析请见相关的博文:http://www.jianshu.com/p/a0e2dbeef88a
Demo

使用
Step 1
在build.gradle增加依赖:
dependencies {
compile 'com.qintong:insLoadingAnimation:1.1.0'
}
Step 2
InsLoadingView继承自ImageView, 所以最基本的,可以按照ImageView的用法使用InsLoadingView:
<com.qintong.library.InsLoadingView
android:layout_centerInParent="true"
android:id="@+id/loading_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/pink"/>
Step 3
设置状态:
您可以手动设置其状态,来对应在您应用中的当前状态。InsLoadingView的状态有: LOADING: 表示InsLoadingView被点击之后正在加载内容(未加载完毕之前),该状态下动画正在执行。 UNCLICKED: 该InsLoadingView被点击之前的状态,此状态下动画停止。 CLICKED: 表示InsLoadingView被点击和加载过,此状态下动画停止切圆圈的颜色为灰色。 默认的状态是LOADING。
可以通过一下代码设置状态: xml:
app:status="loading" //or "clicked",or "clicked"
java:
mInsLoadingView.setStatus(InsLoadingView.Status.LOADING); //Or InsLoadingView.Status.CLICKED, InsLoadingView.Status.UNCLICKED
设置颜色
设置start color和start color,InsLoadingView的圆圈会显示两个颜色间的过渡。 可以按如下代码设置:
xml:
app:start_color="#FFF700C2" //or your color
app:end_color="#FFFFD900" //or your color
java:
mInsLoadingView.setStartColor(Color.YELLOW); //or your color
mInsLoadingView.setEndColor(Color.BLUE); //or your color
默认的start color和start color为#FFF700C2和#FFFFD900。
设置速度
通过设置环绕动画的时间和整体旋转的时间来改变速度:
xml:
app:circle_duration="2000"
app:rotate_duration="10000"
java:
mInsLoadingView.setCircleDuration(2000);
mInsLoadingView.setRotateDuration(10000);
默认的时间为2000ms和10000ms。
关于我
许可
Copyright 2017 Qin Tong
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.
探索相关项目
加载中…