oppia-android
oppia-android copied to clipboard
Navigation Drawer screen transition animation fix
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)
Can i work on this issue?
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??
Can I work on this issue? I can add animation to it.
@vrajdesai78 Sure. I am assigning it to you.
Hello, Can I take this issue? It will be my first contribution, please guide me what to do ?
@AgPriyanshu18 assigned go ahead. If you have any query feel free to ask me.
@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.
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?
@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?
@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.
@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.
@MohitGupta121 I can't figure out how to solve the issue, Please unassign me from this issue
Yes sure @AgPriyanshu18 no problem. If you wish PTAL on another issues if you want?
Can you assign this issue to me? @seanlip @BenHenning @rt4914
@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!
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
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?
@adityabarodiya please go through this comment https://github.com/oppia/oppia-android/issues/2732#issuecomment-1396778319 Same applies for you also.
Can I work on this issue?
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!
Can you assign me ?
@MonuGit9, could you please describe your proposed solution to the problem?
@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!