Implementation of "Side Navigation" or "Fly-in app menu" pattern for Android (based on Google+ app)

Related tags

Menu SideNavigation
Overview

Android SideNavigation Library

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

Description

The Google+ app slides the navigation on top of the UI while the others move the UI to the side. Google+ also has the up caret icon and the action bar present when the menu is opened while other apps don't.

There was a interesting discussion about this pattern in the blog's Google+ page some time ago. You can find the post & discussion here: Google+.

Sample

A sample application is available on Google Play:

Get it on Google Play

Example Image Example Image

The source code is available in this repository.

Compatibility

This library is compatible from API 4 (Android 1.6).

Installation

The sample project requires:

Usage

SideNavigation is presented as an Android library project. You can include this project by referencing it as a library project in Eclipse or ant.

To display the item you need the following code:

  • Add SideNavigationView to the end of the layout. Example:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <ImageView
        android:id="@android:id/icon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:src="@drawable/ic_android_logo" />

    <com.devspark.sidenavigation.SideNavigationView
        android:id="@+id/side_navigation_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</RelativeLayout>
  • Create '.xml' description of the menu for the sideNavigationView. Example:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >

    <item
        android:id="@+id/side_navigation_menu_item1"
        android:icon="@drawable/ic_android1"
        android:title="@string/title1"/>
    <item
        android:id="@+id/side_navigation_menu_item2"
        android:icon="@drawable/ic_android2"
        android:title="@string/title2"/>
    <item
        android:id="@+id/side_navigation_menu_item3"
        android:icon="@drawable/ic_android3"
        android:title="@string/title3"/>
    <item
        android:id="@+id/side_navigation_menu_item4"
        android:icon="@drawable/ic_android4"
        android:title="@string/title4"/>
    <item
        android:id="@+id/side_navigation_menu_item5"
        android:icon="@drawable/ic_android5"
        android:title="@string/title5"/>

</menu>
  • Set home should be displayed as an "up" and initialize the sideNavigationView:
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_main);
    // other code
    
    sideNavigationView = (SideNavigationView) findViewById(R.id.side_navigation_view);
    sideNavigationView.setMenuItems(R.menu.side_navigation_menu);
	sideNavigationView.setMenuClickCallback(/*ISideNavigationCallback*/);
	sideNavigationView.setMode(/*SideNavigationView.Mode*/);
        
    getActionBar().setDisplayHomeAsUpEnabled(true);
}
  • Override onOptionsItemSelected() method for show/hide teh sideNavigationView:
@Override
public boolean onOptionsItemSelected(MenuItem item) {
	switch (item.getItemId()) {
	case android.R.id.home:
		sideNavigationView.toggleMenu();
		break;
	default:
		return super.onOptionsItemSelected(item);
	}
	return true;
}
  • Implementation of ISideNavigationCallback:
ISideNavigationCallback sideNavigationCallback = new ISideNavigationCallback() {
    	
	@Override
	public void onSideNavigationItemClick(int itemId) {
		// Validation clicking on side navigation item
	}
};

Contribution

Please fork dev repository and contribute back using pull requests.

Contributors are recommended to follow the Android Code Style Guidelines.

Any contributions, large or small, major features, bug fixes, additional language translations, unit/integration tests are welcomed and appreciated but will be thoroughly reviewed and discussed.

Developed By

License

Copyright (C) 2012 Evgeny Shishkin

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
  • Using ListView the slidemenu is not showing

    Using ListView the slidemenu is not showing

    I'm using this library and ABS. I have a SherlockListActivity amd when I call sideNavigationView.toggleMenu(); the slidemenu is not showing.

    I remove the listView and the slidemenu is showing

    opened by benoffi7 6
  • How to use this librery??

    How to use this librery??

    Hi, I am a rookie in Android development. Can you please help me with importing this library with my current Android project. I have downloaded a zip file from github but I don't see any .jar file. I have previously imported .jar libraries into my Android projects. But this one looks different.

    Suggestion: The documentation should provide clear steps to import this library in android project.

    Regards, Aakash

    opened by rayate2410 2
  • Help with custom menu...toggle?

    Help with custom menu...toggle?

    I'm trying to customize the side menu with toggle switches. Do you have any recommendations on achieving this? I haven't had success on changing the menu.

    opened by jko-github 1
  • Enhancement advice

    Enhancement advice

    I recommend to look through the following articles. It can dramatically improve your project.

    • http://android.cyrilmottier.com/?p=658
    • http://android.cyrilmottier.com/?p=701
    • http://android.cyrilmottier.com/?p=717
    opened by gorgon 1
  • on frist opening Navigate

    on frist opening Navigate

    Hi i used this library on my app when user firstly click for open LTR SlideNavigation its took sevral second (about 4 or 5 second) to open it ? how can fix it

    opened by jriporter 0
  • Implement of SideNavigation visibility callbacks

    Implement of SideNavigation visibility callbacks

    How can I stop my activity, when Side Navigation terminated (hide) was? with finish () ... I just need to know how do I check whether Sidenavigation has just ended.

    opened by johnkil 0
