Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
285 changes: 105 additions & 180 deletions docs/maui-coverage.md

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions src/Microsoft.AndroidX.Compose.Maui.Sample/Pages/ButtonsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,75 @@
x:Name="ClickCountLabel"
Text="No clicks yet" />

<!-- New mapper coverage from the keys-fill PR. -->
<Label
Text="-- New mapper coverage --"
FontAttributes="Bold" />

<Label Text="CharacterSpacing — letters spread out." />
<Button Text="Wide letters"
CharacterSpacing="6"
HorizontalOptions="Start"
Clicked="OnButtonClicked" />

<Label Text="CornerRadius — pill shape (50)." />
<Button Text="Pill"
CornerRadius="50"
BackgroundColor="{StaticResource Primary}"
TextColor="White"
HorizontalOptions="Start"
Clicked="OnButtonClicked" />

<Label Text="CornerRadius — sharp corners (0)." />
<Button Text="Sharp"
CornerRadius="0"
BackgroundColor="{StaticResource Primary}"
TextColor="White"
HorizontalOptions="Start"
Clicked="OnButtonClicked" />

<Label Text="Font — large bold." />
<Button Text="Big bold"
FontSize="24"
FontAttributes="Bold"
HorizontalOptions="Start"
Clicked="OnButtonClicked" />

<Label Text="Padding — generous internal space." />
<Button Text="Padded"
Padding="40,20"
BackgroundColor="#FFCDD2"
TextColor="#B71C1C"
HorizontalOptions="Start"
Clicked="OnButtonClicked" />

<Label Text="StrokeColor + StrokeThickness — outlined button." />
<Button Text="Outlined"
BackgroundColor="Transparent"
TextColor="#1976D2"
BorderColor="#1976D2"
BorderWidth="2"
HorizontalOptions="Start"
Clicked="OnButtonClicked" />

<Label Text="StrokeColor + StrokeThickness — heavy stroke." />
<Button Text="Heavy outline"
BackgroundColor="Transparent"
TextColor="#E91E63"
BorderColor="#E91E63"
BorderWidth="4"
CornerRadius="20"
HorizontalOptions="Start"
Clicked="OnButtonClicked" />

<Label Text="ImageSource — leading icon (dotnet_bot)." />
<Button Text="With image"
ImageSource="dotnet_bot.png"
BackgroundColor="{StaticResource Primary}"
TextColor="White"
HorizontalOptions="Start"
Clicked="OnButtonClicked" />

</VerticalStackLayout>
</ScrollView>

Expand Down
43 changes: 43 additions & 0 deletions src/Microsoft.AndroidX.Compose.Maui.Sample/Pages/EditorPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,49 @@
MaxLength="30"
HeightRequest="100" />

<!-- New mapper coverage from the keys-fill PR. -->
<Label Text="-- New mapper coverage --"
FontAttributes="Bold" />

<Label Text="CharacterSpacing — wide-set glyphs." />
<Editor Text="Spaced out paragraph used to verify CharacterSpacing maps through to Compose's letterSpacing TextStyle slot."
CharacterSpacing="3"
HeightRequest="120" />

<Label Text="HorizontalTextAlignment — Center." />
<Editor Text="Each line is centered — verify Compose's textAlign mapping for multi-line."
HorizontalTextAlignment="Center"
HeightRequest="100" />

<Label Text="HorizontalTextAlignment — End." />
<Editor Text="Right-aligned multi-line content for the End case."
HorizontalTextAlignment="End"
HeightRequest="100" />

<Label Text="IsSpellCheckEnabled / IsTextPredictionEnabled = False (no autocorrect, no red squiggles)." />
<Editor Placeholder="Type 'teh' — won't be corrected"
IsSpellCheckEnabled="False"
IsTextPredictionEnabled="False"
HeightRequest="80" />

<Label Text="PlaceholderColor — orange hint." />
<Editor Placeholder="Type to clear the orange hint"
PlaceholderColor="#FF9800"
HeightRequest="80" />

<Label Text="CursorPosition + SelectionLength — programmatic caret control." />
<Editor x:Name="CursorEditor"
Text="The quick brown fox jumps over the lazy dog"
HeightRequest="100" />
<HorizontalStackLayout Spacing="8">
<Button Text="Caret = 0" Clicked="OnEditorCaretStart" />
<Button Text="Caret = end" Clicked="OnEditorCaretEnd" />
<Button Text="Select 'quick'" Clicked="OnEditorSelectQuick" />
</HorizontalStackLayout>
<Label x:Name="EditorCursorEcho"
Text="Caret: 0 Selection length: 0"
FontAttributes="Italic" />

</VerticalStackLayout>
</ScrollView>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,33 @@ void OnNoteTextChanged(object? sender, TextChangedEventArgs e)
StringSplitOptions.RemoveEmptyEntries).Length;
WordCountLabel.Text = $"Words: {words} Characters: {text.Length}";
}

