Skip to content

[android] change fragment transactions#10088

Closed
vallemar wants to merge 0 commit into
NativeScript:mainfrom
vallemar:master
Closed

[android] change fragment transactions#10088
vallemar wants to merge 0 commit into
NativeScript:mainfrom
vallemar:master

Conversation

@vallemar
Copy link
Copy Markdown
Contributor

This is a second attempt at this PR #8791. @farfromrefug could you check it? on my mobile it works and the flash of the maps have disappeared

@cla-bot cla-bot Bot added the cla: yes label Nov 12, 2022
@farfromrefug
Copy link
Copy Markdown
Collaborator

@vallemar that was fast. You don't need changes in core/application. Could you please remove them from that PR?

@vallemar
Copy link
Copy Markdown
Contributor Author

@farfromrefug if it refers to this file packages/core/application/index.android.ts if I don't put the changes the application gives an error when opening, I haven't tried one by one. I will find which one is necessary and update the branch

@NathanWalker NathanWalker added this to the 8.4 milestone Nov 18, 2022
@vallemar
Copy link
Copy Markdown
Contributor Author

I have seen that they have added this to 8.4 amazing! I'm sure this needs some change, there were times it worked for me and other times it didn't, but I think it was because of how I have my local environment. I'm not going to be able to do anything for the whole weekend, I just took the pc to the technician because I think the graphics card is broken

@NathanWalker NathanWalker modified the milestones: 8.4, 8.5 Nov 24, 2022
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Dec 7, 2022

Nx Cloud Report

CI is running for commit 9753520.

📂 Click to track the progress, see the status, the terminal output, and the build insights.


Sent with 💌 from NxCloud.

@vallemar
Copy link
Copy Markdown
Contributor Author

Guys, I'm testing @farfromrefug fork that has these changes and I have to say that I think the difference in Android when browsing is quite a bit, with the current ns-core package I lose the animation because it gets stuck when entering a page with a lot of components and with the fork the animation makes it perfect and it doesn't seem to get stuck

@farfromrefug
Copy link
Copy Markdown
Collaborator

@vallemar it is quite a big change. We need to test that quite a bit. Not sure what the best approach would be to ensure there is no regression. Firs nx report seems to report a tsc issue on this. @NathanWalker I dont see what command line it is failing on to reproduce locally. Can you tell me ?
@vallemar did you try that PR does it works fine for you?

@vallemar
Copy link
Copy Markdown
Contributor Author

vallemar commented Dec 21, 2022

@farfromrefug I had it working but there were times that it had some failures to start, I don't know if it was because I changed the core in node_modules or because. On top of that, another commit has slipped in, sorry. I would have to try it again but when I try to run the core on my pc my pc crashes

@farfromrefug
Copy link
Copy Markdown
Collaborator

@vallemar OK if you can force push without the unwanted commit that would be great.
About your case where it fails if you can create a reproducible example I could fix it

@vallemar
Copy link
Copy Markdown
Contributor Author

@farfromrefug Using this version my application is working perfectly and without blinking in the navigation. The only thing is that I have these two warnings and I don't know why, since the BackstackEntry type is being exported in the d.ts

WARNING in ../../../../git/NativeScript/packages/core/ui/frame/index.android.ts 516:57-71
export 'BackstackEntry' (imported as 'BackstackEntry') was not found in '.' (possible exports: Frame, FrameBase, NavigationType, _stack, actionBarVisibilityProperty, attachStateChangeListener, defaultPage, getFrameById, goBack, moduleLoaded, reloadPage, setActivityCallbacks, setFragmentCallbacks, setFragmentClass, topmost)

WARNING in ../../../../git/NativeScript/packages/core/ui/frame/index.android.ts 516:91-105
export 'BackstackEntry' (imported as 'BackstackEntry') was not found in '.' (possible exports: Frame, FrameBase, NavigationType, _stack, actionBarVisibilityProperty, attachStateChangeListener, defaultPage, getFrameById, goBack, moduleLoaded, reloadPage, setActivityCallbacks, setFragmentCallbacks, setFragmentClass, topmost)

video5843545908083428893.mp4

@farfromrefug
Copy link
Copy Markdown
Collaborator

@vallemar can you try to replace import { ExpandedEntry } from './fragment.transitions.android'; in with import type { ExpandedEntry } from './fragment.transitions.android'; in index.android.ts

@vallemar
Copy link
Copy Markdown
Contributor Author

@farfromrefug this does not solve the problem, the error comes from BackstackEntry not from ExpandedEntry

@farfromrefug
Copy link
Copy Markdown
Collaborator

Yes but I thought it would be this. Strange I don't have the error in my fork. Need to look at this PR locally

@farfromrefug
Copy link
Copy Markdown
Collaborator

@vallemar i fixed the warning but i cant commit in your branch. You need to change the first line of core/ui/frame/index.android.ts with this

import { AndroidFrame as AndroidFrameDefinition, AndroidActivityCallbacks, AndroidFragmentCallbacks, NavigationTransition } from '.';
import type { BackstackEntry } from '.';

@vallemar
Copy link
Copy Markdown
Contributor Author

@farfromrefug done! Thanks!

@vallemar
Copy link
Copy Markdown
Contributor Author

vallemar commented Feb 12, 2023

I am using @farfromrefug fork, I am noticing that in the navigation the lottie components take a while to load (I think the lists also take longer to display). I'm not sure if it's because of these changes, because of the component itself or because of something else, I'm just leaving it here as a note to check before continuing with this

@farfromrefug
Copy link
Copy Markdown
Collaborator

@vallemar you need to give more context. What kind of navigation ?

@vallemar
Copy link
Copy Markdown
Contributor Author

vallemar commented Feb 12, 2023

@farfromrefug it's a simple forward navigation, using the Fade transition, here's a video showing the delay

Screenrecorder-2023-02-12-12-58-15-973.mp4

in the En ruta button it seems to be more noticeable because it makes the button grow and with the background it is more noticeable (it is the first one that I show in the video)

@farfromrefug
Copy link
Copy Markdown
Collaborator

@vallemar ok would be good to create comparable example. Forward navigation should make no difference. Backward navigation should be very different though

@NathanWalker NathanWalker removed this from the 8.5 milestone Mar 17, 2023
@vallemar
Copy link
Copy Markdown
Contributor Author

I think this should be taken up again, I am having navigation delays when using NS but I don't see them if I use the fork...

@CatchABus
Copy link
Copy Markdown
Contributor

I think this should be taken up again, I am having navigation delays when using NS but I don't see them if I use the fork...

I noticed there's a long discussion regarding this PR.
What's the current state of core regarding flashes and delays?

@Siergiej29
Copy link
Copy Markdown

@farfromrefug's fork works very well.

Maybe reopen this PR?

Maybe implement this fix in the upcoming new version 9?

@CatchABus
Copy link
Copy Markdown
Contributor

@farfromrefug's fork works very well.

Maybe reopen this PR?

Maybe implement this fix in the upcoming new version 9?

This comment has no specific context regarding the problem and I noticed you have already commented in another old closed PR.
Please avoid spam and open an issue describing your problem.

@farfromrefug
Copy link
Copy Markdown
Collaborator

@CatchABus I think i know the context. every user using google maps, mapbox, maplibre... will have issue with current N on android. opening a page on top of a map view then going back will end up with a black view.
This was the reason why i rewrote the fragment handling in this PR.
some users ask me about that issue and i pointed them to this PR.
it is true that this PR should be reopened. we never really new why it was reverted after being merged. thus leaving no chance to fix the issues preventing this from being merged

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants