material-ripple
material-ripple copied to clipboard
programmatically added ripple has no effect
I'm using "1.0.6-SNAPSHOT" from sonatype, which works fine, from last october. Than i switched to the release version 1.0.1 and the programmatically added MaterialRippleLayout has no effect, when I click on the item itself. Do you have any hints?
Do not use any of the SNAPSHOTS, they're outdated.
Could you provide the code you used that doesn't work?
MaterialRippleLayout.on(view).rippleColor(view.getResources().getColor(R.color.scout_grey_4)).create()
@balysv do you have any idea?
Did you use compile 'com.balysv:material-ripple:1.0.1'
?
yes
Balys Valentukevicius [email protected] schrieb am Di., 24. März 2015 um 11:35 Uhr:
Did you use compile 'com.balysv:material-ripple:1.0.1'?
— Reply to this email directly or view it on GitHub https://github.com/balysv/material-ripple/issues/34#issuecomment-85443596 .
Provide the xml of the view or any modification that you do it before & after applying the ripple, thanks :)
this is the item of a recyclerview, which adds the ripplelayout in the creation of the item:
<android.support.v7.widget.CardView style="@style/card_layout" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" app:cardBackgroundColor="@color/white" xmlns:app="http://schemas.android.com/apk/res-auto">
<RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content">
<View
android:id="@+id/brand_color"
android:layout_width="match_parent"
android:layout_height="@dimen/default_gap"
android:background="@color/scout_blue_11"/>
<de.is24.mobile.android.ui.view.LazyLoadingImageView
android:id="@+id/picture"
android:layout_width="match_parent"
android:layout_height="@dimen/result_list_image_height_xl"
android:layout_below="@+id/brand_color"/>
<TextView
android:id="@+id/new_badge"
style="@style/staggered_grid_view_item_text.new_badge"
android:layout_below="@+id/picture"
android:text="@string/label_new_badge"/>
<TextView
android:id="@+id/criteria_info"
style="@style/staggered_grid_view_item_text"
android:layout_below="@+id/picture"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:textSize="20sp"
android:fontFamily="@string/font_family_medium"
android:layout_toRightOf="@+id/new_badge"
android:layout_toLeftOf="@+id/favorite_marker"
android:textIsSelectable="false"
tools:text="criteria"
tools:ignore="UnusedAttribute"/>
<TextView
android:id="@+id/location_info"
style="@style/staggered_grid_view_item_text"
android:layout_below="@+id/criteria_info"
android:layout_marginLeft="16dp"
android:layout_toLeftOf="@+id/favorite_marker"
android:textIsSelectable="false"
tools:text="location info"
android:paddingBottom="16dp"/>
<ImageView
android:id="@+id/favorite_marker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/picture"
android:layout_alignParentRight="true"
android:layout_alignBottom="@id/location_info"
android:contentDescription="@null"
android:padding="16dp"
android:scaleType="center"
android:src="@drawable/ic_staroutline_in_list_active"/>
<ImageView
android:id="@+id/via_badge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/badge_premium"/>
<de.is24.mobile.android.ui.view.LazyLoadingImageView
android:id="@+id/realtor_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/half_gap"
android:adjustViewBounds="true"
android:maxHeight="@dimen/realtor_logo_height"
android:maxWidth="@dimen/realtor_logo_max_width"
android:minWidth="@dimen/realtor_logo_min_width"
android:scaleType="fitEnd"/>
I'll have a look, I haven't tested it with RecyclerView
Any progress on this?
Sorry, had little time in the past months. Gonna have a look in the upcoming week.
Tested with RecyclerView and it works as expected except for #35 which I'm working on now.
Might be that your layout background overlays the ripples. Try:
MaterialRippleLayout.on(view)
.rippleOverlay(true)
.rippleHover(true)
.rippleColor(color)
.create()
Had this problem and even after setting the overlay to true it still wasn't showing. I set rippleAlpha() to 0.2f and it started working, so it was probably working all the time and you just couldn't see.
thx very much, that solved it! combination of rippleOverlay, rippleHover and rippleAlpha
Thanks @aricneto I forgot to set rippleAlpha(). Beautiful API....