ui-material-components
ui-material-components copied to clipboard
[Bottom-navigation][android] Frame.topmost().navigate doesn't work when activity resumed
Hi,
On android if the app just start every think work as expected, but when the app is in background and then it resumed the Frame.topmost().navigate wont work until you change the tabs then the navigate will be triggered!
Please found this sample project
- open the app and click on TAP ME
- it is expected to navigate to the PAGE TEST 2 successfully
- Go back to home
- put the app on background and reopen it
- click on TAP ME: then the navigation will not occur any more!!
@farfromrefug did you have any idea about this behavior ?
@kefahB absolutely not . And i am sorry but i realy dont have time to investigate this. Hope you can
I tried for the whole day today but I really understand no think :)
@farfromrefug how can I get the source code in TS ? when I navigate to packages/bottom-navigation I dont see the sources code ! I mean there is no index.ios.ts, index.androis.ts....
it is in src. this is a monorepo. the packages folder is for the output odf the build
@farfromrefug I think I got the error but am not sure, the problem occur if the selectedView instanceof Frame.
When the app is loaded for the first time every think work as expected selectedView.isCurrent() return true.
But when you click on home button and reopen the app selectedView.isCurrent() return FALSE ! I've tried to do some stuff with selectedView.setCurrent but not work for the moment !
Any Idea ?
@kefahB thanks for investigating. i just dont understand your isCurrent reference. dont see that code
The code doesn't exist .. I've add during the investigation
const selectedView = newItem && newItem.content;
if (selectedView instanceof Frame) {
selectedView._pushInFrameStack();
console.log("isCurrent", selectedView.isCurrent())
console.log("navigationQueueIsEmpty", selectedView.navigationQueueIsEmpty())
console.log("isUserInteractionEnabled", selectedView.isUserInteractionEnabled)
console.log("isLayoutValid", selectedView.isLayoutValid)
console.log("isLoaded", selectedView.isLoaded)
console.log("_isInFrameStack", selectedView._isInFrameStack)
if(!selectedView.isCurrent()) {
selectedView.setCurrent(selectedView._currentEntry, 1);
}
console.log("isCurrent", selectedView.isCurrent())
//selectedView._pushInFrameStack();
}
@kefahB isCurrent() is not a correct test. it takes an argument. What you see : true => false is 100% normal