Skip to content
play button animate to pause and stop button
Branch: master
Clone or download
SwiftyWang
SwiftyWang Update README.md
Latest commit 18560de Oct 15, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
animateplaybutton bump to 1.4 Oct 15, 2018
app add prefix for attributes. Oct 15, 2018
demo upload demo gif Feb 8, 2018
gradle/wrapper
.gitignore first commit Feb 7, 2018
README.md Update README.md Oct 15, 2018
build.gradle first commit Feb 7, 2018
gradle.properties first commit Feb 7, 2018
gradlew first commit Feb 7, 2018
gradlew.bat first commit Feb 7, 2018
settings.gradle first commit Feb 7, 2018

README.md

AnimatePlayButton

play button animate to pause and stop button

Demo GIF

Import

Add it in your root build.gradle at the end of repositories:

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

Step 2. Add the dependency

    dependencies {
        compile 'com.github.SwiftyWang:AnimatePlayButton:1.4'
	}

How to use

Use it in xml

    <com.swifty.animateplaybutton.AnimatePlayButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:ap_animation_duration="250"
        app:ap_border_color="@color/colorPrimary"
        app:ap_button_background="@drawable/circle_primary_bg"
        app:ap_button_color="@android:color/black"
        app:ap_button_size="60dp"/>

Add click listener in Java/Kotlin

        animatePlayButton.setPlayListener(object : AnimatePlayButton.OnButtonsListener {
            override fun onPlayClick(playButton: View): Boolean {
                return true
            }

            override fun onPauseClick(pause: View): Boolean {
                return true
            }

            override fun onResumeClick(pause: View): Boolean {
                return true
            }

            override fun onStopClick(stop: View): Boolean {
                return true
            }
        })

Reference

xml attribute description default value
ap_animation_duration the transform animation duration 300(300ms)
ap_border_color the outside border color @android:color/holo_blue_bright
ap_button_background the button's background(need shape drawable) @drawable/circle_button_bg
ap_button_color the button's icon color @android:color/white
ap_button_size the button's size 42dp
You can’t perform that action at this time.