rippledrawable

Add ripple effect to my button with button background color?

社会主义新天地 提交于 2019-11-26 23:24:51
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/res/android" xmlns:tools="http://schemas.android.com/tools" android:color="#f816a463" tools:targetApi=

Material ripple effect hidden by other view in layout

感情迁移 提交于 2019-11-26 23:02:44
问题 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

Android L's Ripple Effect - Touch Feedback for Buttons - Using XML

蹲街弑〆低调 提交于 2019-11-26 19:34:31
I am trying to understand how to implement the "Ripple Effect - Touch Feedback" for buttons and other views. I looked at the questions related to Ripple touch effect on SO and got some insight into it. I was able to successfully get the ripple effect using this java code. import android.animation.ObjectAnimator; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Path; import android.graphics.RadialGradient; import android.graphics.Region; import android.graphics.Shader; import android.support

Could not find RippleDrawable

雨燕双飞 提交于 2019-11-26 11:27:41
问题 I want to create a ripple dynamically in code. Code: if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { buyButton.setBackground(getPressedColorRippleDrawable(primaryColor, darkerVariant)); } public static RippleDrawable getPressedColorRippleDrawable(int color, int darkerVariant) { if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { ColorStateList colorStateList = new ColorStateList( new int[][] {new int[]{}}, new int[] {darkerVariant} ); return new

how to create ripple effect for pre-lollipop

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 11:14:06
问题 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

Android L&#39;s Ripple Effect - Touch Feedback for Buttons - Using XML

只谈情不闲聊 提交于 2019-11-26 08:58:31
问题 I am trying to understand how to implement the \"Ripple Effect - Touch Feedback\" for buttons and other views. I looked at the questions related to Ripple touch effect on SO and got some insight into it. I was able to successfully get the ripple effect using this java code. import android.animation.ObjectAnimator; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Path; import android.graphics

Android L&#39;s Ripple Effect - Touch Feedback for Buttons - Using XML

好久不见. 提交于 2019-11-26 07:19:50
问题 I am trying to understand how to implement the \"Ripple Effect - Touch Feedback\" for buttons and other views. I looked at the questions related to Ripple touch effect on SO and got some insight into it. I was able to successfully get the ripple effect using this java code. import android.animation.ObjectAnimator; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Path; import android.graphics