Skip to content

laewoong/MenuArrowAnimation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MenuArrowAnimation

Menu/Arrow Animation using Canvas api in android. You can see the original design by Apostol Voicu.

See How to implement this in my blog

How to use

If you want use this library, you only add the project as a library in your android project settings.

Step 1. Add the JitPack repository to your build file

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 {
    implementation 'com.github.laewoong:MenuArrowAnimation:1.0.2'
}

This components have custom attributes, if you want use them, you must add this line in your xml file in the first component:

<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"
    ...
    >
</RelativeLayout>

You can set two attributes: strokeWidth, strokeColor.

<com.laewoong.menuarrowanimation.MenuArrowAnimationButton
	android:layout_width="80dp"
	android:layout_height="40dp"
	app:layout_constraintBottom_toBottomOf="parent"
	app:layout_constraintLeft_toLeftOf="parent"
	app:layout_constraintRight_toRightOf="parent"
	app:layout_constraintTop_toTopOf="parent"
	app:strokeWidth="20"
	app:strokeColor="#d7e4f0"/>

You can check button status using isArrowStatus() method.

btn = (MenuArrowAnimationButton)findViewById(R.id.btn);
btn.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {

	Log.i("fff", "OnClicked!!!! : " + btn.isArrowStatus());
    }
});

Demo

Check the video in youtube

About

Menu/Arrow Animation by Apostol Voicu in android

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages