diff --git a/.nuspec/Microsoft.Maui.Resizetizer.targets b/.nuspec/Microsoft.Maui.Resizetizer.targets index b1c863b24bcf..e3d597213113 100644 --- a/.nuspec/Microsoft.Maui.Resizetizer.targets +++ b/.nuspec/Microsoft.Maui.Resizetizer.targets @@ -398,8 +398,15 @@ + + + <_MauiSplashScreens Include="$(_MauiIntermediateSplashScreen)splash\*" /> + @@ -528,12 +535,6 @@ Images="@(MauiImage->Distinct())"> - - - diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 06d0ed08c528..8f1fe0ae8abd 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,16 +1,16 @@ - + https://github.com/dotnet/installer - 7a5b36b4a4b0c72f2e14dfb4e950e2c118a4f346 + 55859829cd6c1ba18e7782630579e88df970a049 https://github.com/dotnet/runtime 705ec75fc00dc5d62ffeae1b6d5439fd14ada9b4 - + https://github.com/xamarin/xamarin-android - 4506004286bfa3b44965ee8b69ffb9c1d8f580be + 0b8d593a61bb49120fdf817e8dfdbc4b33937772 https://github.com/xamarin/xamarin-macios diff --git a/eng/Versions.props b/eng/Versions.props index f0c9965c12a6..71f0fb34c145 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -1,7 +1,7 @@ - 6.0.400-rtm.22364.21 + 6.0.400-rtm.22371.2 6.0.7 @@ -9,7 +9,7 @@ 6.0.1 6.0.0 - 32.0.446 + 32.0.447 15.4.442 15.4.442 diff --git a/src/Controls/src/Core.Design/FlexEnumDesignTypeConverters.cs b/src/Controls/src/Core.Design/FlexEnumDesignTypeConverters.cs index 46d01120ae4d..658068795b7e 100644 --- a/src/Controls/src/Core.Design/FlexEnumDesignTypeConverters.cs +++ b/src/Controls/src/Core.Design/FlexEnumDesignTypeConverters.cs @@ -47,7 +47,7 @@ protected override string[] KnownValues "Start", "End", "SpaceBetween", - "SpaceAroun", + "SpaceAround", "SpaceEvenly", }; } diff --git a/src/Core/src/Handlers/Entry/EntryHandler.Android.cs b/src/Core/src/Handlers/Entry/EntryHandler.Android.cs index d707a93b188c..a75062126553 100644 --- a/src/Core/src/Handlers/Entry/EntryHandler.Android.cs +++ b/src/Core/src/Handlers/Entry/EntryHandler.Android.cs @@ -19,6 +19,7 @@ namespace Microsoft.Maui.Handlers public partial class EntryHandler : ViewHandler { Drawable? _clearButtonDrawable; + bool _clearButtonVisible; bool _set; protected override AppCompatEditText CreatePlatformView() @@ -127,21 +128,32 @@ public static void MapClearButtonVisibility(IEntryHandler handler, IEntry entry) handler.PlatformView?.UpdateClearButtonVisibility(entry, platformHandler.GetClearButtonDrawable); } - void OnTextChanged(object? sender, TextChangedEventArgs e) => - VirtualView?.UpdateText(e); + void OnTextChanged(object? sender, TextChangedEventArgs e) + { + if (VirtualView == null) + { + return; + } + + VirtualView.UpdateText(e); + MapClearButtonVisibility(this, VirtualView); + } - // This will eliminate additional native property setting if not required. void OnFocusedChange(object? sender, FocusChangeEventArgs e) { - if (VirtualView?.ClearButtonVisibility == ClearButtonVisibility.WhileEditing) - UpdateValue(nameof(IEntry.ClearButtonVisibility)); + if (VirtualView == null) + { + return; + } + + MapClearButtonVisibility(this, VirtualView); } // Check whether the touched position inbounds with clear button. void OnTouch(object? sender, TouchEventArgs e) => e.Handled = - VirtualView?.ClearButtonVisibility == ClearButtonVisibility.WhileEditing && - PlatformView.HandleClearButtonTouched(VirtualView.FlowDirection, e, GetClearButtonDrawable); + _clearButtonVisible && VirtualView != null && + PlatformView.HandleClearButtonTouched(VirtualView.GetEffectiveFlowDirection(), e, GetClearButtonDrawable); void OnEditorAction(object? sender, EditorActionEventArgs e) { @@ -166,5 +178,37 @@ private void OnSelectionChanged(object? sender, EventArgs e) if (VirtualView.SelectionLength != selectedTextLength) VirtualView.SelectionLength = selectedTextLength; } + + internal void ShowClearButton() + { + if (_clearButtonVisible) + { + return; + } + + var drawable = GetClearButtonDrawable(); + + if (VirtualView.GetEffectiveFlowDirection() == FlowDirection.RightToLeft) + { + PlatformView.SetCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null); + } + else + { + PlatformView.SetCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null); + } + + _clearButtonVisible = true; + } + + internal void HideClearButton() + { + if (!_clearButtonVisible) + { + return; + } + + PlatformView.SetCompoundDrawablesWithIntrinsicBounds(null, null, null, null); + _clearButtonVisible = false; + } } } \ No newline at end of file diff --git a/src/Core/src/Platform/Android/EditTextExtensions.cs b/src/Core/src/Platform/Android/EditTextExtensions.cs index 37200c614368..e9dbcaec5b21 100644 --- a/src/Core/src/Platform/Android/EditTextExtensions.cs +++ b/src/Core/src/Platform/Android/EditTextExtensions.cs @@ -16,6 +16,8 @@ public static class EditTextExtensions { public static void UpdateText(this EditText editText, IEntry entry) { + var previousTextLength = editText.Length(); + // Setting the text causes the cursor to reset to position zero // Therefore if: // User Types => VirtualView Updated => Triggers Native Update @@ -170,30 +172,16 @@ public static void UpdateIsReadOnly(this EditText editText, IEditor editor) editText.SetCursorVisible(isReadOnly); } + // TODO: NET7 hartez - Remove this, nothing uses it public static void UpdateClearButtonVisibility(this EditText editText, IEntry entry, Drawable? clearButtonDrawable) => UpdateClearButtonVisibility(editText, entry, () => clearButtonDrawable); + // TODO: NET7 hartez - Remove the getClearButtonDrawable parameter, nothing uses it public static void UpdateClearButtonVisibility(this EditText editText, IEntry entry, Func? getClearButtonDrawable) { - // Places clear button drawable at the end or start of the EditText based on FlowDirection. - void ShowClearButton() - { - var drawable = getClearButtonDrawable?.Invoke(); - - if (entry.GetEffectiveFlowDirection() == FlowDirection.RightToLeft) - { - editText.SetCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null); - } - else - { - editText.SetCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null); - } - } - - // Hides clear button drawable from the control. - void HideClearButton() + if (entry?.Handler is not EntryHandler entryHandler) { - editText.SetCompoundDrawablesWithIntrinsicBounds(null, null, null, null); + return; } bool isFocused = editText.IsFocused; @@ -205,11 +193,11 @@ void HideClearButton() if (shouldDisplayClearButton) { - ShowClearButton(); + entryHandler.ShowClearButton(); } else { - HideClearButton(); + entryHandler.HideClearButton(); } } @@ -377,7 +365,7 @@ internal static bool HandleClearButtonTouched(this EditText? platformView, FlowD if (motionEvent.Action != MotionEventActions.Up) return false; - var x = motionEvent.GetX(); + var x = motionEvent.RawX; var y = motionEvent.GetY(); if ((flowDirection != FlowDirection.LeftToRight diff --git a/src/Core/src/Platform/Android/MauiDatePicker.cs b/src/Core/src/Platform/Android/MauiDatePicker.cs index 29db9f1d0163..122de74b0350 100644 --- a/src/Core/src/Platform/Android/MauiDatePicker.cs +++ b/src/Core/src/Platform/Android/MauiDatePicker.cs @@ -39,23 +39,13 @@ public void OnClick(View? v) ShowPicker?.Invoke(); } - protected override void OnFocusChanged(bool gainFocus, [GeneratedEnum] FocusSearchDirection direction, Android.Graphics.Rect? previouslyFocusedRect) - { - base.OnFocusChanged(gainFocus, direction, previouslyFocusedRect); - - if (gainFocus) - { - if (Clickable) - CallOnClick(); - } - } - void Initialize() { if (Background != null) DrawableCompat.Wrap(Background); Focusable = true; + FocusableInTouchMode = false; Clickable = true; InputType = InputTypes.Null; diff --git a/src/Core/src/Platform/Android/MauiTimePicker.cs b/src/Core/src/Platform/Android/MauiTimePicker.cs index 6fa4c183262c..811d1fcff565 100644 --- a/src/Core/src/Platform/Android/MauiTimePicker.cs +++ b/src/Core/src/Platform/Android/MauiTimePicker.cs @@ -39,23 +39,13 @@ public void OnClick(View? v) ShowPicker?.Invoke(); } - protected override void OnFocusChanged(bool gainFocus, [GeneratedEnum] FocusSearchDirection direction, Android.Graphics.Rect? previouslyFocusedRect) - { - base.OnFocusChanged(gainFocus, direction, previouslyFocusedRect); - - if (gainFocus) - { - if (Clickable) - CallOnClick(); - } - } - void Initialize() { if (Background != null) DrawableCompat.Wrap(Background); Focusable = true; + FocusableInTouchMode = false; Clickable = true; InputType = InputTypes.Null; diff --git a/src/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt b/src/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt index e58ce8e1d83d..1130a9ab36cb 100644 --- a/src/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt +++ b/src/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt @@ -2127,7 +2127,6 @@ override Microsoft.Maui.Platform.LocalizedDigitsKeyListener.FilterFormatted(Java override Microsoft.Maui.Platform.LocalizedDigitsKeyListener.GetAcceptedChars() -> char[]! override Microsoft.Maui.Platform.LocalizedDigitsKeyListener.InputType.get -> Android.Text.InputTypes override Microsoft.Maui.Platform.MauiAccessibilityDelegateCompat.OnInitializeAccessibilityNodeInfo(Android.Views.View? host, AndroidX.Core.View.Accessibility.AccessibilityNodeInfoCompat? info) -> void -override Microsoft.Maui.Platform.MauiDatePicker.OnFocusChanged(bool gainFocus, Android.Views.FocusSearchDirection direction, Android.Graphics.Rect? previouslyFocusedRect) -> void override Microsoft.Maui.Platform.MauiMaterialButton.OnLayout(bool changed, int left, int top, int right, int bottom) -> void override Microsoft.Maui.Platform.MauiPicker.Dispose(bool disposing) -> void override Microsoft.Maui.Platform.MauiPicker.OnFocusChanged(bool gainFocus, Android.Views.FocusSearchDirection direction, Android.Graphics.Rect? previouslyFocusedRect) -> void @@ -2141,7 +2140,6 @@ override Microsoft.Maui.Platform.MauiSwipeView.OnAttachedToWindow() -> void override Microsoft.Maui.Platform.MauiSwipeView.OnInterceptTouchEvent(Android.Views.MotionEvent? e) -> bool override Microsoft.Maui.Platform.MauiSwipeView.OnTouchEvent(Android.Views.MotionEvent? e) -> bool override Microsoft.Maui.Platform.MauiTextView.OnLayout(bool changed, int l, int t, int r, int b) -> void -override Microsoft.Maui.Platform.MauiTimePicker.OnFocusChanged(bool gainFocus, Android.Views.FocusSearchDirection direction, Android.Graphics.Rect? previouslyFocusedRect) -> void override Microsoft.Maui.Platform.MauiWebChromeClient.Dispose(bool disposing) -> void override Microsoft.Maui.Platform.MauiWebViewClient.Dispose(bool disposing) -> void override Microsoft.Maui.Platform.MauiWebViewClient.OnPageFinished(Android.Webkit.WebView? view, string? url) -> void diff --git a/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt index 684ea4acb958..13a4a61445d7 100644 --- a/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -47,4 +47,7 @@ virtual Microsoft.Maui.Handlers.EntryHandler.GetClearButtonDrawable() -> Android *REMOVED*Microsoft.Maui.Platform.MauiDatePicker.MauiDatePicker(Android.Content.Context? context, Android.Util.IAttributeSet! attrs) -> void *REMOVED*Microsoft.Maui.Platform.MauiDatePicker.MauiDatePicker(Android.Content.Context? context) -> void virtual Microsoft.Maui.Platform.StackNavigationManager.OnDestinationChanged(AndroidX.Navigation.NavController! navController, AndroidX.Navigation.NavDestination! navDestination, Android.OS.Bundle? bundle) -> void -*REMOVED*virtual Microsoft.Maui.Platform.StackNavigationManager.OnDestinationChanged(AndroidX.Navigation.NavController! navController, AndroidX.Navigation.NavDestination! navDestination, Android.OS.Bundle! bundle) -> void \ No newline at end of file +*REMOVED*virtual Microsoft.Maui.Platform.StackNavigationManager.OnDestinationChanged(AndroidX.Navigation.NavController! navController, AndroidX.Navigation.NavDestination! navDestination, Android.OS.Bundle! bundle) -> void +override Microsoft.Maui.Handlers.ScrollViewHandler.GetDesiredSize(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size +*REMOVED* override Microsoft.Maui.Platform.MauiDatePicker.OnFocusChanged(bool gainFocus, Android.Views.FocusSearchDirection direction, Android.Graphics.Rect? previouslyFocusedRect) -> void +*REMOVED* override Microsoft.Maui.Platform.MauiTimePicker.OnFocusChanged(bool gainFocus, Android.Views.FocusSearchDirection direction, Android.Graphics.Rect? previouslyFocusedRect) -> void diff --git a/src/SingleProject/Resizetizer/src/TizenSplashUpdater.cs b/src/SingleProject/Resizetizer/src/TizenSplashUpdater.cs index 21cf5afcdd6f..7720b986b59d 100644 --- a/src/SingleProject/Resizetizer/src/TizenSplashUpdater.cs +++ b/src/SingleProject/Resizetizer/src/TizenSplashUpdater.cs @@ -26,22 +26,24 @@ public class TizenSplashUpdater : Task public override bool Execute() { var orientations = new List() { "portrait", "landscape" }; - var splashInfo = MauiSplashScreen?.Length > 0 ? ResizeImageInfo.Parse(MauiSplashScreen[0]) : null; + var splashInfo = ResizeImageInfo.Parse(MauiSplashScreen[0]); var image = splashInfo.OutputName + ".png"; - var sharedResFullPath = Path.GetFullPath(Path.Combine(IntermediateOutputPath, "shared/res/")); - var splashFullPath = Path.Combine(sharedResFullPath, splashDirectoryName); + var splashFullPath = Path.Combine(IntermediateOutputPath, splashDirectoryName); if (Directory.Exists(splashFullPath)) Directory.Delete(splashFullPath, true); Directory.CreateDirectory(splashFullPath); + var appTool = new SkiaSharpAppIconTools(splashInfo, Logger); + splashDpiMap.Clear(); foreach (var dpi in DpiPath.Tizen.SplashScreen) { - var imageOutputPath = Path.GetFullPath(Path.Combine(IntermediateOutputPath, dpi.Path)); - var imageFullPath = Path.Combine(imageOutputPath, image); + var destination = Resizer.GetFileDestination(splashInfo, dpi, IntermediateOutputPath); + destination = Path.ChangeExtension(destination, ".png"); + appTool.Resize(dpi, destination); - if (File.Exists(imageFullPath)) + if (File.Exists(destination)) { var resolution = dpi.Path.Split('-')[1].ToLower(); foreach (var orientation in orientations) @@ -52,24 +54,9 @@ public override bool Execute() splashDpiMap.Remove((resolution, orientation)); } splashDpiMap.Add((resolution, orientation), $"{splashDirectoryName}/{newImage}"); - UpdateColorAndMoveFile(splashInfo, GetScreenSize(resolution, orientation), imageFullPath, Path.Combine(splashFullPath, newImage)); + UpdateColorAndMoveFile(splashInfo, GetScreenSize(resolution, orientation), destination, Path.Combine(splashFullPath, newImage)); } } - else - { - Log.LogWarning($"Unable to find splash image at {imageFullPath}."); - return false; - } - } - - foreach (var dpi in DpiPath.Tizen.Image) - { - var imageOutputPath = Path.GetFullPath(Path.Combine(IntermediateOutputPath, dpi.Path)); - var imageFullPath = Path.Combine(imageOutputPath, image); - if (File.Exists(imageFullPath)) - { - File.Delete(imageFullPath); - } } return true;