Side menu with some categories to choose.

Overview

Android Arsenal Yalantis Side Menu

Side menu with some categories to choose.

Check this project on dribbble.
Check this project on Behance.

God bless Ukraine!

Preview

Sample

Sample & .aar file Note

depends on Ozodrukh's animation util for CircularReveal animation for 2.3+ version

Using

First of all you have to upload animation submodule with git submodule update --init command

Or you can add gradle dependency with command :

	dependencies {
	    implementation 'com.github.yalantis:Side-Menu.Android:1.0.2'
	}

.
and command:

	repositories {
	    maven {
	        url "https://jitpack.io"
	    }
	}
	dependencies {
	    implementation 'com.github.ozodrukh:CircularReveal:(latest-release)@aar'
	}

To add gradle dependency you need to open build.gradle (in your app folder,not in a project folder) then copy and add the dependencies there in the dependencies block;


for CircularReveal module

After you have to create special overlay layout to show in behind current Circular Reveal animated view. And to add all items to menu you have to add all of them into LinearLayout

<android.support.v4.widget.DrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <io.codetail.widget.RevealFrameLayout
        android:id="@+id/conteiner_frame"
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <LinearLayout
            android:id="@+id/content_overlay"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"/>
        <LinearLayout
            android:id="@+id/content_frame"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"/>

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_height="wrap_content"
            android:layout_width="match_parent"
            android:minHeight="?attr/actionBarSize"
            android:background="?attr/colorPrimary"/>

    </io.codetail.widget.RevealFrameLayout>

    <ScrollView
        android:id="@+id/scrollView"
        android:scrollbarThumbVertical="@android:color/transparent"
        android:layout_width="80dp"
        android:layout_height="match_parent"
        android:layout_gravity="start|bottom">

        <LinearLayout
            android:id="@+id/left_drawer"
            android:orientation="vertical"
            android:layout_width="80dp"
            android:layout_height="wrap_content"
            android:divider="@android:color/transparent"
            android:dividerHeight="0dp"
            android:background="@android:color/transparent">
            <!-- Layout of Drawer -->
        </LinearLayout>
    </ScrollView>
</android.support.v4.widget.DrawerLayout>
	ViewAnimator viewAnimator = new ViewAnimator<>(ActionBarActivity.this,
									new ArrayList<Resourceble>(),
									(LinearLayout) findViewById(R.id.left_drawer), 
									contentFragment, drawerLayout);
	//to open menu you have to override ActionBarDrawerToggle method 
            @Override
            public void onDrawerSlide(View drawerView, float slideOffset) {
                super.onDrawerSlide(drawerView, slideOffset);
                if (slideOffset > 0.6 && viewAnimator.getLinearLayout().getChildCount() == 0)
                    viewAnimator.showMenuContent();
            }
			public void onDrawerClosed(View view) {
                super.onDrawerClosed(view);
                viewAnimator.getLinearLayout().removeAllViews();
                viewAnimator.getLinearLayout().invalidate();
            }

All menu items should implement Resourceble interface to get menu item name and drawable res And all fragments should implement ScreenShotable to get screenshot of a fragment

You can customize icons that u place in the menu,or add mor items. Simply by changing the list you parse to view animator .For example:

	 private List<SlideMenuItem> list = new ArrayList<>(); \\ the list of menu items
	 
	SlideMenuItem menuItem0 = new SlideMenuItem(ContentFragment.CLOSE, R.drawable.icn_close);
        list.add(menuItem0);
        SlideMenuItem menuItem = new SlideMenuItem(ContentFragment.BUILDING, R.drawable.icn_1);  \\first parameter is the id of menu item,the second is the icon resouce
        list.add(menuItem);
        SlideMenuItem menuItem2 = new SlideMenuItem(ContentFragment.BOOK, R.drawable.icn_2);
        list.add(menuItem2);
        
        viewAnimator = new ViewAnimator<>(this, list, contentFragment, drawerLayout, this);

Let us know!

We’d be really happy if you sent us links to your projects where you use our component. Just send an email to [email protected] And do let us know if you have any questions or suggestion regarding the animation.

P.S. We’re going to publish more awesomeness wrapped in code and a tutorial on how to make UI for Android (iOS) better than better. Stay tuned!