void OnEditorCaretStart(object? sender, EventArgs e)
{
CursorEditor.CursorPosition = 0;
CursorEditor.SelectionLength = 0;
UpdateEditorCursorEcho();
}

void OnEditorCaretEnd(object? sender, EventArgs e)
{
var len = CursorEditor.Text?.Length ?? 0;
CursorEditor.CursorPosition = len;
CursorEditor.SelectionLength = 0;
UpdateEditorCursorEcho();
}

void OnEditorSelectQuick(object? sender, EventArgs e)
{
var text = CursorEditor.Text ?? string.Empty;
var idx = text.IndexOf("quick", StringComparison.Ordinal);
if (idx < 0) return;
CursorEditor.CursorPosition = idx;
CursorEditor.SelectionLength = "quick".Length;
UpdateEditorCursorEcho();
}

void UpdateEditorCursorEcho() =>
EditorCursorEcho.Text =
$"Caret: {CursorEditor.CursorPosition} Selection length: {CursorEditor.SelectionLength}";
}
71 changes: 71 additions & 0 deletions src/Microsoft.AndroidX.Compose.Maui.Sample/Pages/EntriesPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,77 @@
IsReadOnly="True"
HorizontalOptions="Fill" />

<!--
Section below covers the keys that landed in the
"Fill missing MAUI property-mapper keys" PR. Each
Entry exercises one specific new mapper so the
wire-up can be confirmed by eye.
-->
<Label Text="-- New mapper coverage --"
FontAttributes="Bold" />

<Label Text="CharacterSpacing — letters spread apart." />
<Entry Text="Spaced out characters"
CharacterSpacing="4"
HorizontalOptions="Fill" />

<Label Text="HorizontalTextAlignment — Start / Center / End." />
<Entry Text="Start aligned"
HorizontalTextAlignment="Start"
HorizontalOptions="Fill" />
<Entry Text="Center aligned"
HorizontalTextAlignment="Center"
HorizontalOptions="Fill" />
<Entry Text="End aligned"
HorizontalTextAlignment="End"
HorizontalOptions="Fill" />

<Label Text="MaxLength — capped at 8 characters." />
<Entry x:Name="MaxLengthEntry"
Placeholder="Max 8 chars"
MaxLength="8"
TextChanged="OnMaxLengthChanged"
HorizontalOptions="Fill" />
<Label x:Name="MaxLengthLabel"
Text="Type — entry will refuse the 9th character."
FontAttributes="Italic" />

<Label Text="ClearButtonVisibility=WhileEditing — trailing X clears the field." />
<Entry Placeholder="Type, then tap the X"
ClearButtonVisibility="WhileEditing"
HorizontalOptions="Fill" />

<Label Text="ReturnType — IME action key changes per Entry." />
<Entry Placeholder="ReturnType=Done" ReturnType="Done" HorizontalOptions="Fill" />
<Entry Placeholder="ReturnType=Go" ReturnType="Go" HorizontalOptions="Fill" />
<Entry Placeholder="ReturnType=Next" ReturnType="Next" HorizontalOptions="Fill" />
<Entry Placeholder="ReturnType=Search" ReturnType="Search" HorizontalOptions="Fill" />
<Entry Placeholder="ReturnType=Send" ReturnType="Send" HorizontalOptions="Fill" />

<Label Text="IsSpellCheckEnabled=False / IsTextPredictionEnabled=False — no red squiggles, no autocorrect bar." />
<Entry Placeholder="Type a typo: 'teh'"
IsSpellCheckEnabled="False"
IsTextPredictionEnabled="False"
HorizontalOptions="Fill" />

<Label Text="PlaceholderColor — pink hint." />
<Entry Placeholder="Pink hint until you type"
PlaceholderColor="#E91E63"
HorizontalOptions="Fill" />

<Label Text="CursorPosition + SelectionLength — buttons drive the caret." />
<Entry x:Name="CursorEntry"
Text="The quick brown fox"
HorizontalOptions="Fill" />
<HorizontalStackLayout Spacing="8">
<Button Text="Caret = 0" Clicked="OnCaretToStart" />
<Button Text="Caret = end" Clicked="OnCaretToEnd" />
<Button Text="Select 'quick'" Clicked="OnSelectQuick" />
</HorizontalStackLayout>
<Label x:Name="CursorEcho"
Text="Caret: 0 / 19 Selection length: 0"
FontAttributes="Italic" />

</VerticalStackLayout>
</ScrollView>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,44 @@ void OnNameTextChanged(object? sender, TextChangedEventArgs e)
? "Greeting will appear here."
: $"Hello, {e.NewTextValue}!";
}

void OnMaxLengthChanged(object? sender, TextChangedEventArgs e)
{
var text = e.NewTextValue ?? string.Empty;
MaxLengthLabel.Text = text.Length >= 8
? $"At cap ({text.Length}/8) — extra typing rejected."
: $"Length: {text.Length}/8";
}

