rippledrawable

How to add ripple effect to preferences in android?

蓝咒 提交于 2021-02-07 11:58:42
问题 I am working on adding ripple effect when the preference is touched (selected). I have customized my preference by extending the ListPreference . I have tried to set the ripple effect programmatically by using RippleDrawable but I don't see the animation. Here is my customized preference class public class CustomListPreference extends ListPreference { public CustomListPreference(Context context, AttributeSet attrs) { super(context, attrs); } public CustomListPreference(Context context) {

How to make a circular ripple on a button when it's being clicked?

杀马特。学长 韩版系。学妹 提交于 2020-06-09 07:21:26
问题 Background On the dialer app of Android, when you start searching for something, and you click the arrow button on the left of the EditText, you get a circular ripple effect on it : The problem I've tried to have it too, but I got a rectangular one: <ImageButton android:id="@+id/navButton" android:layout_width="40dp" android:layout_height="40dp" android:layout_gravity="center_vertical" android:layout_marginLeft="8dp" android:background="?android:attr/selectableItemBackground" android:src="

Ripple effect over imageview

拥有回忆 提交于 2020-06-08 06:55:08
问题 To describe my problem i created small example. I have linearlayout with imageview and textview. For linearlayout i've set ripple drawable as background. But when i click or long click on linearlayout ripple animation shows under imageview. How show animation over imageview ? main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/activity_main" android:layout_width="match_parent"

prevent shortClick when longClick pressed

十年热恋 提交于 2020-01-17 07:08:07
问题 I want to cancel shortClick when LongClicked an item, I'm using ripple effect material-ripple library in list view but when i long press list item it also call onClick-event list.setOnItemClickListner not work with MaterialRippleLayout on row item i have also return true in OnLongClicked but does not work.. also tried and added method in MaterialRippleLayout.java @Override public void setOnLongClickListener(OnLongClickListener l) { super.setOnLongClickListener(l); childView

java.lang.IllegalStateException: Underflow in restore - more restores than saves

安稳与你 提交于 2020-01-11 05:25:07
问题 I am using rippleeffect library for my project. But in Android Nougat and Marshmallow , App crashes due to this library: compile 'com.github.traex.rippleeffect:library:1.3' The error message is: FATAL EXCEPTION: main Process: com.test.testapp, PID: 17713 java.lang.IllegalStateException: Underflow in restore - more restores than saves at android.graphics.Canvas.native_restore(Native Method) at android.graphics.Canvas.restore(Canvas.java:522) at com.andexert.library.RippleView.draw(RippleView

Set RippleDrawable corner radius programmatically

馋奶兔 提交于 2020-01-03 17:04:22
问题 I create a RippleDrawable like below. But I can't change the corner radius of the RippleDrawable. It doesn't have a method like setCornerRadii(float[] f) . public static RippleDrawable getPressedColorRippleDrawable(int normalColor, int pressedColor) { if (Build.VERSION.SDK_INT>=21) { RippleDrawable rippleDrawable = new RippleDrawable(getPressedColorSelector(normalColor, pressedColor), getColorDrawableFromColor(normalColor), null); //rippleDrawable.setRadius((int) Manager.convertDpToPixel(5));

Ripple effect does not show up sometimes

孤街浪徒 提交于 2020-01-01 01:54:14
问题 I defined a ripple drawable and set it as the background for the listview item view's background. It almost works fine but the ripple effect just sometimes does not show up upon press. Here is the ripple drawable code: <?xml version="1.0" encoding="utf-8"?> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?android:attr/colorControlHighlight"> <item> <selector> <item android:state_activated="true"> <shape><solid android:color="?android:attr/colorButtonNormal"/>

NavigationView Ripple Lost In Support Library 23.1.0 Update

纵然是瞬间 提交于 2019-12-30 06:48:09
问题 Using the Design Support Library version 23.0.1 , menu items within the NavigationView appear to, by the default, support the ripple animation when selected. However, when upgraded to Design Support Library version 23.1.0 the ripple animation appears to be lost. Is this a bug? Has anyone else noticed this as well and can replicate it? And, better yet, does anyone have a solution? I first discovered this issue while utilizing the NavigationView via Design Support Library version 23.4.0 and

Implementing Ripple effect outside ImageButton

微笑、不失礼 提交于 2019-12-30 01:37:09
问题 I am trying to implement ripple effect for ImageButton.I have set ripple in background and drawable image in the src for it. android:background="@drawable/myripplexml" android:src="@drawable/myimagepath" Its giving nice ripple effect inside button Layout. But I want Ripple effect to extend outside the Button Layout also.Another way to do it is using : android:background="?android:attr/selectableItemBackgroundBorderless" But it uses default color and style. How can I customize it regarding

Add ripple effect to my button with button background color?

一世执手 提交于 2019-12-27 16:32:23
问题 I created a button and I want to add ripple effect to that button! I created a button bg XML file: (bg_btn.xml) <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:startColor="#FFFFFF" android:endColor="#00FF00" android:angle="270" /> <corners android:radius="3dp" /> <stroke android:width="5px" android:color="#000000" /> </shape> And this is my ripple effect file: (ripple_bg.xml) <ripple xmlns:android="http://schemas.android.com/apk