/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: MIT-0 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this * software and associated documentation files (the "Software"), to deal in the Software * without restriction, including without limitation the rights to use, copy, modify, * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.Collections.Generic; using System.Linq; using Android.App; using Android.OS; using Android.Runtime; using Android.Views; using Android.Widget; using AndroidApp.gRPC; using AndroidX.AppCompat.App; using Google.Android.Material.FloatingActionButton; using Mapsui; using Mapsui.Layers; using Mapsui.Projection; using Mapsui.Providers; using Mapsui.Styles; using Mapsui.UI.Android; using Mapsui.Utilities; namespace AndroidApp { [Activity(Label = "@string/app_name", Theme = "@style/AppTheme.NoActionBar", MainLauncher = true)] public class MainActivity : AppCompatActivity { /// /// The user fills out this order and submits it to the backend. /// private TacoOrder TacoOrder { get; set; } /// /// This map layer shows a dot that tracks the position of the order while it is in transit. /// private WritableLayer OrderPositionLayer { get; set; } protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.activity_main); // Initialize the order. TacoOrder = new TacoOrder(); // Hook up the domain name text field. var domainNameText = FindViewById(Resource.Id.domainNameText); domainNameText.TextChanged += (sender, e) => { TacoOrder.ServiceDomainName = e.Text.ToString().Trim(); FindViewById