Skip to content
This repository has been archived by the owner on Nov 8, 2018. It is now read-only.

Can't Navigate to UserSettings and SafetyPlan Screens from Navigation Drawer once Back button is Clicked. #405

Open
pandilladivya opened this issue Mar 5, 2017 · 18 comments

Comments

@pandilladivya
Copy link

pandilladivya commented Mar 5, 2017

Steps to reproduce the bug

Scenario - I
https://pandilladivya.github.io/settings.mp4

  1. Click on the hamburger icon in the ActionBar
  2. Click on Settings
  3. Click on the Back Button.
  4. Click on the hamburger icon
  5. Click on Settings
    ( Unable to navigate to UserSettings Activity )

Scenario - II
https://pandilladivya.github.io/safetyPlan.mp4

  1. Click on the hamburger icon in the ActionBar
  2. Select Safety Tools -> Safety Plan
  3. Click on the Back Button.
  4. Click on the hamburger icon
  5. Select Safety Tools -> Safety Plan
    (Unable to navigate to SafetyPlan Activity)

@sandarumk
Kindly Review the issue.
Thank You!

@abs51295
Copy link
Member

abs51295 commented Mar 5, 2017

@pandilladivya Would you like to work on this issue?

@pandilladivya
Copy link
Author

pandilladivya commented Mar 6, 2017

@abs51295 I would like to work on this issue but it will take me some time(more than a week) to finish this up because i'm travelling..

So, If @sandarumk approves this, you can work on it if you are interested :)

@Pooja-Mahadev-Soundalgekar

This issue exists with many Activities, not just UserSettings and Safety Plan. I am interested in working on this bug.

@pandilladivya
Copy link
Author

@Pooja-Mahadev-Soundalgekar You can work on this if @sandarumk approves it :)

@pandilladivya
Copy link
Author

@Pooja-Mahadev-Soundalgekar Can you list out the activities which have the same bug ?

@sandarumk
Copy link

@abs51295 @pandilladivya @Pooja-Mahadev-Soundalgekar As @pandilladivya mentioned please list out the activities which has the same bug. And who is going to fix this? (So I can assign the issue to that person)

@abs51295
Copy link
Member

@sandarumk Isn't it identical to #414 ?

@codingblazer
Copy link
Member

@abs51295 Though they are not same but reason for #414 and this is same. So this issue won't be valid once #414 and #427 are solved which I have analysed and solved.
@sandarumk please give a look at #414 and #427 to get a better picture about this. Thanks :-)

@abs51295
Copy link
Member

@codingblazer That's exactly what I meant! :)

@pandilladivya
Copy link
Author

@abs51295 @codingblazer
Yes. I think you are right!

This issue, #414 #427 are similar issues.

Since this issue came up first. I think @sandarumk should give more insight on which issue to be solved.

If @abs51295 @Pooja-Mahadev-Soundalgekar (Since they were interested to work on the issue) are not working on this, I would like to work :)

@codingblazer
Copy link
Member

codingblazer commented Mar 14, 2017

Hey @pandilladivya
This issue is a invalid issue. Solving this issue would be adding more code to a wrong navigation bar code. Problem is much bigger which is causing many other such bugs.
I am really sorry but it won't be required as I have already sent PR for #414 couple days back which covers this and many broad problems 🙂
Also this issue and (#414, #427 ) are totally different but similar in sense that they have same reason (that's the mistake in PR #378 ). I have solved them because #426 is not complete solution.
@pandilladivya I have already analysed and remodelled navigation bar. If you don't mind, please let me continue on the #414 #427 which are much broader than this issue. Also I don't have any other issue to work on. Thanks 🙂

@pandilladivya
Copy link
Author

@codingblazer

Even I have worked on this ... found the root cause and the solution for the bug.
And Yes, you are right! .. The problem is with the Navigation Bar code.
I dont have any problem if you continue with the issue :)

Lets wait till @sandarumk give her opinion on this.
And I agree, this is subset of the major navbar issue

#436 #427 #414 #405 are different issues ... which can be solved on modifying code for navigation bar.

@codingblazer
Copy link
Member

codingblazer commented Mar 14, 2017

@pandilladivya hey, can you tell what's your solution

@pandilladivya
Copy link
Author

pandilladivya commented Mar 15, 2017

@codingblazer

The obvious solution would be modifying navigationbar code.

Root Cause which is causing this problem

The following is the code which is causing the above mentioned problem.

if (lastExpandedGroup == groupPosition) {
                    if (lastExpandedGroup == 2 || lastExpandedGroup == 3 || lastExpandedGroup == 4 || lastExpandedGroup == 5) {
                        //do nothing
                    } else {
                        mDrawer.closeDrawer(GravityCompat.START);
                    }
                }

When we select any item in the navigationbar ... It is recording groupPosition and lastExpandedGroup.

So, In the above problem,
Lets consider a scenario (Navigating to Settings Screen)

  • Click on Settings item in nav bar ---> (groupPosition = 6 and lastExpandedGroup = -1)
    Since lastExpandedGroup != groupPosition ... It works fine and navigates to Settings Screen.
  • When we click back button (either from the back button given in the screen or from the back button present in the device), it is navigating to the previous screen (Home Page)
  • Now, Click on Settings again -----> (groupPosition = 6 and lastExpandedGroup =6)
    So, It is going inside the if ( code snippet is displayed above) and navigation doesn't happen.

@pandilladivya
Copy link
Author

pandilladivya commented Mar 15, 2017

@codingblazer

As you mentioned in your previous comment ... I don't think this is an invalid issue and solving this doesn't add more wrong code.

And I think this is not a minor bug, because this happens with each and every item in the navigationBar.
(when we click back button from the device)

That's just my opinion ... pardon me if i were wrong :)

@sandarumk
Kindly review this ..
Thank you

@codingblazer
Copy link
Member

codingblazer commented Mar 15, 2017

@pandilladivya

pardon me if i were wrong

Well, I can't say anything because I don't know how you are intending to solve this which I requested in last comment (Pardon me but I was just requesting a brief on solution).
There is no point arguing with each other :-)
Please feel free to go ahead with this if @sandarumk approves. I will close my PR #426 .
If @sandarumk approves #427 , i may handle those other issues. Since you have worked on this part, please don't solve issues of #427 now as I have solved them already.
I definitely don't consider it a minor bug. I always said, its a subset of much broader problem.
@pandilladivya Thanks. Happy coding :-)

@pandilladivya
Copy link
Author

@codingblazer

We were not arguing 😆

We were just discussing on the issue and sharing our views and solution
Please dont take it the other way 😬

@codingblazer
Copy link
Member

I never took it other way :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

5 participants