void OnCaretToStart(object? sender, EventArgs e)
{
CursorEntry.CursorPosition = 0;
CursorEntry.SelectionLength = 0;
UpdateCursorEcho();
}

void OnCaretToEnd(object? sender, EventArgs e)
{
var len = CursorEntry.Text?.Length ?? 0;
CursorEntry.CursorPosition = len;
CursorEntry.SelectionLength = 0;
UpdateCursorEcho();
}

void OnSelectQuick(object? sender, EventArgs e)
{
var text = CursorEntry.Text ?? string.Empty;
var idx = text.IndexOf("quick", StringComparison.Ordinal);
if (idx < 0) return;
CursorEntry.CursorPosition = idx;
CursorEntry.SelectionLength = "quick".Length;
UpdateCursorEcho();
}

void UpdateCursorEcho()
{
var len = CursorEntry.Text?.Length ?? 0;
CursorEcho.Text =
$"Caret: {CursorEntry.CursorPosition} / {len} Selection length: {CursorEntry.SelectionLength}";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,39 @@
<Button x:Name="ShapeButton" Text="Toggle shape" Clicked="OnToggleShape" />
</HorizontalStackLayout>

<!-- New mapper coverage from the keys-fill PR. -->
<Label
Text="-- New mapper coverage --"
FontAttributes="Bold" />

<Label Text="HideSingle=True — single dot is hidden." />
<IndicatorView Count="1"
HideSingle="True"
IndicatorColor="LightGray"
SelectedIndicatorColor="MediumBlue"
IndicatorSize="10"
HorizontalOptions="Center" />
<Label Text="(nothing should appear above this line)"
FontAttributes="Italic"
HorizontalOptions="Center" />

<Label Text="HideSingle=False — single dot still shown." />
<IndicatorView Count="1"
HideSingle="False"
IndicatorColor="LightGray"
SelectedIndicatorColor="MediumBlue"
IndicatorSize="10"
HorizontalOptions="Center" />

<Label Text="MaximumVisible=3 (Count=10) — only 3 dots render." />
<IndicatorView Count="10"
Position="0"
MaximumVisible="3"
IndicatorColor="LightGray"
SelectedIndicatorColor="MediumBlue"
IndicatorSize="10"
HorizontalOptions="Center" />

</VerticalStackLayout>
</ScrollView>

Expand Down
29 changes: 29 additions & 0 deletions src/Microsoft.AndroidX.Compose.Maui.Sample/Pages/LabelsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,35 @@

<Label Text="Hello,&#10;Multi-line label.&#10;Line 3." />

<!-- New mapper coverage from the keys-fill PR. -->
<Label Text="-- New mapper coverage --"
FontAttributes="Bold" />

<Label Text="CharacterSpacing — wide letters."
CharacterSpacing="6" />

<Label Text="LineHeight — multi-line label, double-line-height."
LineHeight="2.0"
FontSize="16" />

<Label Text="LineHeight (default) — same content for comparison."
FontSize="16" />

<Label Text="Padding — pink chip with 12pt internal padding."
Padding="12,6"
BackgroundColor="#FFCDD2"
TextColor="#B71C1C"
HorizontalOptions="Start" />

<Label Text="TextDecorations=Underline"
TextDecorations="Underline" />

<Label Text="TextDecorations=Strikethrough"
TextDecorations="Strikethrough" />

<Label Text="TextDecorations=Underline,Strikethrough"
TextDecorations="Underline,Strikethrough" />

</VerticalStackLayout>
</ScrollView>

Expand Down
32 changes: 32 additions & 0 deletions src/Microsoft.AndroidX.Compose.Maui.Sample/Pages/PickersPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,38 @@
Clicked="OnResetClicked"
HorizontalOptions="Fill" />

<!-- New mapper coverage from the keys-fill PR. -->
<Label Text="-- New mapper coverage --"
FontAttributes="Bold" />

<Label Text="Picker.CharacterSpacing — wide letters."
FontAttributes="Bold" />
<Picker Title="Wide picker"
ItemsSource="{StaticResource Fruits}"
CharacterSpacing="3"
HorizontalOptions="Fill" />

<Label Text="Picker.HorizontalTextAlignment=Center."
FontAttributes="Bold" />
<Picker Title="Centered picker"
ItemsSource="{StaticResource Fruits}"
HorizontalTextAlignment="Center"
HorizontalOptions="Fill" />

<Label Text="DatePicker.CharacterSpacing — wide formatted date."
FontAttributes="Bold" />
<DatePicker x:Name="WideDate"
Format="MMM d, yyyy"
CharacterSpacing="3"
HorizontalOptions="Fill" />

<Label Text="TimePicker.CharacterSpacing — wide HH:mm."
FontAttributes="Bold" />
<TimePicker x:Name="WideTime"
Format="HH:mm"
CharacterSpacing="3"
HorizontalOptions="Fill" />

</VerticalStackLayout>
</ScrollView>

Expand Down
Loading
Loading