模仿守望先锋的加载动画。
Imitate "OverWatch" loadingView effect.
守望先锋截图,OverWatch Screenshots:
Demo Screenshots:
- 添加一个dependency到你的
build.gradle
// Add a dependency to yourbuild.gradle
:
dependencies {
compile 'com.deanguo.overwatchloadingview:library:1.0.0'
}
-
或者将library导入到工程中 // Or import library as a model to your project
-
或者将library中的
OverWatchLoadingView
,OverWatchViewItem
,和attrs.xml
复制到你的项目中去 // Or copyOverWatchLoadingView
,OverWatchViewItem
,attrs.xml
from library to your project
####初始化 Initialization
添加com.dean.overwatchloadingview.OverWatchLoadingView
到你的布局文件中
Add com.dean.overwatchloadingview.OverWatchLoadingView
to your layout XML file.
<com.dean.overwatchloadingview.OverWatchLoadingView
android:layout_centerInParent="true"
android:layout_margin="50dp"
android:id="@+id/loading_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:view_color="@color/light_orange" />
之后在代码中调用
Then using in java code
OverWatchLoadingView loadingView = (OverWatchLoadingView) findViewById(R.id.loading_view);
loadingView.start();
####设置颜色 Setting Color #####xml
app:view_color="@color/light_orange"
#####code
loadingView.setColor(Color.GRAY);
####开始/结束/暂停/恢复 start/end/pause/resume #####开始/start
loadingView.start();
#####结束/end
loadingView.end();
#####暂停/pause
loadingView.pause();
#####恢复/resume
loadingView.resume();
Copyright 2016 Dean Guo
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.