Releases(1.2.1)
Owner
Evgeny Shishkin
Senior Android Developer
Evgeny Shishkin
Bottom Navigation widget component inspired by the Google Material Design Guidelines at https://www.google.com/design/spec/components/bottom-navigation.html

Material Bottom Navigation Library Lightweight Bottom Navigation library component inspired by the Google Material Design Guidelines at https://www.go

Alessandro Crugnola 1.4k Dec 18, 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
** 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
A powerful & customizable menu implementation for android.

A powerful & customizable menu implementation for android. It supports any level of nested menu structures along with custom header and footer views, and much more. Follow the steps below to import the library to your project. You will also find some sample codes.

Nowrose Muhammad Ragib 5 Nov 8, 2022
Space Navigation is a library allowing easily integrate fully customizable Google Spaces like navigation to your app.

Space-Navigation-View Introduction Space Navigation is a library allowing easily integrate fully customizable Google [Spaces][1] like navigation to yo

Arman 2k Dec 23, 2022
Android library that provides the floating action button to sheet transition from Google's Material Design.

MaterialSheetFab Library that implements the floating action button to sheet transition from Google's Material Design documentation. It can be used wi

Gordon Wong 1.6k Dec 13, 2022
Android Library for a DrawerLayout similar to the one in Google Apps

GoogleNavigationDrawerMenu This project aims to let you use a ListView menu similar to the one in the new Google Apps (Keep, Play Music...) without ha

Jorge Martin Espinosa 267 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
BottomNavigationView Designed according Google guideLine

Material Bottom Navigation DEPRECATED Use offical Bottom Navigation BottomNavigationView Designed according Google [guideLine][1] [1]: https://www.goo

Arman 1k Oct 18, 2022
DropDownMenu for Android,Filter the list based on multiple condition.

DropDownMenu DropDownMenu for Android,filter the list based on multiple condition. To get this project into your build Step 1. Add the specific reposi

Jay.Fang 808 Nov 10, 2022
Bike-share - Jetpack Compose and SwiftUI based Kotlin Multiplatform sample project

BikeShare Jetpack Compose and SwiftUI based Kotlin Multiplatform sample project

Andrew Steinmetz 1 Feb 15, 2022
СontextMenu library based on BottomSheetDialog written in Kotlin.

KtxMenu Description СontextMenu library based on BottomSheetDialog written in Kotlin. Example ?? Installation Add the JitPack repository to your build

nprk 1 Apr 28, 2022
An Android library that allows you to easily create applications with slide-in menus. You may use it in your Android apps provided that you cite this project and include the license in your app. Thanks!

SlidingMenu (Play Store Demo) SlidingMenu is an Open Source Android library that allows developers to easily create applications with sliding menus li

Jeremy Feinstein 11.1k Dec 21, 2022
Android-NewPopupMenu 3.9 0.0 Java is an android library to create popup menu with GoogleMusic app-like style.

Android-NewPopupMenu Android-NewPopupMenu is an android library to create popup menu with GoogleMusic app-like style. Requirements Tested with APIv4 H

u1aryz 159 Nov 21, 2022
Android - Blur Navigation Drawer like Etsy app.

Blur Navigation Drawer Library[DEPRECATED] Blur Navigation Drawer like Etsy app. Demo You can download a demo here. Updates Version 1.1 Add support fo

Vasilis Charalampakis 414 Nov 23, 2022
BottomSheet-Android - A simple customizable BottomSheet Library for Android Kotlin

BottomSheet-Android A simple customizable BottomSheet Library for Android Kotlin

Munachimso Ugorji 0 Jan 3, 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
A new way to implement navigation in your app 🏎

ExpandableBottomBar A new way to improve navigation in your app Its really easy integrate to your project take it, faster, faster Important: library w

Alexander Dadukin 692 Dec 29, 2022
An app that helps you create & remove WSA icon in the start menu

WSA Helper An application that allows you to manager WSA's icons in start menus

LSPosed 142 Dec 24, 2022