Sample: Material 3 handler customization — .NET MAUI 11 Preview 5#773
Open
davidortinau wants to merge 1 commit into
Open
Sample: Material 3 handler customization — .NET MAUI 11 Preview 5#773davidortinau wants to merge 1 commit into
davidortinau wants to merge 1 commit into
Conversation
Demonstrates the now-public Android Material 3 helper types and Handler2 classes (dotnet/maui#35323, closes dotnet/maui#35124). Includes: - <UseMaterial3>true</UseMaterial3> to opt in to the Material 3 handlers - MyMaterialEditText : MauiMaterialEditText subclass that uppercases characters as they are typed - EditorHandler2.PlatformViewFactory wired in #if ANDROID, mirroring the default CreatePlatformView setup so theming + IME behaviour are preserved - docregions for inclusion in docs/user-interface/material-design.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new sample under
11.0/UserInterface/Material3/Material3HandlerCustomization/that demonstrates the now-public Android Material 3 helper types and Handler2 classes added in .NET MAUI 11 Preview 5 (dotnet/maui#35323, closes dotnet/maui#35124).In prior previews, types like
MauiMaterialEditText,MauiMaterialContextThemeWrapper, and theHandler2Editor / Picker / RadioButton / TimePicker / Label classes wereinternal. Preview 5 makes thempublicand adds aPlatformViewFactoryhook so an app can return its own subclass without touching the rest of the handler pipeline.What the sample shows
<UseMaterial3>true</UseMaterial3>to opt in to the Material 3 handler set on AndroidMyMaterialEditText : MauiMaterialEditTextsubclass that uppercases characters as they're typedEditorHandler2.PlatformViewFactory = ...wired inside#if ANDROID, mirroring the defaultCreatePlatformViewsetup (MauiMaterialContextThemeWrapper.Create,ImeOptions=Done,Gravity=Top,TextAlignment=ViewStart, single-line and horizontal-scroll disabled) so theming and IME behaviour are preservedThe customisation is Android-only; the page falls back to the default
Editorhandler on iOS, Mac Catalyst, and Windows so the app launches cleanly on every platform.Note
11.0/Directory.Build.propspin to Preview 3 applies here too — see the BoxView.Fill PR description.