All Projects → huang125 → RippleView

huang125 / RippleView

Licence: other
A view similar ripple effect.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to RippleView

Meiwidgetview
🔥一款汇总了郭霖,鸿洋,以及自己平时收集的自定义控件集合库(小红书)
Stars: ✭ 2,060 (+13633.33%)
Mutual labels:  rippleview
LoadersPack-Android
Android LoadersPack - a replacement of default android material progressbar with different loaders
Stars: ✭ 119 (+693.33%)
Mutual labels:  rippleview

RippleView

A view similar ripple effect.

Gradle

dependencies {
  ...
  compile 'com.huang.rippleview:rippleview:1.0.1'
}

Usage

 <rippleview.huang.com.RippleView
            android:id="@+id/ripple_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:ripple_amount="3"
            app:ripple_color="@android:color/holo_blue_light"
            app:ripple_duration="3000"
            app:ripple_scale="4.0"
            app:ripple_strokeWidth="2.0"
            app:ripple_style="fillRipple" />

Style

You can change the RippleView style to fill or stroke.

  • .xml
app:ripple_style="fillRipple"
//or
app:ripple_style="strokeRipple"
  • code
RippleView.setRippleStyle(RippleStyle.FILL);
//or
RippleView.setRippleStyle(RippleStyle.STROKE);

Color

You can change the RippleView color as you like.

  • .xml
app:ripple_color="@android:color/holo_blue_light"
  • code
RippleView.setRippleColor(R.color.blue);

Amount

You can set any int parameter to change ripple amount. But i think you don't want to set it too big, because it's so bad experience.

  • .xml
app:ripple_amount="3"
  • code
RippleView.setRippleAmount(5);

Scale

I think there have some problems. I will fix it in the future. Don't worry.

  • .xml
app:ripple_scale="4.0"
  • code
RippleView.setRippleScale(3.0);

Duration

Duration is every ripple's scale time. Biger slower and smaller faster.

  • .xml
app:ripple_duration="3000"
  • code
RippleView.setRippleDuration(1000 * 5);

StrokeWidth

When style is RippleStyle.STROKE can see this effect.

  • .xml
app:ripple_strokeWidth="2.0"
  • code
RippleView.setRippleStrokeWidth(4.0);

License

Copyright 2017 Huang

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].