Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation Drawer screen transition animation fix #2732

Open
rt4914 opened this issue Feb 17, 2021 · 23 comments
Open

Navigation Drawer screen transition animation fix #2732

rt4914 opened this issue Feb 17, 2021 · 23 comments
Labels
bug End user-perceivable behaviors which are not desirable. good first issue This item is good for new contributors to make their pull request. Impact: Low Low perceived user impact (e.g. edge cases). Work: Low Solution is clear and broken into good-first-issue-sized chunks. Z-ibt Temporary label for Ben to keep track of issues he's triaged.

Comments

@rt4914
Copy link
Contributor

rt4914 commented Feb 17, 2021

As per this comment:

The selected page should change in the background first before the menu slides back.

So from the Home Page, if I as a user tap the hamburger menu and select "Options," the page that is a layer below the side menu should change/fade to the Options page, and then the side menu hides. (mock)

@rt4914 rt4914 added this to the Backlog milestone Feb 17, 2021
@rt4914 rt4914 added Priority: Important This work item is really important to complete for its milestone, but it can be scoped out. Status: Not started Type: Task A single task of work corresponding to a greater milestone. Generally corresponds to a single PR. labels Feb 17, 2021
@prayutsu prayutsu added the good first issue This item is good for new contributors to make their pull request. label Feb 17, 2021
@harsh-hash
Copy link
Contributor

Can i work on this issue?

@ArpitShukIa
Copy link
Contributor

I checked in a lot of apps (Gmail, Amazon, CamScanner and a few others)
When user selects an item from navigation drawer, all these apps first close the drawer and then navigate to the selected destination.
I too feel that the drawer should first close and then (or simultaneously) the screen should fade (not slide) to next one.

Now, just to confirm once, we want our app to behave as stated in the issue??

@vrajdesai78
Copy link
Contributor

Can I work on this issue? I can add animation to it.

@rt4914
Copy link
Contributor Author

rt4914 commented Jun 7, 2021

@vrajdesai78 Sure. I am assigning it to you.

@rt4914 rt4914 added this to Needs Triage in CLAM Team (deprecated -- please use new board) via automation Jul 12, 2021
@rt4914 rt4914 moved this from Needs Triage to Beta (Bugs & Fixes) in CLAM Team (deprecated -- please use new board) Jul 12, 2021
@rt4914 rt4914 moved this from Beta (Bugs & Fixes) to High-fi Beta in CLAM Team (deprecated -- please use new board) Jul 12, 2021
@Broppia Broppia added issue_type_bug Impact: Low Low perceived user impact (e.g. edge cases). labels Jul 29, 2022
@Broppia Broppia added this to To do in User team via automation Aug 2, 2022
@BenHenning BenHenning added Issue: Needs Clarification Indicates that an issue needs more detail in order to be able to be acted upon. Z-ibt Temporary label for Ben to keep track of issues he's triaged. issue_user_learner labels Sep 15, 2022
@BenHenning BenHenning removed this from the Backlog milestone Sep 16, 2022
@AgPriyanshu18
Copy link

AgPriyanshu18 commented Dec 12, 2022

Hello, Can I take this issue?
It will be my first contribution, please guide me what to do ?

@MohitGupta121
Copy link
Member

@AgPriyanshu18 assigned go ahead.
If you have any query feel free to ask me.

@AgPriyanshu18
Copy link

AgPriyanshu18 commented Dec 21, 2022

@BenHenning the behaviour describe in this issue can not be achieved by using activities.
Since, new activities start on top of previous activities, so we can't keep navigation drawer open in between. Previous activity will fade before getting new activity and the drawer is attached to the activity.
All the menu items in naviagtion drawer like options start a new activity.
It is only possible by using Fragments , we can switch between fragments in back when navigation drawer is open.
This is what I found, Please correct me if I am wrong.

@BenHenning
Copy link
Sponsor Member

I'm not sure I fully follow @AgPriyanshu18. For the case of this issue, activities have a navigation drawer managed as a separate fragment within the activity's hierarchy. Presumably we can layer that activity's view hierarchy such that the base fragment of the activity that the drawer goes above can be blurred or faded using some sort of blended filter. I'm not quite seeing why this wouldn't be possible with how things are currently set up. Am I missing something? If so, could you please clarify on more specifically why what I described above wouldn't work?

@MohitGupta121
Copy link
Member

@AgPriyanshu18 are you still woking on this issue? If you blocked somewhere please feel free to ask. or we unassign you this issue if you not working on this?

@AgPriyanshu18
Copy link

@MohitGupta121 I still can't figure out How to solve the issue, I need help about how could I seperate a fragment from activity, to change base activity with fragment as it is.

@BenHenning
Copy link
Sponsor Member

@MohitGupta121 I still can't figure out How to solve the issue, I need help about how could I seperate a fragment from activity, to change base activity with fragment as it is.

