Major milestone adding full control functionality: Controls Enhanced: - Entry/Editor: Full keyboard input, cursor navigation, selection, clipboard - CollectionView: Data binding, selection highlighting, scrolling - CheckBox/Switch/Slider: Interactive state management - Picker/DatePicker/TimePicker: Dropdown selection with popup overlays - ProgressBar/ActivityIndicator: Animated progress display - Button: Press/release visual states - Border/Frame: Rounded corners, stroke styling - Label: Text wrapping, alignment, decorations - Grid/StackLayout: Margin and padding support Features Added: - DisplayAlert dialogs with button actions - NavigationPage with toolbar and back navigation - Shell with flyout menu navigation - XAML value converters for data binding - Margin support in all layout containers - Popup overlay system for pickers New Samples: - TodoApp: Full CRUD task manager with NavigationPage - ShellDemo: Comprehensive control showcase Removed: - ControlGallery (replaced by ShellDemo) - LinuxDemo (replaced by TodoApp) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
64 lines
2.6 KiB
C#
64 lines
2.6 KiB
C#
// Licensed to the .NET Foundation under one or more agreements.
|
|
// The .NET Foundation licenses this file to you under the MIT license.
|
|
|
|
using Microsoft.Maui.Handlers;
|
|
|
|
namespace Microsoft.Maui.Platform;
|
|
|
|
/// <summary>
|
|
/// Linux handler for ActivityIndicator control.
|
|
/// </summary>
|
|
public partial class ActivityIndicatorHandler : ViewHandler<IActivityIndicator, SkiaActivityIndicator>
|
|
{
|
|
public static IPropertyMapper<IActivityIndicator, ActivityIndicatorHandler> Mapper = new PropertyMapper<IActivityIndicator, ActivityIndicatorHandler>(ViewHandler.ViewMapper)
|
|
{
|
|
[nameof(IActivityIndicator.IsRunning)] = MapIsRunning,
|
|
[nameof(IActivityIndicator.Color)] = MapColor,
|
|
[nameof(IView.IsEnabled)] = MapIsEnabled,
|
|
[nameof(IView.Background)] = MapBackground,
|
|
["BackgroundColor"] = MapBackgroundColor,
|
|
};
|
|
|
|
public static CommandMapper<IActivityIndicator, ActivityIndicatorHandler> CommandMapper = new(ViewHandler.ViewCommandMapper);
|
|
|
|
public ActivityIndicatorHandler() : base(Mapper, CommandMapper) { }
|
|
|
|
protected override SkiaActivityIndicator CreatePlatformView() => new SkiaActivityIndicator();
|
|
|
|
public static void MapIsRunning(ActivityIndicatorHandler handler, IActivityIndicator activityIndicator)
|
|
{
|
|
handler.PlatformView.IsRunning = activityIndicator.IsRunning;
|
|
}
|
|
|
|
public static void MapColor(ActivityIndicatorHandler handler, IActivityIndicator activityIndicator)
|
|
{
|
|
if (activityIndicator.Color != null)
|
|
handler.PlatformView.Color = activityIndicator.Color.ToSKColor();
|
|
handler.PlatformView.Invalidate();
|
|
}
|
|
|
|
public static void MapIsEnabled(ActivityIndicatorHandler handler, IActivityIndicator activityIndicator)
|
|
{
|
|
handler.PlatformView.IsEnabled = activityIndicator.IsEnabled;
|
|
handler.PlatformView.Invalidate();
|
|
}
|
|
|
|
public static void MapBackground(ActivityIndicatorHandler handler, IActivityIndicator activityIndicator)
|
|
{
|
|
if (activityIndicator.Background is SolidColorBrush solidBrush && solidBrush.Color != null)
|
|
{
|
|
handler.PlatformView.BackgroundColor = solidBrush.Color.ToSKColor();
|
|
handler.PlatformView.Invalidate();
|
|
}
|
|
}
|
|
|
|
public static void MapBackgroundColor(ActivityIndicatorHandler handler, IActivityIndicator activityIndicator)
|
|
{
|
|
if (activityIndicator is Microsoft.Maui.Controls.VisualElement ve && ve.BackgroundColor != null)
|
|
{
|
|
handler.PlatformView.BackgroundColor = ve.BackgroundColor.ToSKColor();
|
|
handler.PlatformView.Invalidate();
|
|
}
|
|
}
|
|
}
|