(this, RestartAppTest.ForceRestart, (e) =>
- {
- // We can force a restart by making a configuration change; in this case, we'll enter
- // Car Mode. (The easy way to do this is to change the orientation, but ControlGallery
- // handles orientation changes so they don't cause a restart.)
-
- var uiModeManager = UiModeManager.FromContext(this);
-
- if (uiModeManager.CurrentModeType == UiMode.TypeCar)
- {
- // If for some reason we're already in car mode, disable it
- uiModeManager.DisableCarMode(DisableCarModeFlags.None);
- }
-
- uiModeManager.EnableCarMode(EnableCarModeFlags.None);
-
- // And put things back to normal so we can keep running tests
- uiModeManager.DisableCarMode(DisableCarModeFlags.None);
-
- ((App)Microsoft.Maui.Controls.Application.Current).Reset();
- });
- }
- }
-}
-
diff --git a/src/Compatibility/ControlGallery/src/Android/Assets/WebImages/XamarinLogo.png b/src/Compatibility/ControlGallery/src/Android/Assets/WebImages/XamarinLogo.png
deleted file mode 100644
index 361e27822993..000000000000
Binary files a/src/Compatibility/ControlGallery/src/Android/Assets/WebImages/XamarinLogo.png and /dev/null differ
diff --git a/src/Compatibility/ControlGallery/src/Android/Assets/default.css b/src/Compatibility/ControlGallery/src/Android/Assets/default.css
deleted file mode 100644
index 9e32b419bda2..000000000000
--- a/src/Compatibility/ControlGallery/src/Android/Assets/default.css
+++ /dev/null
@@ -1,2 +0,0 @@
-html,body{margin:0;padding:10}
-body,p,h1{font-family:Chalkduster;font-style: italic;}
\ No newline at end of file
diff --git a/src/Compatibility/ControlGallery/src/Android/Assets/fonts/icons.xml b/src/Compatibility/ControlGallery/src/Android/Assets/fonts/icons.xml
deleted file mode 100644
index 1311b1049909..000000000000
--- a/src/Compatibility/ControlGallery/src/Android/Assets/fonts/icons.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/src/Compatibility/ControlGallery/src/Android/Assets/googlemap.html b/src/Compatibility/ControlGallery/src/Android/Assets/googlemap.html
deleted file mode 100644
index 165e4e90c659..000000000000
--- a/src/Compatibility/ControlGallery/src/Android/Assets/googlemap.html
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
- Google Maps
-
-
-
-
-map
-
-
diff --git a/src/Compatibility/ControlGallery/src/Android/Assets/googlemapsearch.html b/src/Compatibility/ControlGallery/src/Android/Assets/googlemapsearch.html
deleted file mode 100644
index a31af760957c..000000000000
--- a/src/Compatibility/ControlGallery/src/Android/Assets/googlemapsearch.html
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
- Place Searches
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Compatibility/ControlGallery/src/Android/Assets/local.html b/src/Compatibility/ControlGallery/src/Android/Assets/local.html
deleted file mode 100644
index ccc9bec3a73a..000000000000
--- a/src/Compatibility/ControlGallery/src/Android/Assets/local.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-Xamarin.Forms
-This is a local iOS Html page
-Go to Google
-
-
\ No newline at end of file
diff --git a/src/Compatibility/ControlGallery/src/Android/AttachedStateEffectRenderer.cs b/src/Compatibility/ControlGallery/src/Android/AttachedStateEffectRenderer.cs
deleted file mode 100644
index 2bdb39658219..000000000000
--- a/src/Compatibility/ControlGallery/src/Android/AttachedStateEffectRenderer.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System;
-using System.Linq;
-using Microsoft.Maui.Controls;
-using Microsoft.Maui.Controls.Compatibility.Platform.Android;
-using Microsoft.Maui.Controls.ControlGallery.Android;
-using Microsoft.Maui.Controls.ControlGallery.Effects;
-using Microsoft.Maui.Controls.Platform;
-
-[assembly: ExportEffect(typeof(AttachedStateEffectRenderer), AttachedStateEffect.EffectName)]
-namespace Microsoft.Maui.Controls.ControlGallery.Android
-{
- public class AttachedStateEffectRenderer : PlatformEffect
- {
- public AttachedStateEffect MyEffect { get; private set; }
-
- protected override void OnAttached()
- {
- MyEffect = Element.Effects.OfType().First();
- MyEffect.Attached(Element);
- }
-
- protected override void OnDetached()
- {
- MyEffect.Detached(Element);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Compatibility/ControlGallery/src/Android/BorderEffect.cs b/src/Compatibility/ControlGallery/src/Android/BorderEffect.cs
deleted file mode 100644
index e98b4142ad35..000000000000
--- a/src/Compatibility/ControlGallery/src/Android/BorderEffect.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using Microsoft.Maui.Controls.Compatibility.Platform.Android;
-using Microsoft.Maui.Controls.Platform;
-
-namespace Microsoft.Maui.Controls.ControlGallery.Android
-{
- public class BorderEffect : PlatformEffect
- {
- protected override void OnAttached()
- {
- Control.SetBackgroundColor(global::Android.Graphics.Color.Aqua);
-
- var childLabel = (Element as ScrollView)?.Content as Label;
- if (childLabel != null)
- childLabel.Text = "Success";
- }
-
- protected override void OnDetached()
- {
- Control.SetBackgroundColor(global::Android.Graphics.Color.Beige);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Compatibility/ControlGallery/src/Android/BrokenNativeControl.cs b/src/Compatibility/ControlGallery/src/Android/BrokenNativeControl.cs
deleted file mode 100644
index 8cbc7a3aeec0..000000000000
--- a/src/Compatibility/ControlGallery/src/Android/BrokenNativeControl.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-using System;
-using Android.Content;
-using Android.Graphics;
-using Android.Runtime;
-using Android.Util;
-using Android.Views;
-using Android.Widget;
-
-namespace Microsoft.Maui.Controls.ControlGallery.Android
-{
- ///
- /// This is a custom Android control which deliberately does some incorrect measuring
- ///
- internal class BrokenNativeControl : TextView
- {
- bool _on;
-
- public BrokenNativeControl(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
- {
- }
-
- public BrokenNativeControl(Context context) : base(context)
- {
- }
-
- public BrokenNativeControl(Context context, IAttributeSet attrs) : base(context, attrs)
- {
- }
-
- public BrokenNativeControl(Context context, IAttributeSet attrs, int defStyleAttr)
- : base(context, attrs, defStyleAttr)
- {
- }
-
- public BrokenNativeControl(Context context, IAttributeSet attrs, int defStyleAttr, int defStyleRes)
- : base(context, attrs, defStyleAttr, defStyleRes)
- {
- }
-
- public override bool OnTouchEvent(MotionEvent e)
- {
- _on = !_on;
-
- SetTypeface(null, _on ? TypefaceStyle.Bold : TypefaceStyle.Normal);
-
- return base.OnTouchEvent(e);
- }
-
- protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec)
- {
- int width = MeasureSpec.GetSize(widthMeasureSpec);
-
- // Force the width to 1/2 of what's being requested. This is deliberately wrong so we can demo
- // giving the LayoutExtensions an override to fix it with
- int widthSpec = MeasureSpec.MakeMeasureSpec(width / 2, MeasureSpec.GetMode(widthMeasureSpec));
-
- base.OnMeasure(widthSpec, heightMeasureSpec);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Compatibility/ControlGallery/src/Android/CacheService.cs b/src/Compatibility/ControlGallery/src/Android/CacheService.cs
deleted file mode 100644
index db721de4819f..000000000000
--- a/src/Compatibility/ControlGallery/src/Android/CacheService.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using Microsoft.Maui.Controls.ControlGallery;
-using IOPath = System.IO.Path;
-
-namespace Microsoft.Maui.Controls.ControlGallery.Android
-{
- public class CacheService : ICacheService
- {
- public void ClearImageCache()
- {
- throw new NotImplementedException("TODO: CACHING https://github.com/dotnet/runtime/issues/52332");
- }
- }
-}
\ No newline at end of file
diff --git a/src/Compatibility/ControlGallery/src/Android/ColorPicker.cs b/src/Compatibility/ControlGallery/src/Android/ColorPicker.cs
deleted file mode 100644
index 9e031815958f..000000000000
--- a/src/Compatibility/ControlGallery/src/Android/ColorPicker.cs
+++ /dev/null
@@ -1,166 +0,0 @@
-using System;
-using System.ComponentModel;
-using Android.Content;
-using Android.Views;
-using Android.Widget;
-using Microsoft.Maui.Controls.Compatibility.Platform.Android;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Platform;
-using Droid = Android;
-
-namespace Microsoft.Maui.Controls.ControlGallery.Android
-{
- public class ColorPickerView : ViewGroup
- //, INotifyPropertyChanged
- {
- static readonly int[] COLORS = new[] {
- new Droid.Graphics.Color(255,0,0,255).ToArgb(), new Droid.Graphics.Color(255,0,255,255).ToArgb(), new Droid.Graphics.Color(0,0,255,255).ToArgb(),
- new Droid.Graphics.Color(0,255,255,255).ToArgb(), new Droid.Graphics.Color(0,255,0,255).ToArgb(), new Droid.Graphics.Color(255,255,0,255).ToArgb(),
- new Droid.Graphics.Color(255,0,0,255).ToArgb()
- };
- Droid.Graphics.Point currentPoint;
- ColorPointer colorPointer;
- ImageView imageViewSelectedColor;
- ImageView imageViewPallete;
- Droid.Graphics.Color selectedColor;
- Droid.Graphics.Color previewColor;
-
- //public event PropertyChangedEventHandler PropertyChanged;
- public event EventHandler ColorPicked;
-
- public ColorPickerView(Context context, int minWidth, int minHeight) : base(context)
- {
- SelectedColor = Colors.Black.ToPlatform();
-
- SetMinimumHeight(minHeight);
- SetMinimumWidth(minWidth);
-
- imageViewPallete = new ImageView(context);
- imageViewPallete.Background = new Droid.Graphics.Drawables.GradientDrawable(Droid.Graphics.Drawables.GradientDrawable.Orientation.LeftRight, COLORS);
-
- imageViewPallete.Touch += (object sender, TouchEventArgs e) =>
- {
- if (e.Event.Action == MotionEventActions.Down || e.Event.Action == MotionEventActions.Move)
- {
- using (Droid.Graphics.Bitmap bitmap = Droid.Graphics.Bitmap.CreateBitmap(imageViewPallete.Width, imageViewPallete.Height, Droid.Graphics.Bitmap.Config.Argb8888))
- {
- Droid.Graphics.Canvas canvas = new Droid.Graphics.Canvas(bitmap);
- imageViewPallete.Background.Draw(canvas);
-
- currentPoint = new Droid.Graphics.Point((int)e.Event.GetX(), (int)e.Event.GetY());
- previewColor = GetCurrentColor(bitmap, (int)e.Event.GetX(), (int)e.Event.GetY());
- }
- }
- if (e.Event.Action == MotionEventActions.Up)
- {
- SelectedColor = previewColor;
- }
- };
-
- imageViewSelectedColor = new ImageView(context);
- colorPointer = new ColorPointer(context);
-
- AddView(imageViewPallete);
- AddView(imageViewSelectedColor);
- AddView(colorPointer);
- }
-
- public Droid.Graphics.Color SelectedColor
- {
- get
- {
- return selectedColor;
- }
-
- set
- {
- if (selectedColor == value)
- return;
-
- selectedColor = value;
- UpdateUi();
- OnPropertyChanged();
- OnColorPicked();
- }
- }
-
- protected override void OnLayout(bool changed, int left, int top, int right, int bottom)
- {
- var half = (bottom - top) / 2;
- var margin = 20;
-
- var palleteY = top + half;
-
- imageViewSelectedColor.Layout(left, top, right, bottom - half - margin);
- imageViewPallete.Layout(left, palleteY, right, bottom);
- colorPointer.Layout(left, palleteY, right, bottom);
- }
-
- void UpdateUi()
- {
- imageViewSelectedColor?.SetBackgroundColor(selectedColor);
- colorPointer?.UpdatePoint(currentPoint);
- }
-
- Droid.Graphics.Color GetCurrentColor(Droid.Graphics.Bitmap bitmap, int x, int y)
- {
- if (bitmap == null)
- return new Droid.Graphics.Color(255, 255, 255, 255);
-
- if (x < 0)
- x = 0;
- if (y < 0)
- y = 0;
- if (x >= bitmap.Width)
- x = bitmap.Width - 1;
- if (y >= bitmap.Height)
- y = bitmap.Height - 1;
-
- int color = bitmap.GetPixel(x, y);
- return new Droid.Graphics.Color(color);
- }
-
- void OnPropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null)
- {
- //PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
-
- void OnColorPicked()
- {
- ColorPicked?.Invoke(this, new EventArgs());
- }
- }
-
- public class ColorPointer : Droid.Views.View
- {
- Droid.Graphics.Paint colorPointerPaint;
- Droid.Graphics.Point currentPoint;
- Droid.Graphics.Point nextPoint;
-
- public ColorPointer(Context context) : base(context)
- {
-
- colorPointerPaint = new Droid.Graphics.Paint();
- colorPointerPaint.SetStyle(Droid.Graphics.Paint.Style.Stroke);
- colorPointerPaint.StrokeWidth = 5f;
- colorPointerPaint.SetARGB(255, 0, 0, 0);
-
- }
-
- public void UpdatePoint(Droid.Graphics.Point p)
- {
- if (p == null)
- return;
-
- if (currentPoint == null)
- currentPoint = nextPoint;
-
- nextPoint = p;
- }
-
- protected override void OnDraw(Droid.Graphics.Canvas canvas)
- {
- base.OnDraw(canvas);
- }
- }
-}
diff --git a/src/Compatibility/ControlGallery/src/Android/Compatibility.ControlGallery.Android.csproj b/src/Compatibility/ControlGallery/src/Android/Compatibility.ControlGallery.Android.csproj
deleted file mode 100644
index d8db09f905c4..000000000000
--- a/src/Compatibility/ControlGallery/src/Android/Compatibility.ControlGallery.Android.csproj
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
- $(_MauiDotNetTfm)-android
- 21
- Exe
- Microsoft.Maui.Controls.Compatibility.ControlGallery.Android
- Microsoft.Maui.Controls.Compatibility.ControlGallery.Android
- false
- disable
-
- IL2036;0618;0612
-
-
-
-
- $(DefineConstants);LEGACY_RENDERERS
- $(DefineConstants);ANDROID
-
-
-
- $(DefineConstants);ENABLE_TEST_CLOUD
- True
- $(MSBuildThisFileDirectory)../../../../../eng/debug.keystore
- android
- androiddebugkey
- android
-
-
-
- True
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Compatibility/ControlGallery/src/Android/Compatibility/Activity1.cs b/src/Compatibility/ControlGallery/src/Android/Compatibility/Activity1.cs
deleted file mode 100644
index 716cf7e4751a..000000000000
--- a/src/Compatibility/ControlGallery/src/Android/Compatibility/Activity1.cs
+++ /dev/null
@@ -1,181 +0,0 @@
-using System;
-using System.Diagnostics;
-using System.Globalization;
-using Android.App;
-using Android.Content;
-using Android.Content.PM;
-using Android.Content.Res;
-using Android.OS;
-using Android.Views;
-using Android.Widget;
-using Java.Interop;
-using Microsoft.Maui.Controls;
-using Microsoft.Maui.Controls.Compatibility;
-using Microsoft.Maui.Controls.ControlGallery;
-using Microsoft.Maui.Controls.ControlGallery.Android;
-using Microsoft.Maui.Controls.ControlGallery.Issues;
-using Microsoft.Maui.Controls.Compatibility.Platform.Android;
-using Microsoft.Maui.Controls.Compatibility.Platform.Android.AppLinks;
-using Microsoft.Maui.Graphics;
-using Microsoft.Maui.Platform;
-using AColor = Android.Graphics.Color;
-
-[assembly: Dependency(typeof(CacheService))]
-[assembly: Dependency(typeof(TestCloudService))]
-[assembly: ExportRenderer(typeof(DisposePage), typeof(DisposePageRenderer))]
-[assembly: ExportRenderer(typeof(DisposeLabel), typeof(DisposeLabelRenderer))]
-[assembly: ExportEffect(typeof(BorderEffect), "BorderEffect")]
-
-namespace Microsoft.Maui.Controls.ControlGallery.Android
-{
- public partial class Activity1
- {
- void AddNativeControls(NestedNativeControlGalleryPage page)
- {
- if (page.NativeControlsAdded)
- {
- return;
- }
-
- StackLayout sl = page.Layout;
-
- // Create and add a native TextView
- var textView = new TextView(this) { Text = "I am a native TextView", TextSize = 14 };
- sl?.Children.Add(textView);
-
- // Create and add a native Button
- var button = new global::Android.Widget.Button(this) { Text = "Click to change TextView font size" };
- float originalSize = textView.TextSize;
- button.Click += (sender, args) => { textView.TextSize = textView.TextSize == originalSize ? 24 : 14; };
-
- sl?.Children.Add(button.ToView());
-
- // Create a control which we know doesn't behave correctly with regard to measurement
- var difficultControl0 = new BrokenNativeControl(this)
- {
- Text = "This native control doesn't play nice with sizing, which is why it's all squished to one side."
- };
- var difficultControl1 = new BrokenNativeControl(this)
- {
- Text = "Same control, but with a custom GetDesiredSize delegate to accomodate it's sizing problems."
- };
-
- // Add a misbehaving control
- sl?.Children.Add(difficultControl0);
-
- // Add a misbehaving control with a custom delegate for GetDesiredSize
- sl?.Children.Add(difficultControl1, SizeBrokenControl);
-
- page.NativeControlsAdded = true;
- }
-
- static SizeRequest? SizeBrokenControl(NativeViewWrapperRenderer renderer,
- int widthConstraint, int heightConstraint)
- {
- global::Android.Views.View nativeView = renderer.Control;
-
- if ((widthConstraint == 0 && heightConstraint == 0) || nativeView == null)
- {
- return null;
- }
-
- int width = global::Android.Views.View.MeasureSpec.GetSize(widthConstraint);
- int widthSpec = global::Android.Views.View.MeasureSpec.MakeMeasureSpec(width * 2,
- global::Android.Views.View.MeasureSpec.GetMode(widthConstraint));
- nativeView.Measure(widthSpec, heightConstraint);
- var size = new Size(nativeView.MeasuredWidth, nativeView.MeasuredHeight);
- return new SizeRequest(size);
- }
-
- void AddNativeBindings(NativeBindingGalleryPage page)
- {
- if (page.NativeControlsAdded)
- return;
-
- StackLayout sl = page.Layout;
-
- var textView = new TextView(this)
- {
- TextSize = 14,
- Text = "This will be text"
- };
-
- var viewGroup = new LinearLayout(this);
- viewGroup.AddView(textView);
-
- var buttonColor = new global::Android.Widget.Button(this) { Text = "Change label Color" };
- buttonColor.Click += (sender, e) => textView.SetTextColor(Colors.Blue.ToAndroid());
-
- var colorPicker = new ColorPickerView(this, 200, 200);
-
- textView.SetBinding(nameof(textView.Text), new Binding("NativeLabel"));
- //this doesn't work because there's not TextColor property
- //textView.SetBinding("TextColor", new Binding("NativeLabelColor", converter: new ColorConverter()));
- colorPicker.SetBinding(nameof(colorPicker.SelectedColor), new Binding("NativeLabelColor", BindingMode.TwoWay, new ColorConverter()), "ColorPicked");
-
- sl?.Children.Add(viewGroup);
- sl?.Children.Add(buttonColor.ToView());
- sl?.Children.Add(colorPicker);
-
- page.NativeControlsAdded = true;
- }
-
- public class ColorConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (value is Color)
- return ((Color)value).ToAndroid();
-
- return null;
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (value is global::Android.Graphics.Color)
- return ((global::Android.Graphics.Color)value).ToColor();
-
- return null;
- }
- }
-
- [Export("NavigateToTest")]
- public bool NavigateToTest(string test)
- {
- return App.NavigateToTestPage(test);
- }
-
- [Export("Reset")]
- public void Reset()
- {
- App.Reset();
- }
-
- void SetUpForceRestartTest()
- {
- // Listen for messages from the app restart test
- MessagingCenter.Subscribe(this, RestartAppTest.ForceRestart, (e) =>
- {
- // We can force a restart by making a configuration change; in this case, we'll enter
- // Car Mode. (The easy way to do this is to change the orientation, but ControlGallery
- // handles orientation changes so they don't cause a restart.)
-
- var uiModeManager = UiModeManager.FromContext(this);
-
- if (uiModeManager.CurrentModeType == UiMode.TypeCar)
- {
- // If for some reason we're already in car mode, disable it
- uiModeManager.DisableCarMode(DisableCarModeFlags.None);
- }
-
- uiModeManager.EnableCarMode(EnableCarModeFlags.None);
-
- // And put things back to normal so we can keep running tests
- uiModeManager.DisableCarMode(DisableCarModeFlags.None);
-
- ((App)Microsoft.Maui.Controls.Application.Current).Reset();
- });
- }
- }
-}
-
diff --git a/src/Compatibility/ControlGallery/src/Android/Compatibility/ApiLabelRenderer.cs b/src/Compatibility/ControlGallery/src/Android/Compatibility/ApiLabelRenderer.cs
deleted file mode 100644
index 1830180561fc..000000000000
--- a/src/Compatibility/ControlGallery/src/Android/Compatibility/ApiLabelRenderer.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System;
-using Android.Content;
-using Android.OS;
-using Microsoft.Maui.Controls;
-using Microsoft.Maui.Controls.Compatibility;
-using Microsoft.Maui.Controls.ControlGallery;
-using Microsoft.Maui.Controls.ControlGallery.Android;
-using Microsoft.Maui.Controls.Compatibility.Platform.Android;
-using Microsoft.Maui.Controls.Platform;
-
-[assembly: ExportRenderer(typeof(ApiLabel), typeof(ApiLabelRenderer))]
-namespace Microsoft.Maui.Controls.ControlGallery.Android
-{
- public class ApiLabelRenderer : Microsoft.Maui.Controls.Compatibility.Platform.Android.FastRenderers.LabelRenderer
- {
- public ApiLabelRenderer(Context context) : base(context)
- {
- }
-
- protected override void OnElementChanged(ElementChangedEventArgs