RippleDrawable alternatives and similar packages
Based on the "Material Widget" category.
Alternatively, view RippleDrawable alternatives based on common mentions on social networks and blogs.
-
material-dialogs
DISCONTINUED. 😍 A beautiful, fluid, and extensible dialogs API for Kotlin & Android. -
MaterialDrawer
The flexible, easy to use, all in one drawer library for your Android project. Now brand new with material 2 design. -
android-floating-action-button
Floating Action Button for Android based on Material Design specification -
Carbon
Material Design implementation for Android 4.0+. Shadows, ripples, vectors, fonts, animations, widgets, rounded corners and more. -
MaterialDialog
DISCONTINUED. An Android library for conveniently building Material Design Dialog in Android version 2.2 ~ L. -
MaterialNavigationDrawer
DISCONTINUED. Navigation Drawer Activity with material design style and simplified methods -
MaterialList
An Android library aimed to get the beautiful CardViews that Google shows at its official design specifications -
MaterialTabs
DISCONTINUED. Custom Tabs with Material Design effects. It requires 14+ API and android support v7 (Toolbar) -
snackbar
[DEPRECATED] Android Library that implements Snackbars from Google's Material Design documentation. -
MaterialEverywhere
Showcase of the new AppCompat 21, which includes new Material Theme, working in pre-21 devices. -
Material Dialogs for Android 📱
📱Android Library to implement animated, 😍beautiful, 🎨stylish Material Dialog in android apps easily. -
android-materialshadowninepatch
Provides 9-patch based drop shadow for view elements. Works on API level 9 or later. -
uberprogressview
:hourglass_flowing_sand: An android progress view developed after taking inspiration from Uber app.
InfluxDB - Power Real-Time Data Analytics at Scale
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of RippleDrawable or a related project?
README
RippleDrawable
Port of Android <ripple>
effect for pre lollipop devices with android 14 + (ICS+)
(well, since NineOldAndroids is deprecated, this library become 14 + only)
Features
- XML inflating
- Ripple supports different shapes
- Custom drawable loader
- Define your custom drawable tags
Implementation
Create your desirable ripple.xml in drawable/
folder
<?xml version="1.0" encoding="utf-8"?>
<ripple
xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/ripple_material_light"> <!-- ripple color -->
<!-- for Floating Action Button -->
<item>
<shape android:shape="oval">
<solid android:color="@color/accent_material_dark"/>
</shape>
</item>
</ripple>
Secondly we need to inflate RippleDrawable
and intercept View
touches
see LollipopDrawablesCompat
and DrawableHotspotTouch
for inflating and interception sequently. Here is sample:
public class SampleActivity extends AppCompatActivity {
private FloatingActionButton mActionButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sample);
mActionButton = (FloatingActionButton) findViewById(R.id.fab);
mActionButton.setBackgroundDrawable(getDrawable2(R.drawable.fab_background));
mActionButton.setClickable(true);// if we don't set it true, ripple will not be played
mActionButton.setOnTouchListener(
new DrawableHotspotTouch((LollipopDrawable) mActionButton.getBackground()));
}
/**
* {@link #getDrawable(int)} is already taken by Android API
* and method is final, so we need to give another name :(
*/
public Drawable getDrawable2(int id){
return LollipopDrawablesCompat.getDrawable(getResources(), id, getTheme());
}
}
Thats it!
Dependency
root build.gradle add a repository
repositories {
maven {
url "https://jitpack.io"
}
}
and in application module just add
dependencies {
compile 'com.github.ozodrukh:RippleDrawable:2.0.0'
}
a little bit more
you can inflate and create your own Drawable
classes, here is tips & tricks
1 extend your Drawable from LollipopDrawable
public class LayerDrawable extends LollipopDrawable {
2 implement your own inflation
public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Resources.Theme theme);
3 Register your LollipopDrawable
static {
LollipopDrawablesCompat.registerDrawable(RippleDrawable.class, "ripple");
}
4 inflate it!
LollipopDrawablesCompat.getDrawable(getResources(), R.drawable.custom_drawable, getTheme());
License
The MIT License (MIT)
Copyright (c) 2015 Abdullaev Ozodrukh
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.
*Note that all licence references and agreements mentioned in the RippleDrawable README section above
are relevant to that project's source code only.