Xfx.Controls icon indicating copy to clipboard operation
Xfx.Controls copied to clipboard

XfxPicker

Open ChaseFlorell opened this issue 7 years ago • 9 comments

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.

ChaseFlorell avatar Mar 08 '17 21:03 ChaseFlorell

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.

SkyeHoefling avatar Jan 20 '18 18:01 SkyeHoefling

@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.

ChaseFlorell avatar Jan 20 '18 20:01 ChaseFlorell

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

SkyeHoefling avatar Jan 20 '18 22:01 SkyeHoefling

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

ChaseFlorell avatar Jan 21 '18 00:01 ChaseFlorell

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?

SkyeHoefling avatar Jan 21 '18 00:01 SkyeHoefling

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 avatar Jan 21 '18 00:01 ChaseFlorell

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?

ChaseFlorell avatar Jan 21 '18 00:01 ChaseFlorell

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.

SkyeHoefling avatar Jan 21 '18 04:01 SkyeHoefling

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.

ChaseFlorell avatar Jan 21 '18 05:01 ChaseFlorell