XamFormsExtended / Xfx.Controls

Xamarin Forms Extended Controls
MIT License
192 stars 79 forks source link

XfxPicker #3

Open ChaseFlorell opened 7 years ago

ChaseFlorell commented 7 years ago

Feature Request:

Create a Picker control that mimics the existing Xamarin.Forms.Picker but also includes a floating label and error messaging.

An added bonus would be to use the forthcoming bindable picker.

SkyeHoefling commented 6 years ago

I can pick this up. I am starting to extend this library for a project I am working on and I need a matching picker. I'll submit a pull request when I have it completed.

ChaseFlorell commented 6 years ago

@ahoefling I have a bunch of this done already because I needed it in an internal project. I haven't had a chance to refine it yet though, so I'd be happy to hand over what I have to get you started.

SkyeHoefling commented 6 years ago

If you could hand over some code to me that would be awesome! Could you put it in a branch and I can fork it and see what it is doing. The major problem I was running into is extending the Xamarin.Forms base picker functionality while injecting the new types. I was looking to do some type of hybrid combination of our XfxEntryRenderer and the Xamarin.Forms PickerRenderer.

Very interested to see how you started this.

As a side note, I have accomplished this using pure xaml in Xamarin.Forms but this is a much more performant approach. I am a pretty big fan of this repository and the hard work you have put in

ChaseFlorell commented 6 years ago

Well I brought all my old stuff in and got it compiling. I didn't even bother spinning it up in a sim to see what it looks like. Feel free to mess with it and submit a PR

https://github.com/XamFormsExtended/Xfx.Controls/tree/issue-%233

SkyeHoefling commented 6 years ago

I just copied some of the code into my project and it worked without issue. I can dig through it and extract a PR that just adds the MVP.

Out of curiosity do you remember the known issues with this code?

ChaseFlorell commented 6 years ago

There was no known issue per-se, but it didn't implement the the added features like setting the active color and disabling the error text all together. I threw it in hastily before pushing, but it's fully untested. Also IIRC, the "selection" behavior on iOS doesn't behave the same as the default Picker and I think that was a business rule when I built it. I think the Picker selects when you scroll to an item and this one selects after you click "done"... or something like that. Honestly it's about a half a year old so my memory is foggy.

ChaseFlorell commented 6 years ago

so as for the selection behavior... what is the iOS default in that scenario? I always hated that as you scrolled to a picker item, as soon as you stop it'd select it; is that how iOS is supposed to behave?

I'll take whatever is standard, and if there's no standard, do you think we should stick to the Picker behavior, or deviate?

SkyeHoefling commented 6 years ago

This actually works pretty well on both iOS and Android, I was pleasantly surprised and it helps out a lot on a project I am working on. I am going to start working on a fork and cleaning this up so we can merge it in to master.

ChaseFlorell commented 6 years ago

this sounds really good. Once your PR is in, I should be able to pull together a new Nuget Package release fairly quickly. The latest develop branch also contains new support for handling INotifyDataErrorInfo, so you can set validation really easily on your Controls. I think I need to put together a blog post about it.