Neat library, that provides a simple way to implement guillotine-styled animation

Overview

Guillotine animation

Neat library, that provides a simple way to implement guillotine-styled animation

Yalantis

Android Arsenal

Android Gems

Check this [project on Dribbble] (https://dribbble.com/shots/2018249-Guillotine-Menu)

Also, read how it was done in [our blog] (https://yalantis.com/blog/how-we-developed-the-guillotine-menu-animation-for-android/?utm_source=github)

Guillotine animation gif

Usage

For a working implementation, have a look at the app module

  1. Add JitPack repository in your root build.gradle at the end of repositories:

    allprojects {
        repositories {
            ...
            maven { url "https://jitpack.io" }
        }
    }
    
    
  2. Add the dependency to your app build.gradle

    dependencies {
        compile 'com.github.Yalantis:GuillotineMenu-Android:1.2'
    }
    
  3. You need to create a layout for the navigation menu (guillotine.xml in sample app), which will later open and close guillotine-style. The only tricky part here is that the navigation layout should be on top of any other content and will disappear after closing animation ends. That is why content layout (activity.xml in sample app) should also have hamburger icon at the same coordinates as navigation menu has.

  4. After that all you need to do is to build animation by passing navigation layout object, navigation and content layout hamburger objects to GuillotineAnimation.GuillotineBuilder in your onCreate method

    new GuillotineAnimation.GuillotineBuilder(guillotineMenu, guillotineMenu.findViewById(R.id.guillotine_hamburger), contentHamburger)
                .setActionBarViewForAnimation(toolbar)
                .build();

Here setActionBarViewForAnimation method enables bounce effect of Toolbar at the end of the guillotine closing animation.

Misc

Builder allows you to customize start delay, duration, interpolation and you can set listener if you want to do staff at the moment when menu has been opened or closed.

Compatibility

  • Android 4.0.3 Ice Cream Sandwich (API level 15)

Changelog

Version: 1.0

  • Initial Build

Version: 1.2

  • Moved to using Toolbar instead of ActionBar
  • Updated Gradle versions
  • Fixed bugs

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 2017, 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
  • Problem with open angel

    Problem with open angel

    There seems to be a problem with the Open angel of the menu. I can see a bit from the main view from the right of the screen. So its like over opened.

    Issue 2 :

    if i use setClosedOnStart() to true, the hamburger button animation doesn't work

    opened by moali2402 6
  • Menu crashed on 4.2.2

    Menu crashed on 4.2.2

    i used this menu in my application . this is so good and good looking in UI . But the problem occurs on 4.2.2 . when i tried to run app on 4.2.2 the menu crashed . if you have a solution to this problem kindly reply .

    opened by ZaeemSattar 3
  • guillotine activity

    guillotine activity

    Hi, I'm implementing your beautiful menu is a way that the guillotine layout will be full of interactions, and they don't seem to react at all, I've create a GuillotineActivity.java for it, and can't change simple things like the backgroundColor programmatically, how do I do it ? Thanks

    opened by curliq 3
  • Beautiful but not convenient.

    Beautiful but not convenient.

    I like it! It was beautiful. But I think it was not convenient cause I must click the menu icon.

    I think it will be better that you rotate the drawer 90 degrees in clockwise direction and add sliding gesture like Navigating Drawer.

    opened by HanderWei 3
  • java.lang.ClassNotFoundException: Didn't find class

    java.lang.ClassNotFoundException: Didn't find class

    Hi, when I download the example of guillotineMenu and I use it in android studio all works fine, but when I make copy/paste of that code (including dependiencies) this happens: image

    and I try with code made by me but give me the same error. What I can do? :(

    opened by sebospc 2
  • import butterknife.BindView; import butterknife.ButterKnife;

    import butterknife.BindView; import butterknife.ButterKnife;

    at start when we initialize have @BindView error. @BindView(R.id.toolbar) @BindView(R.id.root) FrameLayout root; @BindView(R.id.content_hamburger)

    and in override method ButterKnife.bind(this);

    opened by ZoyaEman 2
  • I still can click a button beneath guillotine menu

    I still can click a button beneath guillotine menu

    so I used this guillotine menu library in my project, but I have an issue I have a recyclerview and when I click it, it will go to another activity... so when I open guillotine menu, I can click my recyclerview which is beneath guillotine menu on empty space in guillotine menu

    is there any solution on this?

    opened by meeftah 2
  •  Attempt to invoke virtual method - addView

    Attempt to invoke virtual method - addView

    Hello,

    I have copy this to my APP. But i have this error : Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.FrameLayout.addView(android.view.View)' on a null object reference at com.yalantis.guillotine.sample.activity.MainActivity.onCreate(MainActivity.java:43)

    Do you know why i have this error ?

    Thanks

    opened by Jhduou 2
  • Animation not smooth in RecycleView

    Animation not smooth in RecycleView

    I am inflating a layout for Guillotinemenu which contain a recycleview with gridlayout which contatin an image and text so when i click on menu button it open menu with not smooth animation...its stuck in between for few milliseconds and than open the menu..while in simple textview with drawble in your example work smoothly

    opened by burhanrashid52 2
  • Failed to resolve

    Failed to resolve

    hi , i have an issue loading this project on android studio when i load this project my android studio shows this error : Failed to resolve: com.jakewharton:butterknife:6.1.0 is it because my sdk is not upgraded? what can i do to fix this error ?

    opened by mehdi-moslehi 2
  • GuillotineMenu doesn't display

    GuillotineMenu doesn't display

    I have a question and i implement a view where only was the toolbar with the GuillotineMenu animation. Works fine...but..i also put a recyclerView under this toolbar and the guillotine menu does not display in my view. I have make no changes so i don't know if there is any problem with other views (recyclerView) or something like that.

    Hope someone can help me. Thanks!

    opened by smoralb 1
  • Update project

    Update project

    • Update gradle version
    • Fix gradle issues
    • Update compileSdkVersion
    • Update targetSdkVersion
    • Update buildToolsVersion
    • Migrate to AndroidX
    • Migrate Butterknife to ViewBinding
    opened by dmytro1morozov 1
  • clone issue

    clone issue

    I am faceing this issue in when i had updtae project gradle 2.2.1 to 3.1.3 Cannot choose between the following configurations of project :library:

    • debugApiElements
    • debugRuntimeElements
    • releaseApiElements
    • releaseRuntimeElements All of them match the consumer attributes:
    • Configuration 'debugApiElements':
      • Found com.android.build.api.attributes.BuildTypeAttr 'debug' but wasn't required.
      • Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
      • Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
      • Found org.gradle.usage 'java-api' but wasn't required.
    • Configuration 'debugRuntimeElements':
      • Found com.android.build.api.attributes.BuildTypeAttr 'debug' but wasn't required.
      • Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
      • Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
      • Found org.gradle.usage 'java-runtime' but wasn't required.
    • Configuration 'releaseApiElements':
      • Found com.android.build.api.attributes.BuildTypeAttr 'release' but wasn't required.
      • Found com.android.build.api.attributes.VariantAttr 'release' but wasn't required.
      • Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
      • Found org.gradle.usage 'java-api' but wasn't required.
    • Configuration 'releaseRuntimeElements':
      • Found com.android.build.api.attributes.BuildTypeAttr 'release' but wasn't required.
      • Found com.android.build.api.attributes.VariantAttr 'release' but wasn't required.
      • Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
      • Found org.gradle.usage 'java-runtime' but wasn't required.
    opened by milanPansuriya 0
  • Provide generic Interpolator

    Provide generic Interpolator

    First of all, nice library and great animation. However, I think the interpolators at the moment is created based on some pre-calculated constants. For example, in ActionBarInterpolator:

       private static final float FIRST_BOUNCE_PART = 0.375f;
       private static final float SECOND_BOUNCE_PART = 0.625f;
       @Override
       public float getInterpolation(float t) {
           if (t < FIRST_BOUNCE_PART) {
               return (-28.4444f) * t * t + 10.66667f * t;
           } else if (t < SECOND_BOUNCE_PART) {
               return (21.33312f) * t * t - 21.33312f * t + 4.999950f;
           } else {
               return (-9.481481f) * t * t + 15.40741f * t - 5.925926f;
           }
       }
    

    The constants used in getInterpolation (e.g., -28.4444f) are pre-calculated based on the values of FIRST_BOUNCE_PART and SECOND_BOUNCE_PART. If either or both of these values are changed, the constant values need to be recalculated.

    This limit users of this library from changing the value of FIRST_BOUNCE_PART and/or SECOND_BOUNCE_PART to whatever they want because if they change these values, they have to do their own math to work out formulas for the interpolators.

    So I think it would be nicer to provide generic formulas for interpolators with perhaps FIRST_BOUNCE_PART and SECOND_BOUNCE_PART are variables to avoid users being worrying about the formulas themselves.

    What do you think?

    opened by huan-nguyen 0
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
: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
Kai Liao 2.2k Jan 3, 2023
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
Suhuf is an android library that is used to build bottom sheets in an elegant way.

Suhuf is an android library that is used to build bottom sheets in an elegant way.

Rahmat Rasyidi Hakim 10 Nov 15, 2021
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
Simple library which enable you to add a drawer(slide-out) navigation to your android application

SimpleSideDrawer is an android library to add a drawer navigation into your android application. This library has high affinity with other libraries l

null 217 Nov 25, 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
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 simple Floating Action Button that shows an anchored Navigation View

Floating Navigation View A simple Floating Action Button that shows an anchored Navigation View and was inspired by Menu Material Fixed created by Tom

André Mion 1.3k Dec 29, 2022
FMenu: A simple plugin that permits to open a menu by swapping the item to the secondary hand

FutureTeam - FMenu FMenu is a simple plugin that permits to open a menu by swapp

FutureTeam 1 Feb 16, 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 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
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
An Android Library that allows users to pull down a menu and select different actions. It can be implemented inside ScrollView, GridView, ListView.

AndroidPullMenu AndroidPullMenu is an Open Source Android library that allows developers to easily create applications with pull menu. The aim of this

Armando TBA 181 Nov 29, 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
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
An Android library for managing multiple stacks of fragments

FragNav Android library for managing multiple stacks of fragments (e.g., Bottom Navigation , Navigation Drawer). This library does NOT include the UI

Nic Capdevila 1.5k Dec 26, 2022
A floating menu library for Android.

Hover Hover is a floating menu implementation for Android. Goals The goals of Hover are to: Provide an easy-to-use, out-of-the-box floating menu imple

Google 2.7k Dec 27, 2022