Giter Site home page Giter Site logo

flowingdrawer's Introduction

FlowingDrawer

Android Arsenal travis-ic

Showcase

swipe right to display drawer with flowing effects.

Download

Include the following dependency in your build.gradle file.

Gradle:

    repositories {
        jcenter()
    }

    dependencies {
        implementation 'com.mxn.soul:flowingdrawer-core:2.1.0'
        implementation 'com.nineoldandroids:library:2.4.0'
    }

V2.0.0 Features

  • The menu can be positioned along two edges:left and right .
  • Allows the drawer to be opened by dragging the edge or the entire screen.

Usage

For a working implementation of this project see the app/ folder and check out the sample app

activity_main.xml:

    <com.mxn.soul.flowingdrawer_core.FlowingDrawer
            xmlns:app="http://schemas.android.com/apk/res-auto"
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/drawerlayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:clipChildren="false"
            android:clipToPadding="false"
            app:edPosition="1"
            app:edMenuSize="260dp"
            app:edMenuBackground="#dddddd">

        <!--content-->
        <RelativeLayout
                android:id="@+id/content"
                android:layout_width="match_parent"
                android:layout_height="match_parent"/>

        <!--menu-->
        <com.mxn.soul.flowingdrawer_core.FlowingMenuLayout
                android:id="@+id/menulayout"
                android:layout_width="match_parent"
                android:layout_height="match_parent">

            <FrameLayout
                    android:id="@+id/id_container_menu"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"/>

        </com.mxn.soul.flowingdrawer_core.FlowingMenuLayout>

    </com.mxn.soul.flowingdrawer_core.FlowingDrawer>

To use a FlowingDrawer, position FlowingDrawer as the root , position your primary content view as the first child with width and height of match_parent . Add FlowingMenuLayout as child views after the main content view . FlowingMenuLayout commonly use match_parent for height and width.

Don't set any background on FlowingMenuLayout or FlowingMenuLayout's children, it means their background should be transparent.

Don't set FlowingMenuLayout's width with a fixed width, it's not a useful way to change it's width .

You can change menu's attribute in FlowingDrawer layout node use custom attribute,like edMenuBackground,edMenuSize, edPosition.

Use edPosition attribute corresponding to which side of the view you want the drawer to emerge from: left or right.Left menu : edPosition =1 ; Right menu: edPosition =2 .

For more custom attribute ,you can see in attrs.xml.

MainActivity:

     mDrawer = (FlowingDrawer) findViewById(R.id.drawerlayout);
     mDrawer.setTouchMode(ElasticDrawer.TOUCH_MODE_BEZEL);
     mDrawer.setOnDrawerStateChangeListener(new ElasticDrawer.OnDrawerStateChangeListener() {
                 @Override
                 public void onDrawerStateChange(int oldState, int newState) {
                     if (newState == ElasticDrawer.STATE_CLOSED) {
                         Log.i("MainActivity", "Drawer STATE_CLOSED");
                     }
                 }

                 @Override
                 public void onDrawerSlide(float openRatio, int offsetPixels) {
                     Log.i("MainActivity", "openRatio=" + openRatio + " ,offsetPixels=" + offsetPixels);
                 }
             });

setTouchMode can allows the drawer to be opened by dragging the edge or the entire screen. setOnDrawerStateChangeListener can be used to monitor the state and motion of drawer views. Avoid performing expensive operations such as layout during animation as it can cause stuttering. ElasticDrawer.OnDrawerStateChangeListener offers default/no-op implementations of each callback method.

License

Copyright 2015 soul.mxn

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.

flowingdrawer's People

Contributors

ardacebi avatar hery84 avatar mxn21 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flowingdrawer's Issues

duplicate entry exception while using with multidexenable true

I am adding google login in my app and also using floating drawer but when I am using multidexenable true due to google-play-services library then its gives me error.

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/mxn/soul/flowingdrawer_core/BuildConfig.class

My gradle file is-
apply plugin: 'com.android.application'

android {

compileSdkVersion 25
buildToolsVersion "26.0.0"
defaultConfig {
    applicationId "XXXX"
    minSdkVersion 18
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
   multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
configurations.all {
    resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}

}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile project(':flowingdrawer-core')
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.google.android.gms:play-services-location:10.2.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.synnapps:carouselview:0.1.4'
compile 'com.azoft.carousellayoutmanager:carousel:1.2.1'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'org.apache.httpcomponents:httpcore:4.4.1'
compile 'org.apache.httpcomponents:httpclient:4.5'
compile 'com.mxn.soul:flowingdrawer-core:2.0.0'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.squareup.picasso:picasso:2.5.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.github.apl-devs:appintro:v4.2.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.google.android.gms:play-services-auth:10.2.0'
compile 'com.google.api-client:google-api-client:1.22.0'
compile 'com.google.api-client:google-api-client-android:1.22.0'
compile 'com.google.apis:google-api-services-people:v1-rev4-1.22.0'
compile 'com.android.support:multidex:1.0.0'
testCompile 'junit:junit:4.12'
}
android {
useLibrary 'org.apache.http.legacy'

}
apply plugin: 'com.google.gms.google-services'

