-
-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the Fabimals sample #450
Add the Fabimals sample #450
Conversation
/azp run full build |
Azure Pipelines successfully started running 1 pipeline(s). |
@TimLariviere |
Yes it is. |
The code size is roughly 750 lines of F# (without accounting for the Data folder). |
@TimLariviere
Not too bad. |
@TimLariviere It is kind of laggy on my device in debug mode but I think this was discussed a lot in the issues - "Performance while navigating" etc. so we have this covered there. I needed to reference the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All in all it looks good! Thanks for the example.
More or less I only had some questions in some parts :)
Interesting part is that the collectionview works in this example.... Would be interesting to find out why.
Should be fixed now |
Should be noted that using the search bar on a real iPhone currently crashes. |
View.SearchHandler( | ||
placeholder="Enter search term", | ||
showsResults=true, | ||
queryChanged=(fun (_, newValue) -> dispatch (QueryChanged newValue)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we can debounce this?
I mean that not on every change the message is run - just curious if it is possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible, yes. It's quite easy:
queryChanged=debounce 250 (fun (_, newValue) -> dispatch (QueryChanged newValue)),
I tried it with different times, but the UX doesn't feel satisfying.
The delay in the UI is not great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm... does every message run or only the latest with the debounce ?
maybe if only the latest massage will run it could be a bit better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debounce only sends the last message in a given time frame.
Everytime the event is triggered, it will wait for 250ms to check if there's no other event triggers. Only then it really calls the function and dispatches.
So this delay is kinda bad when typing. It can give a few quirks like if you're typing too slow, it will show delayed results not matching what you're currently typing.
E.g. You're typing "ABCD" slowly. While you wrote "ABC", it will display results for "AB".
So it's confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well i think maybe playing a bit with the timeframe could be a good way. I mean RX or ReactiveUI uses nearly the same logic for throttle or sth. else. There it works great, so I thought this could be a great thing to have.
Maybe we need to investigate on this and make mit more usable -> new issue?
@TimLariviere |
@SergejDK Yes, I did open an issue on the XF repo for that. When you leave the page with a CollectionView and come back to it, for some reasons, the previous items are still there stuck at the top. |
@TimLariviere |
I want to try to make it work with ShellContent.ContentTemplate instead of Content before merging it. |
Do you mean it as we do for listview? |
Yes. Just like we discussed it on the stream. Through the use of IShellContentController. |
Whoops. Nevermind. /// DataTemplate that can inflate a View from a ViewElement instead of a Type
type ViewElementDataTemplate(viewElement: ViewElement) =
inherit DataTemplate(Func<obj>(viewElement.Create)) |
Now that #446 and #447 are merged, the Fabimals sample can finally be added to Fabulous.
It is a direct port of the official Xaminals sample, to demonstrate how to use Shell in Fabulous.
https://github.com/xamarin/xamarin-forms-samples/blob/master/UserInterface/Xaminals
I feel like the implementation is ok, except for Routing which is currently being reworked in Xamarin.Forms (xamarin/Xamarin.Forms#5166)
But don't hesitate to suggest ways I can improve this sample.