Giter VIP home page Giter VIP logo

Comments (9)

shiburagi avatar shiburagi commented on May 17, 2024

from drawer-behavior.

shiburagi avatar shiburagi commented on May 17, 2024

There may have this segment of code in your activity class.

@SuppressWarnings("StatementWithEmptyBody")
   @Override
   public boolean onNavigationItemSelected(MenuItem item) {
       // This code will close the left drawer after drawer's item clicked
       drawer.closeDrawer(GravityCompat.START);
       return true;
   }

try remove/comment this line of code

        drawer.closeDrawer(GravityCompat.START);

from drawer-behavior.

albert0m avatar albert0m commented on May 17, 2024

this is weird because I removed the only places where I called the closeDrawer, and it still happens. This only happens if I move the drawer to the left. How can I debug where the closing is happening?

from drawer-behavior.

albert0m avatar albert0m commented on May 17, 2024

found it, it's in the DrawerLayout sources:

 @Override
    public boolean onTouchEvent(MotionEvent ev) {

... 
        switch (action & MotionEventCompat.ACTION_MASK) {
 
...
            case MotionEvent.ACTION_UP: {
                   closeDrawers(peekingOnly);

}

from drawer-behavior.

shiburagi avatar shiburagi commented on May 17, 2024

not in drawer layout..but in Activity/ Fragment class should have that code

from drawer-behavior.

shiburagi avatar shiburagi commented on May 17, 2024

by default code generator for navigation activity, the generator with create this segment of call,

   @SuppressWarnings("StatementWithEmptyBody")
   @Override
   public boolean onNavigationItemSelected(MenuItem item) {
       // This code will close the left drawer after drawer's item clicked
       drawer.closeDrawer(GravityCompat.START);
       return true;
   }

which will close the left drawer after the item clicked

from drawer-behavior.

albert0m avatar albert0m commented on May 17, 2024

I'm not sure where I'm failing to explain myself, but the code you pasted twice IS NOT PRESENT ANYWHERE. I showed you where the problem is happening, but it's past beyond your library. I'm dropping it from my app and I will be googling the solution. Thank you anyways

from drawer-behavior.

shiburagi avatar shiburagi commented on May 17, 2024

okayy

from drawer-behavior.

shiburagi avatar shiburagi commented on May 17, 2024

i already push example code which left drawer will not close after item clicked on branch "revision1"

https://github.com/shiburagi/Drawer-Behavior/tree/revision1/app/src/main/java/com/infideap/drawerbehaviorexample/drawer

from drawer-behavior.

Related Issues (20)

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.