Hope for solution ASAP.

shadow screen activity when open

how set shadow or dark fade for this when navigat is opened

navigationDrawer.setDrawerShadow(R.drawable.someDrawable, GravityCompat.START);

not work for this what im doing

can you add on touch outside method?

Hi, It would be a great thing if you add on touch outside method to detect if the drawer is open and the touch is outside the view of the drawer,,

How can I make the drawer overlap the title bar ?

Hi,

I wonder how can I make the drawer to fit all the screen height so it overlaps the title bar and also the status bar.

This is how it looks now: drawer

I want the drawer to be all the way up overlapping the title bar.

Thanks.

[Bug] Child elements do not inherit the bounce effect

Hi,

I think this is a bug.
So when the bouncing effect occurs the child elements do not act accordingly.

Please check the images: http://imgur.com/a/oKY5L

On the bounce effect the blue square does not bounce too.

Also when opening the FlowingDrawer you can see the margin line is not smooth and has some outlines from the parent.

Do you think you can fix this ?

Ripple effect not showing

I imported this library using gradle, added its view as shown in sample. but the ripple effect from menu is gone. in sample app its working,but i am implementing the same it is not. Is there any thing i am missing?

hi

can I change the background color?

Overlay

No overlay on fragment found when FlowingDrawer opened

NavigationDraweItemSelected

I want create method onNavigationItemSelected but i don't know make it where and how ?
Please help me
Sorry, my english is not good

java.lang.IndexOutOfBoundsException: Inconsistency detected.

This is the first time this lib crashed after using it for about a year, and it crashed in production 😖.
And i have no idea how to reproduce it since a user reported it to developer console.
It's Android 7.0 and the device is Galaxy S7 Edge.
Here's the stacktrace:

java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionViewHolder{43272cb position=2 id=-1, oldPos=1, pLpos:1 scrap [attachedScrap] tmpDetached not recyclable(1) no parent}
	at android.support.v7.widget.RecyclerView$Recycler.validateViewHolderForOffsetPosition(Unknown Source)
	at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(Unknown Source)
	at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(Unknown Source)
	at android.support.v7.widget.LinearLayoutManager$LayoutState.next(Unknown Source)
	at android.support.v7.widget.LinearLayoutManager.layoutChunk(Unknown Source)
	at android.support.v7.widget.LinearLayoutManager.fill(Unknown Source)
	at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(Unknown Source)
	at android.support.v7.widget.RecyclerView.dispatchLayoutStep1(Unknown Source)
	at android.support.v7.widget.RecyclerView.dispatchLayout(Unknown Source)
	at android.support.v7.widget.RecyclerView.onLayout(Unknown Source)
	at android.view.View.layout(View.java:18793)
	at android.view.ViewGroup.layout(ViewGroup.java:5952)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
	at android.view.View.layout(View.java:18793)
	at android.view.ViewGroup.layout(ViewGroup.java:5952)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
	at android.view.View.layout(View.java:18793)
	at android.view.ViewGroup.layout(ViewGroup.java:5952)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
	at android.view.View.layout(View.java:18793)
	at android.view.ViewGroup.layout(ViewGroup.java:5952)
	at com.mxn.soul.flowingdrawer_core.FlowingDrawer.onLayout(Unknown Source)
	at android.view.View.layout(View.java:18793)
	at android.view.ViewGroup.layout(ViewGroup.java:5952)
	at android.support.design.widget.CoordinatorLayout.layoutChild(Unknown Source)
	at android.support.design.widget.CoordinatorLayout.onLayoutChild(Unknown Source)
	at android.support.design.widget.CoordinatorLayout.onLayout(Unknown Source)
	at android.view.View.layout(View.java:18793)
	at android.view.ViewGroup.layout(ViewGroup.java:5952)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
	at android.view.View.layout(View.java:18793)
	at android.view.ViewGroup.layout(ViewGroup.java:5952)
	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741)
	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
	at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
	at android.view.View.layout(View.java:18793)
	at android.view.ViewGroup.layout(ViewGroup.java:5952)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
	at android.view.View.layout(View.java:18793)
	at android.view.ViewGroup.layout(ViewGroup.java:5952)
	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741)
	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
	at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
	at android.view.View.layout(View.java:18793)
	at android.view.ViewGroup.layout(ViewGroup.java:5952)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
	at com.android.internal.policy.DecorView.onLayout(DecorView.java:818)
	at android.view.View.layout(View.java:18793)
	at android.view.ViewGroup.layout(ViewGroup.java:5952)
	at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2615)
	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2331)
	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1490)
	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7027)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:927)
	at android.view.Choreographer.doCallbacks(Choreographer.java:702)
	at android.view.Choreographer.doFrame(Choreographer.java:638)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913)
	at android.os.Handler.handleCallback(Handler.java:751)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:154)
	at android.app.ActivityThread.main(ActivityThread.java:6688)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)

bottom drawer

Can this be used from bottom slide up with same flowing effect...instead of sliding it from left to right ?

