Status Update
Comments
ia...@gmail.com <ia...@gmail.com> #2
Use cases: Some phone(like OnePlus) will change the density when rotating the screen or enter PIP mode, I use slider to make a controller for a video player app, at this point the video is playing and the progress bar is changing, then App will be crashed
il...@google.com <il...@google.com> #3
Not sure I understand the use case.
Slider cannot measure 0.dp it has to measure at least 2 thumbs so that the thumb can move from 0f to 1f. Do you mean to use Modifier.weight instead so that it takes the available space?
ma...@gmail.com <ma...@gmail.com> #4
yes, i am using Modifier.weight for Slider, i don't know why it crash on OnePlus phone
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #5
Here is a example code of my slider controller
Row(Modifier.fillMaxWidth()) {
// Some icon buttons here
Slider(
modifier = Modifier.weight(1f)
//...
}
// Other icon buttons here
}
When exiting the horizontal screen state or entering the picture-in-picture mode, the above exception will be caused, and it only happens on OnePlus phone
il...@google.com <il...@google.com> #6
Thanks I'll add a fix for parents with width 0.dp maybe it something that only happens briefly and then it measures something reasonable. Can you share the exact model/OS?
[Deleted User] <[Deleted User]> #7
OnePlus 7/OnePlus 8
I don't have any specific phone to test,it's the feedback from my users. After the simulator test, I guess it's the change of density?
At present, I use BoxWithConstraints to wrap the Slider. And check the maximum width of the constraint, and it will only be displayed when the maximum width is above 40dp, which temporarily fixes the exception.
Description
Version used: 1.0.0-alpha01
Devices/Android versions reproduced on: Device running Android P, compiled in SDK 27
If this is a bug in the library, we would appreciate if you could attach:
- Sample project to trigger the issue.
- A screenrecord or screenshots showing the issue (if UI related).
In order to instantiate the view of my first fragment, some data needs to be passed from the current Activity to the primary fragment. Currently, I don't see a clear way to do this. In the same way one can navigate from fragment to fragment while passing arguments via the NavController's navigate method, it would be helpful if there was some method to pass a bundle to the first nav fragment and update the graph associated with the NavHostFragment before inflating the view.
Please do let me know if there is some way to do this that I'm missing. Currently I'm setting up a dummy fragment to start with that will manage passing the data to the intended first fragment.