All Projects → balysv → Material Ripple

balysv / Material Ripple

Licence: apache-2.0
Android L Ripple effect wrapper for Views

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Material Ripple

Ripplejs
vanilla Material Design ripples
Stars: ✭ 177 (-92.45%)
Mutual labels:  ripple
Jaffree
Java ffmpeg and ffprobe command-line wrapper
Stars: ✭ 184 (-92.15%)
Mutual labels:  wrapper
Typedpreferences
Preference wrappers for primitive types for Android
Stars: ✭ 191 (-91.85%)
Mutual labels:  wrapper
Nopaginate
Android pagination library (updated 01.05.2018)
Stars: ✭ 180 (-92.32%)
Mutual labels:  wrapper
Kau
An extensive collection of Kotlin Android Utils
Stars: ✭ 182 (-92.24%)
Mutual labels:  ripple
Godot Kotlin Native
Kotlin bindings for Godot Engine
Stars: ✭ 186 (-92.06%)
Mutual labels:  wrapper
Ksprefs
🚀⚡ Kotlin SharedPreferences wrapper & cryptographic preferences android library.
Stars: ✭ 176 (-92.49%)
Mutual labels:  wrapper
Xrpl Dev Portal
XRP Ledger developer portal with documentation and examples
Stars: ✭ 198 (-91.55%)
Mutual labels:  ripple
Swiftdb
A modern database abstraction layer, batteries included.
Stars: ✭ 183 (-92.19%)
Mutual labels:  wrapper
W32
A wrapper of Windows APIs for Go
Stars: ✭ 190 (-91.89%)
Mutual labels:  wrapper
Wiki
Wikipedia Interface for Node.js
Stars: ✭ 180 (-92.32%)
Mutual labels:  wrapper
Qt5.cr
Qt5 bindings for Crystal, based on Bindgen
Stars: ✭ 182 (-92.24%)
Mutual labels:  wrapper
Testura.code
Testura.Code is a wrapper around the Roslyn API and used for generation, saving and compiling C# code. It provides methods and helpers to generate classes, methods, statements and expressions.
Stars: ✭ 189 (-91.94%)
Mutual labels:  wrapper
Modernavplayer
ModernAVPlayer is a persistence AVPlayer wrapper
Stars: ✭ 179 (-92.36%)
Mutual labels:  wrapper
Mailjet Apiv3 Php
[API v3] Mailjet PHP Wrapper
Stars: ✭ 194 (-91.72%)
Mutual labels:  wrapper
Tdl
Node.js bindings to TDLib.
Stars: ✭ 177 (-92.45%)
Mutual labels:  wrapper
Fbrecog
An unofficial python wrapper for the Facebook face recognition endpoint
Stars: ✭ 184 (-92.15%)
Mutual labels:  wrapper
Node Fb Messenger
✉️ Facebook Messenger Platform Node.js API Wrapper
Stars: ✭ 206 (-91.21%)
Mutual labels:  wrapper
Flutter wrapper
Flutter execution wrapper which keeps the flutter version in sync for each project
Stars: ✭ 195 (-91.68%)
Mutual labels:  wrapper
Uniswap Python
🦄 The unofficial Python client for the Uniswap exchange.
Stars: ✭ 191 (-91.85%)
Mutual labels:  wrapper

Material Ripple Layout

Ripple effect wrapper for Android Views

Demo Image

Including in your project

compile 'com.balysv:material-ripple:1.0.2'

Check for latest version number on the widget below or visit Releases

Maven Central

Usage

Use static initializer on your View (see xml attributes below for customization)

MaterialRippleLayout.on(view)
           .rippleColor(Color.BLACK)
           .create();

Or wrap your View with MaterialRippleLayout in your layout file:

<com.balysv.materialripple.MaterialRippleLayout
    android:id="@+id/ripple"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:text="Button inside a ripple"/>

</com.balysv.materialripple.MaterialRippleLayout>

If using in an AdapterView you must set rippleInAdapter to true

Configure using xml attributes or setters in code:

app:mrl_rippleOverlay="true"              // if true, ripple is drawn in foreground; false - background
app:mrl_rippleColor="#ff0000"             // color of ripple
app:mrl_rippleAlpha="0.1"                 // alpha of ripple
app:mrl_rippleDimension="10dp"            // radius of hover and starting ripple
app:mrl_rippleHover="true"                // if true, a hover effect is drawn when view is touched
app:mrl_rippleRoundedCorners="10dp"       // radius of corners of ripples. Note: it uses software rendering pipeline for API 17 and below
app:mrl_rippleInAdapter="true"            // if true, MaterialRippleLayout will optimize for use in AdapterViews
app:mrl_rippleDuration="350"              // duration of ripple animation
app:mrl_rippleFadeDuration="75"           // duration of fade out effect on ripple
app:mrl_rippleDelayClick="true"           // if true, delays calls to OnClickListeners until ripple effect ends
app:mrl_rippleBackground="#FFFFFF"        // background under ripple drawable; used with rippleOverlay="false"
app:mrl_ripplePersistent="true"           // if true, ripple background color persists after animation, until setRadius(0) is called

Set an OnClickListener to MaterialRippleLayout:

findViewById(R.id.ripple).setOnClickListener(new View.OnClickListener() {
    @Override public void onClick(View v) {
        // handle me 
    }
});

Or if using in an AdapterView, simply use OnItemClickListener

Support for Android api versions < 14

For those unlucky developers that need to support older versions than 14, there's a way to do it.

You can use this library in addition with Jake Wharton's animation backport (http://nineoldandroids.com/) changing the imports from import android.animation.*; to: import com.nineoldandroids.animation.*; , import android.util.Property; to import com.nineoldandroids.util.Property; and in MaterialRippleLayout.java file, calling function shouldDelayChildPressedState() only if you're using api greater than 14.

Developed By

Balys Valentukevicius

License

Copyright 2015 Balys Valentukevicius

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].