Skip to content

AndroidBase/Side-Menu.Android

Repository files navigation

Android Arsenal Side Menu

Side menu with some categories to choose. Made in Yalantis.
Check this project on dribbble.
Check this project on Behance.

God bless Ukraine!

Sample

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 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"> <LinearLayoutandroid:id="@+id/content_overlay"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"/> <LinearLayoutandroid: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> <ScrollViewandroid:id="@+id/scrollView"android:scrollbarThumbVertical="@android:color/transparent"android:layout_width="80dp"android:layout_height="match_parent"android:layout_gravity="start|bottom"> <LinearLayoutandroid: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>
ViewAnimatorviewAnimator = newViewAnimator<>(ActionBarActivity.this, newArrayList<Resourceble>(), (LinearLayout) findViewById(R.id.left_drawer), contentFragment, drawerLayout); //to open menu you have to override ActionBarDrawerToggle method @OverridepublicvoidonDrawerSlide(ViewdrawerView, floatslideOffset){super.onDrawerSlide(drawerView, slideOffset); if (slideOffset > 0.6 && viewAnimator.getLinearLayout().getChildCount() == 0) viewAnimator.showMenuContent()} publicvoidonDrawerClosed(Viewview){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

License

Copyright 2015, 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. 

Packages

No packages published

Languages

  • Java100.0%