traex / RippleEffect

Implementation of Ripple effect from Material Design for Android API 9+
MIT License
4.92k stars 1.08k forks source link

Losing Ripple Effect Upon Screen Rotation #69

Closed PaulYoum closed 8 years ago

PaulYoum commented 9 years ago

The ripple effect works as expected when in landscape mode, but as soon as I rotate a device to portrait, the ripple effect is lost. I don't see a ripple anywhere in view. If I rotate back to landscape, the ripple effect is back. I suspect it might be something to do with the fact that I am not destroying the view upon rotation. Unfortunately, due to another library which I must use, I can't destroy the view upon rotation.

So in my AndroidManifest.xml, the configChanges are:

    <activity
        android:name=".HydrantFormActivity"
        android:label="@string/title_activity_hydrant_form"
        android:parentActivityName=".MainActivity"
        android:configChanges="orientation|screenSize|uiMode"
        >

And my implementation of the rippleView in code is:

<com.andexert.library.RippleView
    android:id="@+id/rippleView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:rv_color="@android:color/holo_blue_dark"
    app:rv_rippleDuration="100"
    app:rv_ripplePadding="600dp"
    >

I've also set app:rv_centered to true just to see if the ripple was showing up somewhere else. It shows centered in landscape, but once again I don't see it in portrait.

traex commented 8 years ago

Hi, The view is destroyed after a rotation and the ripple effect is lost. If you can't see it in portrait I think that your layout has an issue. Please take a look to the sample for more details