Sunday, 26 April 2015

Android Ripple Touch Effect Example


Step 1):main_activity.xml

<RelativeLayout     xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">
         <com.xgc1986.ripplebutton.widget.RippleButton
            android:id="@+id/Summit"
            android:layout_width="260dp"
            android:layout_height="50dp"
            android:text="Login"
            android:textColor="@color/white"
            android:textStyle="bold"
            app:buttonColor="@color/Button"
            app:rippleColor="@color/white" />
  </RelativeLayout>


Step 2):build.gradle file



android 
 {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.as0060.mylifeinbytes"
        minSdkVersion 16
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release
                {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'),                'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.1.0'
    compile 'com.xgc1986.android:ripplebutton:0.4.0'
}


  compile 'com.xgc1986.android:ripplebutton:0.4.0' ...we have to include this Library in our gradle file to use android ripple effect


Happy Coding:)