From e5a720c38c3f2ec49771d0bb71a81dec2668744d Mon Sep 17 00:00:00 2001 From: Nathan Castle Date: Wed, 28 Nov 2018 11:07:44 -0800 Subject: [PATCH 1/8] Fix issue with unknown symbol in animate 3d graphic Using the unicode character in string literal didn't work, so use the unicode code directly. --- .../GraphicsOverlay/Animate3DGraphic/Animate3DGraphic.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/iOS/Xamarin.iOS/Samples/GraphicsOverlay/Animate3DGraphic/Animate3DGraphic.cs b/src/iOS/Xamarin.iOS/Samples/GraphicsOverlay/Animate3DGraphic/Animate3DGraphic.cs index 373762f2ae..a0bdff5ad3 100644 --- a/src/iOS/Xamarin.iOS/Samples/GraphicsOverlay/Animate3DGraphic/Animate3DGraphic.cs +++ b/src/iOS/Xamarin.iOS/Samples/GraphicsOverlay/Animate3DGraphic/Animate3DGraphic.cs @@ -325,9 +325,9 @@ private void AnimatePlane() { // Update stats display. _altitudeLabel.Text = $"{currentFrame.Elevation:F}m"; - _headingLabel.Text = $"{currentFrame.Heading:F}°"; - _pitchLabel.Text = $"{currentFrame.Pitch:F}°"; - _rollLabel.Text = $"{currentFrame.Roll:F}°"; + _headingLabel.Text = $"{currentFrame.Heading:F}\u00B0"; + _pitchLabel.Text = $"{currentFrame.Pitch:F}\u00B0"; + _rollLabel.Text = $"{currentFrame.Roll:F}\u00B0"; _progressLabel.Text = $"{missionProgress * 100:F}%"; }); From 0317df22841705d89ee698709b6c0c0c97d5b13f Mon Sep 17 00:00:00 2001 From: Nathan Castle Date: Wed, 28 Nov 2018 11:15:53 -0800 Subject: [PATCH 2/8] Add help label to closest facility interactive - iOS --- .../ClosestFacility/ClosestFacility.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/iOS/Xamarin.iOS/Samples/Network Analysis/ClosestFacility/ClosestFacility.cs b/src/iOS/Xamarin.iOS/Samples/Network Analysis/ClosestFacility/ClosestFacility.cs index c71371be86..07dca8702a 100644 --- a/src/iOS/Xamarin.iOS/Samples/Network Analysis/ClosestFacility/ClosestFacility.cs +++ b/src/iOS/Xamarin.iOS/Samples/Network Analysis/ClosestFacility/ClosestFacility.cs @@ -67,13 +67,29 @@ public override void LoadView() _myMapView = new MapView(); _myMapView.TranslatesAutoresizingMaskIntoConstraints = false; + UILabel helpLabel = new UILabel + { + Text = "Tap to show the route to the nearest facility.", + AdjustsFontSizeToFitWidth = true, + TextAlignment = UITextAlignment.Center, + BackgroundColor = UIColor.FromWhiteAlpha(0, .6f), + TextColor = UIColor.White, + Lines = 1, + TranslatesAutoresizingMaskIntoConstraints = false + }; + View = new UIView(); - View.AddSubviews(_myMapView); + View.AddSubviews(_myMapView, helpLabel); _myMapView.TopAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.TopAnchor).Active = true; _myMapView.BottomAnchor.ConstraintEqualTo(View.BottomAnchor).Active = true; _myMapView.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor).Active = true; _myMapView.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor).Active = true; + + helpLabel.TopAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.TopAnchor).Active = true; + helpLabel.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor).Active = true; + helpLabel.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor).Active = true; + helpLabel.HeightAnchor.ConstraintEqualTo(40).Active = true; } public override void ViewDidLoad() From 9660b6ff6370d77d86c4e2a6fba9f78fd2af6f5d Mon Sep 17 00:00:00 2001 From: Nathan Castle Date: Wed, 28 Nov 2018 11:30:19 -0800 Subject: [PATCH 3/8] Add status label to display drawing status - iOS --- .../DisplayDrawingStatus.cs | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/iOS/Xamarin.iOS/Samples/MapView/DisplayDrawingStatus/DisplayDrawingStatus.cs b/src/iOS/Xamarin.iOS/Samples/MapView/DisplayDrawingStatus/DisplayDrawingStatus.cs index be76c1f36f..9ecb88c13a 100644 --- a/src/iOS/Xamarin.iOS/Samples/MapView/DisplayDrawingStatus/DisplayDrawingStatus.cs +++ b/src/iOS/Xamarin.iOS/Samples/MapView/DisplayDrawingStatus/DisplayDrawingStatus.cs @@ -28,6 +28,7 @@ public class DisplayDrawingStatus : UIViewController // Hold references to the UI controls. private MapView _myMapView; private UIActivityIndicatorView _activityIndicator; + private UILabel _statusLabel; public DisplayDrawingStatus() { @@ -52,15 +53,31 @@ public override void LoadView() TranslatesAutoresizingMaskIntoConstraints = false }; + _statusLabel = new UILabel + { + Text = "Drawing status: Unknown", + AdjustsFontSizeToFitWidth = true, + TextAlignment = UITextAlignment.Center, + BackgroundColor = UIColor.FromWhiteAlpha(0, .6f), + TextColor = UIColor.White, + Lines = 1, + TranslatesAutoresizingMaskIntoConstraints = false + }; + View = new UIView(); - View.AddSubviews(_myMapView, _activityIndicator); + View.AddSubviews(_myMapView, _activityIndicator, _statusLabel); _myMapView.TopAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.TopAnchor).Active = true; _myMapView.BottomAnchor.ConstraintEqualTo(View.BottomAnchor).Active = true; _myMapView.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor).Active = true; _myMapView.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor).Active = true; - _activityIndicator.TopAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.TopAnchor).Active = true; + _statusLabel.TopAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.TopAnchor).Active = true; + _statusLabel.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor).Active = true; + _statusLabel.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor).Active = true; + _statusLabel.HeightAnchor.ConstraintEqualTo(40).Active = true; + + _activityIndicator.TopAnchor.ConstraintEqualTo(_statusLabel.BottomAnchor).Active = true; _activityIndicator.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor).Active = true; _activityIndicator.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor).Active = true; _activityIndicator.HeightAnchor.ConstraintEqualTo(40).Active = true; @@ -99,14 +116,17 @@ private void OnMapViewDrawStatusChanged(object sender, DrawStatusChangedEventArg // Make sure that the UI changes are done in the UI thread. BeginInvokeOnMainThread(() => { + // Show the activity indicator if the map is drawing. if (e.Status == DrawStatus.InProgress) { _activityIndicator.Hidden = false; + _statusLabel.Text = "Drawing status: In progress"; } else { _activityIndicator.Hidden = true; + _statusLabel.Text = "Drawing status: Completed"; } }); } From db9b3e2a918fb81f7406bef7d3e2986fdd1c9593 Mon Sep 17 00:00:00 2001 From: Nathan Castle Date: Wed, 28 Nov 2018 12:24:25 -0800 Subject: [PATCH 4/8] Improves spatial relationships - Android Increases indentation in the output. Set lines to avoid relayout and redrawing the map --- .../SpatialRelationships/SpatialRelationships.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Android/Xamarin.Android/Samples/Geometry/SpatialRelationships/SpatialRelationships.cs b/src/Android/Xamarin.Android/Samples/Geometry/SpatialRelationships/SpatialRelationships.cs index 5fd23800e7..091a8d70e1 100644 --- a/src/Android/Xamarin.Android/Samples/Geometry/SpatialRelationships/SpatialRelationships.cs +++ b/src/Android/Xamarin.Android/Samples/Geometry/SpatialRelationships/SpatialRelationships.cs @@ -166,28 +166,28 @@ private string GetOutputText(Geometry selectedGeometry) // Add the point relationships to the output if (selectedGeometry.GeometryType != GeometryType.Point) { - output += "\tRelationship(s) with Point:\n"; + output += " Relationship(s) with Point:\n"; foreach (SpatialRelationship relationship in pointRelationships) { - output += $"\t\t{relationship}\n"; + output += $" {relationship}\n"; } } // Add the polygon relationships to the output if (selectedGeometry.GeometryType != GeometryType.Polygon) { - output += "\tRelationship(s) with Polygon:\n"; + output += " Relationship(s) with Polygon:\n"; foreach (SpatialRelationship relationship in polygonRelationships) { - output += $"\t\t{relationship}\n"; + output += $" {relationship}\n"; } } // Add the polyline relationships to the output if (selectedGeometry.GeometryType != GeometryType.Polyline) { - output += "\tRelationship(s) with Polyline:\n"; + output += " Relationship(s) with Polyline:\n"; foreach (SpatialRelationship relationship in polylineRelationships) { - output += $"\t\t{relationship}\n"; + output += $" {relationship}\n"; } } @@ -224,7 +224,7 @@ private void CreateLayout() // Create a Textview for the results. _resultTextView = new TextView(this); - _resultTextView.SetMinHeight(350); + _resultTextView.SetMinLines(7); //Add the labels to the layout. layout.AddView(helpLabel); From 40087588e6c67caf3c44dcbbd62d8e0bcb79e297 Mon Sep 17 00:00:00 2001 From: Nathan Castle Date: Wed, 28 Nov 2018 12:33:37 -0800 Subject: [PATCH 5/8] Set background color on list transformations - android Ensure white text is readable on all devices. --- .../Samples/Geometry/ListTransformations/ListTransformations.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Android/Xamarin.Android/Samples/Geometry/ListTransformations/ListTransformations.cs b/src/Android/Xamarin.Android/Samples/Geometry/ListTransformations/ListTransformations.cs index 78849166e8..639bdef388 100644 --- a/src/Android/Xamarin.Android/Samples/Geometry/ListTransformations/ListTransformations.cs +++ b/src/Android/Xamarin.Android/Samples/Geometry/ListTransformations/ListTransformations.cs @@ -343,6 +343,7 @@ public override View GetView(int position, View convertView, ViewGroup parent) // Use white as the default text color (available transforms). transformTextView.SetTextColor(Android.Graphics.Color.White); + transformTextView.SetBackgroundColor(Android.Graphics.Color.DarkGray); // See if the transform is missing required projection engine files. If so, display the text in gray. if (thisTransform.IsMissingProjectionEngineFiles) From f07e764430e4dc64200f5182d7203fb23ca65e22 Mon Sep 17 00:00:00 2001 From: Nathan Castle Date: Wed, 28 Nov 2018 12:40:28 -0800 Subject: [PATCH 6/8] Display drawing status - add label - Android Keep the status display visible --- .../DisplayDrawingStatus/DisplayDrawingStatus.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Android/Xamarin.Android/Samples/MapView/DisplayDrawingStatus/DisplayDrawingStatus.cs b/src/Android/Xamarin.Android/Samples/MapView/DisplayDrawingStatus/DisplayDrawingStatus.cs index b060a6596f..e150081c8d 100644 --- a/src/Android/Xamarin.Android/Samples/MapView/DisplayDrawingStatus/DisplayDrawingStatus.cs +++ b/src/Android/Xamarin.Android/Samples/MapView/DisplayDrawingStatus/DisplayDrawingStatus.cs @@ -15,6 +15,7 @@ using Esri.ArcGISRuntime.UI; using Esri.ArcGISRuntime.UI.Controls; using System; +using Android.Views; namespace ArcGISRuntime.Samples.DisplayDrawingStatus { @@ -32,6 +33,9 @@ public class DisplayDrawingStatus : Activity // Waiting popup private AlertDialog _progressDialog; + // Status label + private TextView _statusLabel; + protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); @@ -75,10 +79,12 @@ private void OnDrawStatusChanged(object sender, DrawStatusChangedEventArgs e) if (e.Status == DrawStatus.InProgress) { _progressDialog.Show(); + _statusLabel.Text = "Drawing status: In progress"; } else { _progressDialog.Hide(); + _statusLabel.Text = "Drawing status: Complete"; } }); } @@ -88,7 +94,11 @@ private void CreateLayout() // Create a new vertical layout for the app LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical }; - // Add the map view to the layout + _statusLabel = new TextView(this); + _statusLabel.Text = "Drawing status: unknown"; + + // Add the views to the layout + layout.AddView(_statusLabel); layout.AddView(_myMapView); // Create an activity indicator From c19c893c33df460bb7d7c438afc3839e116a4f8b Mon Sep 17 00:00:00 2001 From: Nathan Castle Date: Fri, 14 Dec 2018 12:27:47 -0800 Subject: [PATCH 7/8] Fix issue where release mode forms iOS app doesn't have any samples This changes the linker mode to not link classes in the viewer app. Because the samples are accessed through reflection, the linker isn't able to see them in use and will remove them. --- src/Forms/iOS/ArcGISRuntime.Xamarin.Forms.iOS.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Forms/iOS/ArcGISRuntime.Xamarin.Forms.iOS.csproj b/src/Forms/iOS/ArcGISRuntime.Xamarin.Forms.iOS.csproj index d848e39d5f..d2ae6c39b4 100644 --- a/src/Forms/iOS/ArcGISRuntime.Xamarin.Forms.iOS.csproj +++ b/src/Forms/iOS/ArcGISRuntime.Xamarin.Forms.iOS.csproj @@ -41,7 +41,7 @@ ..\..\..\output\Forms\iPhoneSimulator\release\ prompt 4 - Full + SdkOnly i386, x86_64 false 10.1 From 412e6e5b679cd44276491e8d88e069d5541c1390 Mon Sep 17 00:00:00 2001 From: Nathan Castle Date: Fri, 14 Dec 2018 12:30:58 -0800 Subject: [PATCH 8/8] Remove unintentionally added whitespace --- .../Samples/MapView/DisplayDrawingStatus/DisplayDrawingStatus.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/iOS/Xamarin.iOS/Samples/MapView/DisplayDrawingStatus/DisplayDrawingStatus.cs b/src/iOS/Xamarin.iOS/Samples/MapView/DisplayDrawingStatus/DisplayDrawingStatus.cs index 9ecb88c13a..89ec1ffacb 100644 --- a/src/iOS/Xamarin.iOS/Samples/MapView/DisplayDrawingStatus/DisplayDrawingStatus.cs +++ b/src/iOS/Xamarin.iOS/Samples/MapView/DisplayDrawingStatus/DisplayDrawingStatus.cs @@ -116,7 +116,6 @@ private void OnMapViewDrawStatusChanged(object sender, DrawStatusChangedEventArg // Make sure that the UI changes are done in the UI thread. BeginInvokeOnMainThread(() => { - // Show the activity indicator if the map is drawing. if (e.Status == DrawStatus.InProgress) {