-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Picker Handlers #433
Picker Handlers #433
Conversation
@jsuarezruiz Needs a rebase. |
0fbcf44
to
c6981cf
Compare
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.
Just went through and made comments as I saw things or had questions. Some might be dumb, so you have been warned. XD
IList<string> Items { get; } | ||
IList ItemsSource { get; } |
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 these two concepts mean anything at the core layer? This feels a bit binding-y. Also, how will Comet do this? Are we maybe forcing something?
{ | ||
UIPickerView? _pickerView; |
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.
Just found this on the Apple docs. Probably not essential for now, maybe...
Important
UIPickerView and its descendants aren’t available when the user interface idiom is UIUserInterfaceIdiomMac.
https://developer.apple.com/documentation/uikit/uipickerview
src/Core/tests/DeviceTests/Handlers/Picker/PickerHandlerTests.cs
Outdated
Show resolved
Hide resolved
string GetNativeText(PickerHandler pickerHandler) => | ||
GetNativePicker(pickerHandler).Text; | ||
|
||
async Task ValidateNativeItemsSource(IPicker picker, int itemsCount) |
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.
I see this and the one below, are some tests missing that would have used it?
if (pickerView?.Model is PickerSource source) | ||
{ | ||
source.SelectedIndex = selectedIndex; | ||
source.SelectedItem = selectedIndex >= 0 ? picker.Items[selectedIndex] : null; |
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 we need to check for upper bounds here at all? selectedIndex >= 0 && selectedIndex < items.count
|
||
namespace Microsoft.Maui | ||
{ | ||
public class NativePicker : NativePickerBase |
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.
Can we merge these two types at all? Maybe even PickerManager?
|
||
namespace Microsoft.Maui | ||
{ | ||
internal static class PickerManager |
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.
Will something like this be used by TimePicker? Not sure how much overhead there is on this?
* PickerHandlers * Nullability fixes * Updated Picker device tests * New things in the tests! * Removed unnecessary Android Api level validation * Added Picker Items null validation in iOS PickerHandler * Moved Picker Handler tests between different classes * Renamed NativePicker to MauiPicker * Removed unused code from iOS PickerExtensions * Fix build error * Fix build error * Remove duplicate class Co-authored-by: Matthew Leibowitz <mattleibow@live.com> Co-authored-by: E.Z. Hart <hartez@gmail.com>
* PickerHandlers * Nullability fixes * Updated Picker device tests * New things in the tests! * Removed unnecessary Android Api level validation * Added Picker Items null validation in iOS PickerHandler * Moved Picker Handler tests between different classes * Renamed NativePicker to MauiPicker * Removed unused code from iOS PickerExtensions * Fix build error * Fix build error * Remove duplicate class Co-authored-by: Matthew Leibowitz <mattleibow@live.com> Co-authored-by: E.Z. Hart <hartez@gmail.com>
* TimePicker Handlers (#454) * TimePickerHandlers * Undo changes in sample * Add some nullability fixes * Fix build error * Changes from PR feedback * Fixed build error * Updated tests * Roll time picker and popup into one control * Move 24 hour view check to handler * Pull NSLocale -> CultureInfo code out to common property Co-authored-by: E.Z. Hart <hartez@users.noreply.github.com> Co-authored-by: E.Z. Hart <hartez@gmail.com> * CheckBoxHandlers (#432) * Rename ICheck -> ICheckBox, remove Color stuff (to be replaced with Brush later), fix DeviceTests * Implement CharacterSpacing property in EditorHandlers (#516) * Fix broken test and incorrect CharacterSpacing on iOS * Implement HorizontalTextAlignment property in EntryHandlers (#524) * Better text on example * Remove IView from ITextAlignment * Remove IView from IPlaceholder * Implement IsTextPredictionEnabled property on Editor (#515) * Initial implementation * Added Tests * Added PortHandler Attributes * Added Tests * Handle turning text prediction back on Co-authored-by: E.Z. Hart <hartez@gmail.com> * Implement ReturnType property in EntryHandlers (#518) * Implement CharacterSpacing property in SearchBarHandlers (#494) * Implement CharacterSpacing in SearchBarHandlers * Tests failing because of static * Rounding for Android * Fix iOS test * There! No magic numbers! * Fix rebase issuse and make SearchBar stuff work on iOS Co-authored-by: Matthew Leibowitz <mattleibow@live.com> Co-authored-by: E.Z. Hart <hartez@gmail.com> * Stepper Handlers (#517) * StepperHandlers * Fixed Stepper handler broken tests * Remove duplicate searchbar * Add IStepper interface Co-authored-by: E.Z. Hart <hartez@gmail.com> * IStepper.Increment -> IStepper.Step * Picker Handlers (#433) * PickerHandlers * Nullability fixes * Updated Picker device tests * New things in the tests! * Removed unnecessary Android Api level validation * Added Picker Items null validation in iOS PickerHandler * Moved Picker Handler tests between different classes * Renamed NativePicker to MauiPicker * Removed unused code from iOS PickerExtensions * Fix build error * Fix build error * Remove duplicate class Co-authored-by: Matthew Leibowitz <mattleibow@live.com> Co-authored-by: E.Z. Hart <hartez@gmail.com> * ActivityIndicator Handlers (#417) * ActivityIndicatorHandler * Register IActivityIndicator * Add comments to IActivityIndicator * Fix build error * Implement Font properties in SearchBarHandlers (#533) * Speed up PR builds (#510) Reduce the jobs and use the new pools * implement Font properties in SearchBarHandlers * Fix rebase issues Co-authored-by: Matthew Leibowitz <mattleibow@live.com> Co-authored-by: E.Z. Hart <hartez@gmail.com> * Implemented LineHeight on Label (#538) * Implemented LineHeight on Label (#368) * Fix-up after rebase Co-authored-by: E.Z. Hart <hartez@gmail.com> * Fix broken label tests; add some missing label tests; attributed string cleanup * Consolidate and rename extension method classes * Fix class names and de-duplicate methods * Centralize time extensions * Fix mapping Co-authored-by: Javier Suárez <javiersuarezruiz@hotmail.com> Co-authored-by: Glenn Hevey <glenn.hevey@gmail.com> Co-authored-by: Matthew Leibowitz <mattleibow@live.com> Co-authored-by: Amr <hassaninamr@yahoo.com>
Description of Change
Picker Handlers. This PR will allow adding a basic Picker support, in the firsts .NET MAUI Preview.
Related issues:
Platforms Affected