This will probably need to be solved within each activity. I suggest starting with one (such as home_activity) and getting it to work there, first, and then we can see if generalization is possible. Once you get it working, I suggest opening a draft PR so that one of us can take a look.

@AgPriyanshu18
Copy link

@MohitGupta121 I can't figure out how to solve the issue, Please unassign me from this issue

@MohitGupta121
Copy link
Member

Yes sure @AgPriyanshu18 no problem.
If you wish PTAL on another issues if you want?

@kunsistent
Copy link

Can you assign this issue to me? @seanlip @BenHenning @rt4914

@seanlip
Copy link
Member

seanlip commented Jan 19, 2023

@kunsistent Could you please explain, in some detail, what the current problem is and what changes you plan to make to solve this issue (with links to files in the codebase)? If your proposed solution looks good, we can assign you to it. Thanks!

@masclot
Copy link
Collaborator

masclot commented Jan 19, 2023

I'm not sure I fully follow @AgPriyanshu18. For the case of this issue, activities have a navigation drawer managed as a separate fragment within the activity's hierarchy. Presumably we can layer that activity's view hierarchy such that the base fragment of the activity that the drawer goes above can be blurred or faded using some sort of blended filter. I'm not quite seeing why this wouldn't be possible with how things are currently set up. Am I missing something? If so, could you please clarify on more specifically why what I described above wouldn't work?

It is not just fading out the base fragment, it is also fading in the new view with the options, all while handling two drawers. The fade-out view and the fade-in view are in different activities, and each activity has its own drawer. To use an activity transition over the views, one needs to create the new activity with the drawer already open, tell the animation to fade-out the old activity's content, fade-in the new activity's content and close the new activity drawer after the activity transition finishes. The translucent background over the content is a problem as well, as it is not implemented as a View.

Using the standard android transitions I can do the following:

  • Set the enter transition in OptionsActivity to Fade
  • Set the exit transition in HomeActitivity to Fade
  • Set the shared element animation for both activities above to null
  • In NavigationDrawerFragmentPresenter:
    • When entering the options activity from the drawer, open the drawer without animation
    • Set shared element for transition to be the drawer content
      -- close the auto-opened drawer after a few (200?) milliseconds, when the activity transition has finished

This does not do what is requested, as the whole activities are faded (except the drawer), not just the content, but it is all I can think of with the standard android Transitions.

I don't yet know how to isolate this change to only the home and options activity transition.
I'm attaching a recording.
MainToOptionsTransition.webm

@BenHenning
Copy link
Sponsor Member

BenHenning commented Feb 7, 2023

Apologies for the late reply. Thanks for the detailed write-up @masclot.

I better understand the issue now, thanks to your write-up. This may actually not be feasible with our multi-activity architecture (at least, not without significant difficulty since I think it would potentially require caching renders of the activity cross-activity). Given that the activity transitions happen at such a low level in Android and aren't very customizable, I'm also not certain this can be solved with transitions alone.

Do you have any additional thoughts @masclot, or anyone else?

@MohitGupta121
Copy link
Member

@adityabarodiya please go through this comment #2732 (comment)
Same applies for you also.

@seanlip seanlip added bug End user-perceivable behaviors which are not desirable. and removed issue_user_learner labels Mar 29, 2023
@predator313
Copy link

Can I work on this issue?

@adhiamboperes
Copy link
Collaborator

Could you please explain, in some detail, what the current problem is and what changes you plan to make to solve this issue (with links to files in the codebase)? If your proposed solution looks good, we can assign you to it. Thanks!

Sure. Could you please explain, in some detail, what the current problem is and what changes you plan to make to solve this issue? If your proposed solution looks good, we can assign you to it. Thanks!

@adhiamboperes adhiamboperes added Work: Low Solution is clear and broken into good-first-issue-sized chunks. and removed Priority: Important This work item is really important to complete for its milestone, but it can be scoped out. Type: Task A single task of work corresponding to a greater milestone. Generally corresponds to a single PR. Issue: Needs Clarification Indicates that an issue needs more detail in order to be able to be acted upon. labels Oct 19, 2023
@MonuGit9
Copy link

Can you assign me ?

@adhiamboperes
Copy link
Collaborator

@MonuGit9, could you please describe your proposed solution to the problem?

@adhiamboperes
Copy link
Collaborator

@MonuGit9, could you please describe your proposed solution to the problem?

Could you please explain, in some detail, what the current problem is and what changes you plan to make to solve this issue? If your proposed solution looks good, we can assign you to it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug End user-perceivable behaviors which are not desirable. good first issue This item is good for new contributors to make their pull request. Impact: Low Low perceived user impact (e.g. edge cases). Work: Low Solution is clear and broken into good-first-issue-sized chunks. Z-ibt Temporary label for Ben to keep track of issues he's triaged.
Development

Successfully merging a pull request may close this issue.