rippledrawable

Material ripple effect hidden by other view in layout

元气小坏坏 提交于 2019-11-28 08:24:40
I added a ripple effect on a ImageButton , however it is hidden by an ImageView used as a background for the parent view RelativeLayout . Here's the layout file: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="172dp" android:orientation="vertical" android:theme="@style/ThemeOverlay.AppCompat.Dark"> <ImageView android:id="@+id/drawerBackgroundImageView" android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="centerCrop" android

Listview selector with colored background and ripple effect

孤街浪徒 提交于 2019-11-28 03:11:28
Standard ListView selector in android L developer preview uses colorControlHighlight for the ripple effect on touch and has a transparent background in unfocused state. I would like to define a ListView item that has a colored background and still shows the ripple effect on touch with the same highlight color. Now, if I define the following drawable: <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?android:colorControlHighlight"> <item android:drawable="@color/my_background_color"/> </ripple> it works, but the ripple starts in the middle of the ListView item,

Touch feedback with RecyclerView and CardView

一笑奈何 提交于 2019-11-28 02:54:57
I would love to enable touch feedback for my Open-Source library. I've created a RecyclerView and a CardView . The CardView contains different areas with different onClick actions. Now I would love to trigger the Ripple effect if a user clicks anywhere in the card, but I'm not able to achieve this behavior. This is my listitem, You can find it on GitHub too: https://github.com/mikepenz/AboutLibraries/blob/master/library/src/main/res/layout/listitem_opensource.xml <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:clickable="true" android:background

Create a ripple drawable without transparency

删除回忆录丶 提交于 2019-11-27 16:20:06
问题 I'm a bit lost about how to properly use Ripple Drawable. Let's say I have this drawable : <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:state_pressed="false" android:state_focused="true" android:drawable="@color/accent_color_light" /> <item android:state_pressed="true" android:drawable="@color/accent_color_light" /> <item android:drawable="@android:color/white" /> </selector> So it is a plain white background which

Android ripple background color

主宰稳场 提交于 2019-11-27 11:06:23
问题 I am using a ripple effect on my navigation drawer. I have set it like this and applied it to my ListView: <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_activated="true" android:drawable="@color/black_200" /> <item android:state_pressed="true" android:color="@color/black_200"> <ripple android:color="@color/black_400" /> </item> <item android:drawable="@color/white" /> </selector> I want the ripple background to remain the same like the normal

How to create ripple effect in simple layout

假装没事ソ 提交于 2019-11-27 10:42:42
How can I have a ripple effect in a simple linear/relative layout when touching the layout? I've tried setting the background of a layout to something like: <?xml version="1.0" encoding="utf-8"?> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?android:colorControlHighlight" > <item android:drawable="@android:color/white"/> </ripple> However I'm only seeing a plain white background and no ripple effect when touching the layout. What am I doing wrong? Edit: For reference, here is my layout xml file: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns

How to use RippleDrawable programmatically in code (not xml) with Android 5.0 Lollipop?

六眼飞鱼酱① 提交于 2019-11-27 10:32:21
问题 I have the following code for my ripple: <?xml version="1.0" encoding="utf-8"?> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?android:colorControlHighlight"> <item android:id="@+id/rip"> <shape android:shape="oval"> <solid android:color="?android:colorAccent"/> </shape> </item> </ripple> Now I want to give the user the possibility to choose own colors, so I need to create the ripple programmatically. I found this and I think this is the right way to do it,

Could not find class 'android.graphics.drawable.RippleDrawable'

笑着哭i 提交于 2019-11-27 04:46:56
问题 I'm using a third party library, there is a method using DrawableCompat.setTintMode(drawable, PorterDuff.Mode.SRC_IN); . When I test my app in android 5.0+,there was no problem and worked well.But when it came to android 4.4.4, it threw an Exception: 05-09 13:15:15.030 26447-26447/com.wizchen.athit E/AndroidRuntime: FATAL EXCEPTION: main Process: com.wizchen.athit, PID: 26447 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.wizchen.athit/com.wizchen.athit.view.activity

how to create ripple effect for pre-lollipop

此生再无相见时 提交于 2019-11-27 04:31:49
How to apply ripple effect like this i have put the dependencies in app/build.gradle app/build.gradle dependencies { compile 'com.github.traex.rippleeffect:library:1.3' } build.gradle allprojects{ repositories{ jcenter() maven(url "https://jitpack.io" } XML file: <com.andexert.library.RippleView android:id="@+id/rect1" android:layout_width="match_parent" android:layout_height="wrap_content"> <Button android:id="@+id/enterButton" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Save your user name" /> </com.andexert.library.RippleView> Java class file

Touch feedback with RecyclerView and CardView

社会主义新天地 提交于 2019-11-26 23:52:55
问题 I would love to enable touch feedback for my Open-Source library. I've created a RecyclerView and a CardView . The CardView contains different areas with different onClick actions. Now I would love to trigger the Ripple effect if a user clicks anywhere in the card, but I'm not able to achieve this behavior. This is my listitem, You can find it on GitHub too: https://github.com/mikepenz/AboutLibraries/blob/master/library/src/main/res/layout/listitem_opensource.xml <RelativeLayout android