Animating Sidebar Android

You can see that cool sidebar animations in your Android contact app with animating sidebar features and if you also want to implement that cool feature in your application then you’re at right place.

In this animation library  a SiderBar base on Android that has a wave animation. Lets dive in implementation of this library.

You can download Animating Sidebar Android project and run the demo.

Demo : Animating Sidebar Android
Demo : Animating Sidebar Android

To use,you should write like this in your layout

<com.allenliu.sidebar.SideBar
android:layout_alignParentRight="true"
android:textColor="@color/colorAccent"
android:textSize="15sp"
android:paddingRight="10dp"
sidebar:scaleTime="1"
android:layout_width="200dp"
android:id="@+id/bar"
android:layout_height="match_parent" />

After this ,you can add a setOnStrSelectCallBack,like this

bar.setOnStrSelectCallBack(new ISideBarSelectCallBack() {
        @Override
        public void onSelectStr(int index, String selectStr) {
            Toast.makeText(SideBarDemoActivity.this,selectStr,Toast.LENGTH_SHORT).show();
        }
    });

There are some other methods to apply:

setDataResource(String[] data)
setScaleTime(int scale)
setScaleItemCount(int scaleItemCount)

Hope you like this article. Please comment us with your suggestions.

By Tell Me How

It is a technology blog and admin has excellent experience in programming from 5+ year. You can contact us at ceo.tellmehow@gmail.com

Share your thoughts

Leave a Reply

Loading Facebook Comments ...
Loading Disqus Comments ...