5 Star 2 Fork 1

HarmonyOS-TPC / RippleEffect

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Demo

how to user?

dependencies{
    implementation 'io.openharmony.tpc.thirdlib:RippleEffect:1.0.1'
}
RippleType = SIMPLE

<com.andexert.library.RippleView
     ohos:height="match_content"
     ohos:width="match_content">
     <Image
          ohos:height="match_content"
          ohos:width="match_content"
          ohos:image_src="$media:icon"/>
</com.andexert.library.RippleView>


RippleType = SIMPLE   isCentered = true;

<com.andexert.library.RippleView
      ohos:height="match_content"
      ohos:width="match_content"
      ripple:rv_centered="true">
      <Image
           ohos:height="match_content"
           ohos:width="match_content"
           ohos:image_src="$media:icon"/>
</com.andexert.library.RippleView>


RippleType = DOUBLE

<com.andexert.library.RippleView
      ohos:height="match_content"
      ohos:width="match_content"
      ripple:rv_type="1">

      <Image
           ohos:height="match_content"
           ohos:width="match_content"
           ohos:image_src="$media:icon"/>
</com.andexert.library.RippleView>


RippleType = RECTANGLE

<com.andexert.library.RippleView
     ohos:padding="10vp"
     ohos:height="match_content"
     ohos:width="match_content"
     ripple:rv_type="2"
     ripple:rv_zoom="true">

     <Image
           ohos:height="100vp"
           ohos:width="200vp"
           ohos:background_element="red"/>
</com.andexert.library.RippleView>

API:

class:RippleView

public void animateRipple(TouchEvent event)

  • description: animate ripple with touch event

public void animateRipple(final float x, final float y)

  • description: animate ripple with the x-coordinate and the y-coordinate

public void setRippleColor(int rippleColor)

  • description: set ripple color

public int getRippleColor()

  • description: get ripple color

public RippleType getRippleType()

  • description: get ripple type

public void setRippleType

  • description: set ripple type

public Boolean isCentered()

  • description: is centered mode

public void setCentered(final Boolean isCentered)

  • description: set centered mode

public int getRipplePadding()

  • description: get ripple padding

public void setRipplePadding(int ripplePadding)

  • description: set ripple padding

public Boolean isZooming()

  • description: child is zoom

public void setZooming(Boolean hasToZoom)

  • description: set child is zoom

public float getZoomScale()

  • description: get zoom scale

public void setZoomScale(float zoomScale)

  • description: set zoom scale

public int getZoomDuration()

  • description: get zoom duration

public void setZoomDuration(int zoomDuration)

  • description: set zoom duration

public int getFrameRate()

  • description: get frame rate

public void setFrameRate(int frameRate)

  • description: set frame rate

public float getRippleAlpha()

  • description: get ripple alpha

public void setRippleAlpha(float rippleAlpha)

  • description: set ripple alpha

public void setOnRippleCompleteListener(OnRippleCompleteListener listener)

  • description: set ripple complete listener

AttrSet:

name format description
rv_color color set ripple color
rv_type int set ripple type
rv_zoom boolean has to zoom
rv_centered boolean is centered
rv_rippleDuration int set ripple duration
rv_alpha float set ripple alpha
rv_ripplePadding int set ripple padding
rv_zoomScale float set ripple zoom scale
rv_zoomDuration int set zoome duration
The MIT License (MIT) Copyright (c) 2014 Robin Chutaux Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
Java
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/HarmonyOS-tpc/RippleEffect.git
git@gitee.com:HarmonyOS-tpc/RippleEffect.git
HarmonyOS-tpc
RippleEffect
RippleEffect
master

搜索帮助