🌟 Enhance your user interfaces with dynamic morphing button animations in just a few lines of code.
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'
}
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)
}
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)!!