Drawer Issue

error

Please check the attached screen shot. There is white line at the right side left after drawer is opened. This line is random in shape and size and depends on at which speed you are opening the drawer.

Device : LG L7

RecyclerView Scrolling is not working when using FlowingDrawer

<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" tools:context="in.ghm.pulsedemo.Activity.EtaActivity">

<android.support.design.widget.AppBarLayout
    android:id="@+id/app_bar"
    android:layout_width="match_parent"
    android:layout_height="@dimen/app_bar_height"
    android:fitsSystemWindows="true"
    android:theme="@style/AppTheme.AppBarOverlay">

    <android.support.design.widget.CollapsingToolbarLayout
        android:id="@+id/toolbar_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        app:contentScrim="?attr/colorPrimary"
        app:layout_scrollFlags="scroll|exitUntilCollapsed">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            app:layout_collapseMode="parallax"
            app:popupTheme="@style/AppTheme.PopupOverlay" />

    </android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>

<include layout="@layout/content_main" />

<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_margin="@dimen/fab_margin"
    app:layout_anchor="@id/app_bar"
    app:layout_anchorGravity="bottom|end"
    app:srcCompat="@android:drawable/ic_dialog_email" />

<com.mxn.soul.flowingdrawer_core.FlowingDrawer
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/drawerlayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:clipChildren="false"
    android:clipToPadding="false"
    app:edPosition="1"
    app:edMenuSize="260dp"
    app:edMenuBackground="#dddddd">

    <!--content-->
    <RelativeLayout
        android:id="@+id/content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

    <!--menu-->
    <com.mxn.soul.flowingdrawer_core.FlowingMenuLayout
        android:id="@+id/menulayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <FrameLayout
            android:id="@+id/id_container_menu"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

    </com.mxn.soul.flowingdrawer_core.FlowingMenuLayout>

</com.mxn.soul.flowingdrawer_core.FlowingDrawer>

</android.support.design.widget.CoordinatorLayout>
`

inside my content_main layout i have a recycler view before placing this it is working file but after adding Flowing Drawer my RecyclerView became unscrollable

A scrimColor / shadow issue

I can't find a way to implement any activity shadowing as in your example gif, setScrimColor method is not available for FlowingDrawer object. Can you please help me?

Not Working With Eclipse

Hi i've downloaded this and copy and pasted it in eclipse and made all the changes required and added all the libraries and project is showing no error but when i run it app is carshing and logcat is showing error on MainActivity's setcontentview with error in this attached file.
Please Help
log.txt

Failed to find style 'elasticDrawerStyle' in current theme

Hi,
when i want to add this library to my projects i get these errors:

--Failed to find style 'elasticDrawerStyle' in current theme
--Missing styles. Is the correct theme chosen for this layout? Use the Theme combo box above the layout to choose a different layout, or fix the theme style references.
--The graphics preview in the layout editor may not be accurate:
- Paint Flags Draw Filters are not supported.

Listener

Hello,
How to add listener when menu is close or open?

Sorry for my english

Show/Hide via code

how do is show or hide this drawer via Code?

i'd like to add custom hamburger button.

Use flowview in pager

Can we use flowview in view pager, i want same dragging effect in view pager page slide, but cannot achieve that. Can you please help.

Glitch while opening the Drawer

I am able to implement everything successfully. The only issue i am facing is a small glitch. I have attached the image of the glitch. Please if anyone has a solution please help me.

img_20160220_143828387

close drawer on item click

Hi...
I am trying to close drawer automatically when any item clicked in drawer. Have set new intent on item click and it work fine. But when i add code for close drawer on click of new intent the App crashes.

What kind of methods to use?

Default android Drawer has such methods:

 mDrawerLayout.addDrawerListener(mActionBarDrawerToggle);
 mDrawerLayout.setDrawerLockMode(lockMode);
 mDrawerLayout.openDrawer(GravityCompat.START);
 mDrawerLayout.closeDrawers();
mDrawerLayout.isDrawerOpen(GravityCompat.START);

What to use instead ?

Manifest merger failed

Unable to have the following in my app manifest:
android:allowBackup="false"

Please fix this by removing the allowBackup attribute, thank you!

Clik Item

when I clik the item there is no specially good effect,but on your app it has.
and i can not find something different betwwen your app and my app.
i very want to kown that,would you tell me.i am anticipating your reply.
sorry for my bad English

Background color for drawer

The gradle dependency version for compile 'com.mxn.soul:flowingdrawer-core:1.2.2' still has the line

mPaint.setColor(getResources().getColor(android.R.color.white)

within init()

enable fading

Hi.
How to enable fading background when drawer is open like animation on main page?

Can we disable swipe gesture

hi,
Flowing drawer is awesome, but i need to know that , can we disable swipe gesture like navigation drawer, if yes than plz help me.

Thank you.

import project

How to import this project into another project?
And how can I move the drawer to the right?

Dark fade

Hello

How to enable dark fade on drawer showing?

app:edMenuBackground="#dddddd" doesn't work, it only make small shadow on open and then disappear

thanks and greetings

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.