The library provide the effect of water ripple and is easy to use.
###Step1
Add dependencies in build.gradle.
dependencies {
implementation 'com.zxm:wavelibrary:1.0.0'
}
###Step2
######布局中添加
<com.example.wavelibrary.WaveView
android:id="@+id/waveview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
app:behind_color="@color/colorWave_behind"
app:front_color="@color/colorWave_front"
app:shape_type="circle" />
###Step3
######页面中添加并控制动画 1.初始化控件并添加动画辅助工具:
private WaveView mWaveView;
mWaveView = (WaveView) findViewById(R.id.waveview);
mWaveView.setSimpleAnimatorToView();
2.控制动画的播放和暂停:
@Override
protected void onResume() {
super.onResume();
mWaveView.getWaveAnimatorHelper().startAnimators();
}
@Override
protected void onPause() {
super.onPause();
mWaveView.getWaveAnimatorHelper().endAnimators();
}
######说明: ######在使用的时候可以灵活继承WaveAnimatorHelper接口进行动画的控制;
Email:zhangxinmin528@sina.com
LOGO:仇盼宁
Copyright 2017 ZhangXinmin528
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.
If you are interested in WaveView, don't forget to STAR WaveView.
Thank you for reading ^o^