Ripple effect wrapper for Android Views
compile 'com.balysv:material-ripple:1.0.2'
Check for latest version number on the widget below or visit Releases
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
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.
Balys Valentukevicius
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.
Android Material Design Ripple Effect在Android5.0(SDK=21)以下Android版本崩溃问题解决 附录1的Android Ripple Effect水波波纹荡漾的视觉交互设计,在Android SDK版本21上运作良好,但是放到21版本以下,比如Android 4.0.3(SDK=15),就会导致整个APP崩溃,其中一个解决方案:以附录文章1为例,
炫酷的MaterialDesign Ripple 水波纹触摸动画 google在android 5.0上加入了触摸反馈动画(Ripple),设置成功后,点击控件的时候会从点击位置产生一圈水波纹的扩散效果 使用系统自带资源在XML文件上配置Ripple动画 //波纹有边界 android:background="?android:attr/selectableItemBackground" //
Material Design for AngularJS Apps Material Design is a specification for aunified system of visual, motion, and interaction design that adapts across different devices. Ourgoal is to deliver a lean,
材料拥有确定不变的特性和固定的行为。了解这些特性将有助于你在一定程度上熟悉材料,这与 Material Design 的构想是一致的。 物理特性 材料具有变化的长宽尺寸(以 dp 为计)和均匀的厚度(1dp)。 (上图)可取 材料的高度和宽度是可变的。 (上图)不可取 材料总是 1dp 厚。 材料会形成阴影。 阴影是由于材料元件之间的相对高度(Z 轴位置)而自然产生的。 (上图)可取 阴影描述材料
Material ScrollTop 是轻量级的回到页面顶部按钮,特点: 轻量级 Material Design inspired 涟漪效应 平滑的动态效果 定制化 一些实用的选项 CSS3 (Sass) + jQuery
Vue Material 是一个实现 Google 的像素材料设计的 Vue 组件库,它提供了适合所有现代Web浏览器的内置动态主题的组件,它的 API 也简单明了。 安装和使用: 通过 npm or yarn 安装 npm install vue-material@beta --saveyarn add vue-material@beta 像 JSPM and Bower 暂时还不支持 在代码中
Material-Animations 是一个很好过渡动画库, 可以应用于 Activity 与 Activity 之间的跳转, Fragment 与 Fragment 之间的跳转, 以及各个 View 变化前后的过渡动画。 效果图:
这是一款非常易用于采用了 Bootstrap 3 技术的应用的Google Material Design的Bootstrap主题。要使用这个主题,只需向项目中添加Bootstrap CSS 和 Javascript 即可运作。
简介 materail-admin 是一个通用的基础的后台管理系统,它基于Spring Boot2 和 Bootstrap 实现。它使用了当下流行的java 框架Spring Boot和基于Materail Design风格的组件构建。内置了权限管理,配置管理,组织机构,用户,定时任务,消息管理等后台常用的基础功能。提炼了典型的业务模型,可以帮助你快速搭建企业级中后台产品系统。 在线预览 准备 你