Skip to content

Enhance your user interfaces with dynamic morphing button animations in just a few lines of code.

Notifications You must be signed in to change notification settings

khan-mujeeb/Button-Morphing-Animation

Repository files navigation

Button-Morphing-Animation

🌟 Enhance your user interfaces with dynamic morphing button animations in just a few lines of code.

Including in your project

Step 1. Add the JitPack repository to your root build.gradle at the end of repositories

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

Step 2. Add the dependency below to your module's build.gradle file

dependencies {
	        implementation 'com.github.khan-mujeeb:Button-Morphing-Animation:1.0.2'
	}

Usage

Step 1. Add the following code to your xml layout

<com.example.button_morphing.customview.MorphButton
        android:layout_width="180dp"
        android:layout_height="50dp"
        android:id="@+id/btn2" />

Step 2. Add this code to your respective kt file

binding.btn2.text = "Let's get Started"

        binding.btn2.setOnClickListener {
            binding.btn2. setUIState(MorphButton.UIState.Loading)
        }

Customizations

        binding.btn.toBgColor = getColor(R.color.sea_green)
        binding.btn.fromBgColor = getColor(R.color.white)
        binding.btn.toTextColor = getColor(R.color.white)
        binding.btn.fromTextColor = getColor(R.color.black)
        binding.btn.iconDrawable = getDrawable(R.drawable.browser_new)!!

About

Enhance your user interfaces with dynamic morphing button animations in just a few lines of code.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages