Rainlayout

Constraintlayout based rain-animation view developed backed by Kotlin Coroutines.

Rainlayout

Setup

Gradle

allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}
  
  .....

dependencies {
      implementation 'com.github.fevziomurtekin:Rainlayout:1.1'
   }
}

Layout

  <com.fevziomurtekin.widget.RainlayoutView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/rainview"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:background="@android:color/holo_orange_light"
        xmlns:android="http://schemas.android.com/apk/res/android"
        app:isColorful="true"
        app:dropPerSecond="1"
        app:durationOfDropTime="500"
        app:dropSrc="@drawable/umbrella"
        app:dropTintColor="@color/colorPrimary">


</com.fevziomurtekin.widget.RainlayoutView>

Attributes

Attribute Description
isColorful This attribute makes the drop colorful. You can choose true or false (by default false)
dropPerSecond This attribute determines how many drops per second. You can value the data type Int. (by default 100)
durationOfDropTime This attribute determines the number of seconds the drop will drop to the floor. You can value the data type Int-milisecond.(by default 500)
dropSrc This attribute change the view of the drop.
dropTintColor The attribute change the color of the drop (by default @android:color/white)

Warning : To Stop the animation in Activity / Fragment changes!

    override fun onStop() {
        super.onStop()
        rainview.animationClear()
    }

GitHub