License

Copyright 2019, Yalantis

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • How to use between fragments

    How to use between fragments

    I really like this side menu library but don't have idea how to use it..can someone tell me step by step process so i could use it to navigate between different fragments.??Thanks in advance

    opened by mitab86 9
  • İmporting Problem

    İmporting Problem

    I could not import these : dependencies { compile 'com.github.yalantis:Side-Menu.Android:1.0.1' } . and command:

    repositories {
        maven {
            url "https://jitpack.io"
        }
    }
    dependencies {
        compile 'com.github.ozodrukh:CircularReveal:(latest-release)@aar'
    }
    

    Can you help me ?

    opened by HazemEngMuh 8
  • Problem with the depricated ActionBarActivity

    Problem with the depricated ActionBarActivity

    viewAnimator = new ViewAnimator<>(this, list, contentFragment, drawerLayout, this); The first Parameter must be of type "ActionBarActivity", but its depricated and not available anymore. And I cant use AppCompatActivity, cause that leads to an error

    opened by Sh4rpL1nQ 7
  • How to use in fragment

    How to use in fragment

    I have an activity which has a view pager with four fragments without tab. can u please tell me how can i use this for each of the fragments? The toolbar is contained in fragment, not in activity in my app. please help me.

    question 
    opened by Sekhtech 7
  • Can`t use more than two fragment ?

    Can`t use more than two fragment ?

    Because
    viewAnimator = new ViewAnimator<>(this, menuItemList, contentFragment, drawerLayout, this);
    so,if I replace OtherFragment,
    The screenShotable in
    findViewById(R.id.content_overlay).setBackgroundDrawable(new BitmapDrawable(getResources(), screenShotable.getBitmap()));

    The content_overlay can`t change to new fragment's Bitmap,It lead to switch animation are ugly.

    Sorry,Maybe My English is so bad = =#

    opened by Null-Ouwenjie 7
  • Couldn't Find The .aar File???

    Couldn't Find The .aar File???

    I went here and found no download button for .aar File: https://github.com/Yalantis/Side-Menu.Android/releases/

    What happened? Plz Give me the link of the library. It Will be a great help.

    opened by syedalinaqi 5
  • Different Fragment , different toolbar and menu...

    Different Fragment , different toolbar and menu...

    hey 4 fragment and 4 different side menu all in view pager (navigation Tab Bar) side menus Were defined in each fragment. now how close side menus in each fragment after fragment change.

    Piece of my code in fragment...

      View rootView = getActivity().getLayoutInflater().inflate(R.layout.fragment_homepage, container,
                false);
        setHasOptionsMenu(true);
    
        menuFragment = MenuFragment.newInstance(R.drawable.about);
        getActivity().getSupportFragmentManager().beginTransaction()
                .replace(R.id.content_frame, menuFragment)
                .commit();
        drawerLayout = (DrawerLayout) rootView.findViewById(R.id.drawer_layout);
        drawerLayout.setScrimColor(getResources().getColor(android.R.color.transparent));
    
        linearLayout = (LinearLayout) rootView.findViewById(R.id.left_drawer);
        linearLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                drawerLayout.closeDrawers();
            }
        });
    
        viewAnimator = new ViewAnimator<>((ActionBarActivity) getActivity(), list, menuFragment, drawerLayout, this);
    
        toolbar = (Toolbar) rootView.findViewById(R.id.toolbar);
        title_toolbar = (TextView) toolbar.findViewById(R.id.title_toolbar);
        ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
    
    
        ((AppCompatActivity) getActivity()).getSupportActionBar().setHomeButtonEnabled(false);
      ((AppCompatActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        ((AppCompatActivity) getActivity()).getSupportActionBar().setDisplayShowTitleEnabled(false);
    
        drawerToggle = new ActionBarDrawerToggle(
                getActivity(),                  /* host Activity */
                drawerLayout,         /* DrawerLayout object */
                toolbar,  /* nav drawer icon to replace 'Up' caret */
                R.string.hello_world,  /* "open drawer" description */
                R.string.action_Settings  /* "close drawer" description */
        ) {
    
            /** Called when a drawer has settled in a completely closed state. */
            public void onDrawerClosed(View view) {
                super.onDrawerClosed(view);
                linearLayout.removeAllViews();
                linearLayout.invalidate();
            }
    
            @Override
            public void onDrawerSlide(View drawerView, float slideOffset) {
                super.onDrawerSlide(drawerView, slideOffset);
                if (slideOffset > 0.6 && linearLayout.getChildCount() == 0)
                    viewAnimator.showMenuContent();
            }
    
            /** Called when a drawer has settled in a completely open state. */
            public void onDrawerOpened(View drawerView) {
                super.onDrawerOpened(drawerView);
    
            }
        };
        drawerLayout.setDrawerListener(drawerToggle);
    
        createMenuList();
        drawerToggle.syncState();
    
    opened by emadph 4
  • SupportAnimator class not found

    SupportAnimator class not found

    I have correctly make my import like this: import io.codetail.animation.*; But I have this error;

    "Error:(156, 9) error: cannot find symbol class SupportAnimator"

    Need help please!!!

    opened by gabriel-TheCode 3
  • Cant find R package

    Cant find R package

    Hi when I open your side-Menu the R package is not identify with android studio. import yalantis.com.sidemenu.R;

    may you create a step by step article for learning about your Side-Menu sample?

    I'm new in android programming , and this is my Email : [email protected]

    Thank you so much.

    opened by mehdinewdesign 3
  • how to create separate layouts with their own textViews & imageViews

    how to create separate layouts with their own textViews & imageViews

    Hi,

    I went through the other issues but really couldn't find my response.

    So far, I understand that onSwitch is where I handle when each icon is clicked and replaceFragment uses getSupportFragmentManager().beginTransaction().replace(R.id.content_frame, contentFragment).commit(); and eventually returns ContentFragment object.

    My question is: how do I create multiple fragments that each has its own textView & imageView elements. For instance, when BUILDING icon is clicked, it should open a dashboard view with textView and editView elements. When ABOUT is clicked, it should open a static text view.

    I've tried multiple approaches including: **adding a FrameLayout to activity_main.xml but I couldn't create another contentFragment for getSupportFragmentManager( ) so got errors. **I created a new Fragment class to extend ContentFragment but still got errors w **Created custom class to extend Fragment and implement ScreenShotable and still errors

    Any tip / guidance will be super appreciated. Thanks.

    opened by fnokeke 2
  • a problem

    a problem "Only the original thread that created a view hierarchy can touch its views"

    When listview scroll,Screenshots will collapse.Due to the takeScreenShot function perform "containerView.draw(canvas);" in the child thread.

    opened by LittleAunt 2
  • kotlin.UninitializedPropertyAccessException: lateinit property containerView has not been initialized

    kotlin.UninitializedPropertyAccessException: lateinit property containerView has not been initialized

    kotlin var bitmap = Bitmap.createBitmap(containerView.width, containerView.height, Bitmap.Config.ARGB_8888); var canvas = Canvas(bitmap) containerView.draw(canvas) bitmaps = bitmap

    opened by gibsmon 0
  • How to change animation for Right to left side menu?

    How to change animation for Right to left side menu?

    If I change navigation drawer gravity End then it is working. but animation are as per left gravity. How can I change animation also from right to left?

    opened by Nik2505 1
  • Change arrow color URGENT

    Change arrow color URGENT

    Hello, i can't find the way to change the color of the arrow animation, I need it to be white.. I would really appreciate if you could help me with this because it is for a school project and I need to deliver it in two days. So what do I do to change the color?

    Thanks a lot.

    opened by first4ever23 0
Releases(1.0.2)
Owner
Yalantis
Knowledge is power and the way to get power is by sharing knowledge. We are open source because this is a smart way to live, work and play.
Yalantis
Implementation of "Side Navigation" or "Fly-in app menu" pattern for Android (based on Google+ app)

Android SideNavigation Library Implementation of "Side Navigation" or "Fly-in app menu" pattern for Android (based on Google+ app). Description The Go

Evgeny Shishkin 319 Nov 25, 2022
Floating Action Menu for Android. Inspired by the Google Plus floating menu

android-floating-action-menu Floating Action Menu for Android. Inspired by the Google Plus floating menu. Demo Setup The simplest way to use this libr

Alessandro Crugnola 242 Nov 10, 2022
🚀 A very customizable library that allows you to present menu items (from menu resource and/or other sources) to users as a bottom sheet.

SlidingUpMenu A library that allows you to present menu items (from menu resource and/or other sources) to users as a bottom sheet. Gradle Dependency

Rasheed Sulayman 26 Jul 17, 2022
Classic Power Menu is a Power Menu Replacement for Android 11+

Classic Power Menu is a Power Menu Replacement for Android 11+, with the main aim being restoring power menu options (Device Controls & Quick Access Wallet) on Android 12.

Kieron Quinn 385 Dec 31, 2022
an animated circular menu for Android

CircularFloatingActionMenu An animated, customizable circular floating menu for Android, inspired by Path app. Getting Started Requirements API >= 15

Oğuz Bilgener 2.7k Dec 24, 2022
You can easily add awesome animated context menu to your app.

ContextMenu You can easily add awesome animated context menu to your app. Check this project on dribbble Check this project on Behance Usage: For a wo

Yalantis 3.8k Dec 28, 2022
imitate Tumblr's menu, dragging animations look like a snake

android-snake-menu imitate Tumblr's menu, dragging animations look like a snake unexpected episode I found another repository some time ago which impl

stone 586 Nov 10, 2022
A menu which can ... BOOM! - Android

BoomMenu 2.0.0 Comes Finally Approximately 8 months ago, I got an inspiration to creating something that can boom and show menu, which I named it Boom

Nightonke 5.8k Dec 27, 2022
:fire: The powerful and easiest way to implement modern material popup menu.

PowerMenu ?? The powerful and easiest way to implement modern material popup menu. PowerMenu can be fully customized and used for popup dialogs. Downl

Jaewoong Eum 1k Dec 29, 2022
** A slide-out menu implementation, which allows users to navigate between views in your app.

MenuDrawer A slide-out menu implementation, which allows users to navigate between views in your app. Most commonly the menu is revealed by either dra

Simon Vig Therkildsen 2.6k Dec 8, 2022
Android Satellite Menu

#Satellite Menu 'Path' has a very attractive menu sitting on the left bottom corner of the screen. Satellite Menu is the open version of this menu. Fo

Siyamed SINIR 1.4k Nov 15, 2022
An android custom view which looks like the menu in Path 2.0 (for iOS).

ArcMenu & RayMenu ArcMenu An android custom view which looks like the menu in Path 2.0 (for iOS). RayMenu About The user experience in Path 2.0 (for i

daCapricorn 1.3k Nov 29, 2022
Tap Bar Menu

TapBar Menu Simple library that helps creating a "Tap Bar" menu layout. Demo 1: https://youtu.be/DjY0cTWWtao Demo 2: https://youtu.be/dWuPMN6WTOY Inst

Mike 1k Jul 26, 2022
(UNMAINTAINED) An implemention of Filter Menu concept for android

FilterMenu This is a library project with a custom view that implements concept of Filter Menu(https://dribbble.com/shots/1956586-Filter-Menu) made by

Lin Zhang 824 Nov 28, 2022
Navigation menu for Android (based off Google+ app)

RibbonMenu Navigation menu for Android (based on Google+ app). Usage Menus are created in xml as normal, adding text and an icon. In the layout you wa

David Scott 487 Nov 24, 2022
Simple and easy to use circular menu widget for Android.

Deprecated This project is no longer maintained. No new issues or pull requests will be accepted. You can still use the source or fork the project to

Anup Cowkur 420 Nov 25, 2022
A multicard menu that can open and close with animation on android

MultiCardMenu A multicard menu that can open and close with animation on android,require API level >= 11 Demo ##Usage <net.wujingchao.android.view.

null 562 Nov 10, 2022
Menu with items on a rotating circle

Circle Menu This is a simple implementation of a circle menu for Android applications. Deprecated ConstraintLayout 1.1.0 is now supporting circular po

Csaba Szugyiczki 296 Nov 10, 2022
CustomMenu quickly realize about the menu

CustomMenu is a custom control that can help you quickly create Menu Features: Only the left menu Only the right menu Together with the right and left

ToviZhao 351 Nov 29, 2022