设为首页 加入收藏

TOP

Android 实现RippleEffect水波纹效果(五)
2015-11-10 13:45:28 来源: 作者: 【 】 浏览:16
Tags:Android 实现 RippleEffect 波纹 效果
pple animation has to be centered in its parent view or not, default is False
? ? *
? ? * @param isCentered
? ? */
? ? public void setCentered(final Boolean isCentered)
? ? {
? ? ? ? this.isCentered = isCentered;
? ? }
?
? ? public int getRipplePadding()
? ? {
? ? ? ? return ripplePadding;
? ? }
?
? ? /**
? ? * Set Ripple padding if you want to avoid some graphic glitch
? ? *
? ? * @param ripplePadding New Ripple padding in pixel, default is 0px
? ? */
? ? public void setRipplePadding(int ripplePadding)
? ? {
? ? ? ? this.ripplePadding = ripplePadding;
? ? }
?
? ? public Boolean isZooming()
? ? {
? ? ? ? return hasToZoom;
? ? }
?
? ? /**
? ? * At the end of Ripple effect, the child views has to zoom
? ? *
? ? * @param hasToZoom Do the child views have to zoom ? default is False
? ? */
? ? public void setZooming(Boolean hasToZoom)
? ? {
? ? ? ? this.hasToZoom = hasToZoom;
? ? }
?
? ? public float getZoomScale()
? ? {
? ? ? ? return zoomScale;
? ? }
?
? ? /**
? ? * Scale of the end animation
? ? *
? ? * @param zoomScale Value of scale animation, default is 1.03f
? ? */
? ? public void setZoomScale(float zoomScale)
? ? {
? ? ? ? this.zoomScale = zoomScale;
? ? }
?
? ? public int getZoomDuration()
? ? {
? ? ? ? return zoomDuration;
? ? }
?
? ? /**
? ? * Duration of the ending animation in ms
? ? *
? ? * @param zoomDuration Duration, default is 200ms
? ? */
? ? public void setZoomDuration(int zoomDuration)
? ? {
? ? ? ? this.zoomDuration = zoomDuration;
? ? }
?
? ? public int getRippleDuration()
? ? {
? ? ? ? return rippleDuration;
? ? }
?
? ? /**
? ? * Duration of the Ripple animation in ms
? ? *
? ? * @param rippleDuration Duration, default is 400ms
? ? */
? ? public void setRippleDuration(int rippleDuration)
? ? {
? ? ? ? this.rippleDuration = rippleDuration;
? ? }
?
? ? public int getFrameRate()
? ? {
? ? ? ? return frameRate;
? ? }
?
? ? /**
? ? * Set framerate for Ripple animation
? ? *
? ? * @param frameRate New framerate value, default is 10
? ? */
? ? public void setFrameRate(int frameRate)
? ? {
? ? ? ? this.frameRate = frameRate;
? ? }
?
? ? public int getRippleAlpha()
? ? {
? ? ? ? return rippleAlpha;
? ? }
?
? ? /**
? ? * Set alpha for ripple effect color
? ? *
? ? * @param rippleAlpha Alpha value between 0 and 255, default is 90
? ? */
? ? public void setRippleAlpha(int rippleAlpha)
? ? {
? ? ? ? this.rippleAlpha = rippleAlpha;
? ? }
?
? ? public void setOnRippleCompleteListener(OnRippleCompleteListener listener) {
? ? ? ? this.onCompletionListener = listener;
? ? }
?
? ? /**
? ? * Defines a callback called at the end of the Ripple effect
? ? */
? ? public interface OnRippleCompleteListener {
? ? ? ? void onComplete(RippleView rippleView);
? ? }
?
? ? public enum RippleType {
? ? ? ? SIMPLE(0),
? ? ? ? DOUBLE(1),
? ? ? ? RECTANGLE(2);
?
? ? ? ? int type;
?
? ? ? ? RippleType(int type)
? ? ? ? {
? ? ? ? ? ? this.type = type;
? ? ? ? }
? ? }
}


2.自定义属性




? ? rv_zoomDuration
? ? ? ?
? ? ? ?
? ? ? ?
? ? ? ?
? ? ? ?
? ? ? ?
? ? ? ?
? ? ? ? ? ?
? ? ? ? ? ?
? ? ? ? ? ?
? ? ? ?

? ? ? ?
? ? ? ?
? ? ? ?
?
?


3.主布局文件


? ? xmlns:ripple="http://schemas.android.com/apk/res-auto"
? ? xmlns:tools="http://schemas.android.com/tools"
? ? android:layout_width="match_parent"
? ? android:layout_height="match_parent"
? ? android:orientation="vertical" >
?
? ? ? ? ? ? android:layout_width="match_parent"
? ? ? ? android:layout_height="wrap_content" >
?
? ? ? ? ? ? ? ? ? ? android:layout_width="match_parent"
? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? android:gravity="center_horizontal"
? ? ? ? ? ? android:orientation="vertical" >
?
? ? ? ? ? ?
?
? ? ? ? ? ? ? ? ? ? ? ? ? ? android:id="@+id/more"
? ? ? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? ? ? android:layout_margin="5dp"
? ? ? ? ? ? ? ? ripple:rv_cent

首页 上一页 2 3 4 5 6 下一页 尾页 5/6/6
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Linux网络编程--信号阻塞与屏蔽(.. 下一篇Android 使用shape制作drawable素..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: