Comments (15)
Also I tried updating to the last recommendation with onBackPressedDispatcher, but nothing has changed, looks like the animation is to long (weird, I know), but looks like a race condition of animation.
from simple-stack.
Hello, unfortunately I can't really do much without a minimal sample that reproduces this. TRANSIT_FRAGMENT_FADE is built into fragments, and shouldn't cause freezes at all.
If you overrode onForwardNavigation, onBackwardNavigation, onReplaceNavigation, make sure you don't call super.onForwardNavigation
and so on.
from simple-stack.
Could you, please, just set this animation to any of your project to reproduce it?
I will later prepare some sample project for this use case.
from simple-stack.
I have been using this animation and did not encounter this issue.
from simple-stack.
Actually, now that I recall, the one time I did have some lag was when my fragmentKey.toString()
took non-negligible time.
from simple-stack.
Sorry for the delay.
I think I found the pattern, it looks like it happens when I navigate back from a "heavy" screen, in my case it's a screen with webview. And it doesn't happen consistent, sometimes the navigation works fine.
I have an open source project where you can reproduce the bug - https://github.com/Jawziyya/azkar-android/tree/feature/hadith.
Sorry, but the app is only in russian language, but you will find a Settings menu on the main screen, it will open a webview from where you can than than navigate back with close button. Here is the settings screen - https://github.com/Jawziyya/azkar-android/tree/feature/hadith/app/src/main/java/io/jawziyya/azkar/ui/settings.
Also I have noticed it happens only when I navigate back through calling requireActivity().onBackPressed(), when I go back by the system navigation it's fine, weird.
from simple-stack.
Also I've notice now, that it look more like app crash, but I don't see any logs about it, maybe there is some system crash.
EDIT.
found in the logs
Exception thrown during dispatchAppVisibility Window{a79cf22 u0 io.jawziyya.azkar/io.jawziyya.azkar.ui.AppActivity EXITING} android.os.DeadObjectException
from simple-stack.
Your coroutine scope should be protected val coroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.Main.immediate)
And you are not setting the disposition strategy on the Fragment's ComposeView setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
Maybe one of these is the cause
from simple-stack.
I have there an extensions function, that sets the strategy createComposeView
from simple-stack.
Also I don't see a problem not having the right dispatcher, because in this case I'm not calling it.
from simple-stack.
I enabled hardware acceleration on your WebView.
webView.clipToOutline = true
webView.setLayerType(View.LAYER_TYPE_HARDWARE, null) // <----
webView.layoutParams = ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
By adding `webView.setLayerType(View.LAYER_TYPE_HARDWARE, null) it works.
I don't know why it happened, but it is not caused by Simple-Stack. Anyway, if you add that line, it will stop crashing.
from simple-stack.
This is not definitely a simple stack issue.
The funny thing is, that I noticed it also happens when I call requireActivity()::onBackPressed from the material component IconButton onclick, if I use an another custom button with clickable modifier it works fine.. Also I checked if it's called maybe twice, but no, the log show only 1 call of the method..
from simple-stack.
This is not definitely a simple stack issue.
The funny thing is, that I noticed it also happens when I call requireActivity()::onBackPressed from the material component IconButton onclick, if I use an another custom button with clickable modifier it works fine.. Also I checked if it's called maybe twice, but no, the log show only 1 call of the method..
well as I mentioned, if you add hardware acceleration to the WebView, it stops crashing
I found that this also happened in React Native projects for some reason. One of the fixes said "set 0.99 alpha" which is just funny.
from simple-stack.
That's so weird.
Anyway, thank you for help and quick response!
from simple-stack.
I found that by removing webView.clipToOutline = true
fixes the issue too. I think that's very weird that this things are somehow connected, but still they should kept in mind.
I've just recently added this clip function call, because of https://issuetracker.google.com/issues/242463987.
I don't know which solution would be best, but I will probably choose not to use the material component and just add some custom AppBar to solve this bug.
from simple-stack.
Related Issues (20)
- Can I Use @styles/Theme.MyComposeTheme on AndroidManifests.xml? HOT 3
- Question: What is the purpose of RegistrationViewModel inside ServiceProvider in extension-compose-example? HOT 4
- What is the proper way to add a key to the top even if it already exists in the backstack? HOT 2
- Publish to MavenCentral instead of just Jitpack.io
- Unable to start activity ComponentInfo{com.xxxxxxxxxx.yyyyyy/com.xxxxxxxxxx.yyyyyy.activities.MainActivity}: androidx.fragment.app.Fragment$InstantiationException: Unable to instantiate fragment q2.v1: could not find Fragment constructor HOT 7
- How to 'lookup<>()' scoped class from an Android Service HOT 2
- Lazy initialization of ScopedServices HOT 2
- KMM support? HOT 2
- Screen can get the service from wrong scope during back animation HOT 6
- Backstack is not available in a child Fragment's onCreate after process death
- DialogFragment and BottomDialogFragment as part of navigation stack, question HOT 2
- Verify that the new `setParentServices()`'s `lookupFromScope(..., EXPLICIT)` behavior is what is expected
- Updating the Compose example to Compose 1.5.0 requires AGP 8.1
- Should Simple Stack be used in new projects HOT 14
- Backstack with espresso HOT 3
- The service does not exist in any accessible scopes HOT 11
- Up navigation examples are hard to find HOT 3
- Consider adding Backstack.services() method as in GlobalServices.services() HOT 4
- Extensions should support Fragment in-app predictive back animations
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simple-stack.