Material Design SeekBar in Android

Android SeekBar is a kind of ProgressBar with draggable thumb. The end user can drag the thum left and right to move the progress of song, file download etc.
The SeekBar.OnSeekBarChangeListener interface provides methods to perform even handling for seek bar. Android SeekBar and RatingBar classes are the sub classes of AbsSeekBar.

1. TwoWaySeekBar.java

package com.tutorialsee.seekbar;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class TwoWaySeekBar extends Activity {
Button Button1,Button2,Button3,Button4,Button5,Button6,Button7;
Context context;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.two_way_seek_bar);
context = this;
Button1 = (Button) findViewById(R.id.button1);
Button2 = (Button) findViewById(R.id.button2);
Button3 = (Button) findViewById(R.id.button3);
Button4 = (Button) findViewById(R.id.button4);
Button5 = (Button) findViewById(R.id.button5);
Button6 = (Button) findViewById(R.id.button6);
Button7 = (Button) findViewById(R.id.button7);
Button1.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {
Intent i = new Intent(context, AlertBox.class);
overridePendingTransition(R.anim.abc_fade_in, R.anim.abc_fade_out);  
startActivity(i);

}
});

Button2.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {
Intent i = new Intent(context, Discrete.class);
overridePendingTransition(R.anim.abc_fade_in, R.anim.abc_fade_out);  
startActivity(i);

}
});

Button3.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {
Intent i = new Intent(context, DoubleSeekBar.class);
overridePendingTransition(R.anim.abc_fade_in, R.anim.abc_fade_out);  
startActivity(i);

}
});

Button4.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {
Intent i = new Intent(context, SeekBarValue.class);
overridePendingTransition(R.anim.abc_fade_in, R.anim.abc_fade_out);  
startActivity(i);

}
});

Button5.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {
Intent i = new Intent(context, TextSizeSeekBar.class);
overridePendingTransition(R.anim.abc_fade_in, R.anim.abc_fade_out);  
startActivity(i);

}
});

Button6.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {
Intent i = new Intent(context, VerticalSeekBar.class);
overridePendingTransition(R.anim.abc_fade_in, R.anim.abc_fade_out);  
startActivity(i);

}
});

Button7.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {
Intent i = new Intent(context, DoubleSeekBar.class);
overridePendingTransition(R.anim.abc_fade_in, R.anim.abc_fade_out);  
startActivity(i);

}
});

}
}

2. two_way_seek_bar.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#607D8B"
    android:orientation="vertical"
    tools:context=".MainActivity" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="1dp"
        android:layout_weight="1"
        android:orientation="horizontal" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:gravity="center"
            android:orientation="horizontal" >

            <Button
                android:id="@+id/button1"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="#B0BEC5"
                android:onClick="showInfoToast"
                android:text="Alert Box"
                android:textColor="#607D8B"
                android:textSize="15sp" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginLeft="1dp"
            android:layout_weight="1"
            android:gravity="center"
            android:orientation="horizontal" >

            <Button
                android:id="@+id/button2"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="#B0BEC5"
                android:onClick="showDefaultToast"
                android:text="Dicrete"
                android:textColor="#607D8B"
                android:textSize="15sp" />
        </LinearLayout>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginBottom="1dp"
        android:layout_marginLeft="1dp"
        android:layout_marginRight="1dp"
        android:layout_weight="1"
        android:orientation="horizontal" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:gravity="center"
            android:orientation="horizontal" >

            <Button
                android:id="@+id/button3"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="#B0BEC5"
                android:onClick="showInfoToast"
                android:text="Double SeekBar"
                android:textColor="#607D8B"
                android:textSize="15sp" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginLeft="1dp"
            android:layout_weight="1"
            android:gravity="center"
            android:orientation="horizontal" >

            <Button
                android:id="@+id/button4"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="#B0BEC5"
                android:onClick="showDefaultToast"
                android:text="SeekBar Value"
                android:textColor="#607D8B"
                android:textSize="15sp" />
        </LinearLayout>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginLeft="1dp"
        android:layout_marginRight="1dp"
        android:layout_weight="1"
        android:orientation="horizontal" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:gravity="center"
            android:orientation="horizontal" >

            <Button
                android:id="@+id/button5"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="#B0BEC5"
                android:onClick="showInfoToast"
                android:text="SeekBar TextSize"
                android:textColor="#607D8B"
                android:textSize="15sp" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginLeft="1dp"
            android:layout_weight="1"
            android:gravity="center"
            android:orientation="horizontal" >

            <Button
                android:id="@+id/button6"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="#B0BEC5"
                android:onClick="showDefaultToast"
                android:text="Vertical SeekBar"
                android:textColor="#607D8B"
                android:textSize="15sp" />
        </LinearLayout>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="1dp"
        android:layout_weight="1"
        android:orientation="horizontal" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:gravity="center"
            android:orientation="horizontal" >

            <Button
                android:id="@+id/button7"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="#B0BEC5"
                android:onClick="showInfoToast"
                android:text="Custom SeekBar Android"
                android:textColor="#607D8B"
                android:textSize="15sp" />
        </LinearLayout>
    </LinearLayout>

</LinearLayout>