//private void SetUpMap(View view) //{ // if (GMap == null) // { // // FragmentManager.FindViewById<MapView>(Resource.Id.fragmentMap3).GetMapAsync(this); // } //} public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = null; view = inflater.Inflate(Resource.Layout.driver_tasks, container, false); lstTask = view.FindViewById <ListView>(Resource.Id.tasklistview); var result = GetTasks(); if (result.Result == TaskStatus.OK) { //LayoutInflater layoutInflater = LayoutInflater.From(Activity); //ViewGroup view_task = (ViewGroup)layoutInflater.Inflate(Resource.Layout.driver_header_task, null); //lstTask.AddHeaderView(view_task); bundle = savedInstanceState; _gpsService = new GPSService(Activity); _gpsService.UpdateLocation(); } else { FragmentTransaction transaction1 = this.FragmentManager.BeginTransaction(); TaskNotFoundActivity content = new TaskNotFoundActivity(); transaction1.Replace(Resource.Id.frameDriverlayout, content).AddToBackStack(null).Commit(); } return(view); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var view = inflater.Inflate(Resource.Layout.driver_box_management, container, false); Id = view.FindViewById <TextView>(Resource.Id.TaskManagementTextIdValue1); Weight = view.FindViewById <TextView>(Resource.Id.OrderManagementTexWeight1); Temperature = view.FindViewById <TextView>(Resource.Id.OrderManagementTextTemperature1); Battery = view.FindViewById <TextView>(Resource.Id.OrderManagementTexBattery1); Illumination = view.FindViewById <TextView>(Resource.Id.OrderManagementTextIllumination1); Humidity = view.FindViewById <TextView>(Resource.Id.OrderManagementTextHumidity1); Gate = view.FindViewById <TextView>(Resource.Id.OrderManagementTextState1); Lock = view.FindViewById <TextView>(Resource.Id.OrderManagementTextCastle1); Fold = view.FindViewById <TextView>(Resource.Id.OrderManagementTextRoleta1); Events = view.FindViewById <TextView>(Resource.Id.OrderManagementTextEvents1); var btn_order = view.FindViewById <Button>(Resource.Id.btn_about_order); btn_order.Click += delegate { try { FragmentTransaction transaction = this.FragmentManager.BeginTransaction(); MainOrderStatusActivity content = new MainOrderStatusActivity(); transaction.Replace(Resource.Id.frameDriverlayout, content).AddToBackStack(null).Commit(); } catch (Exception ex) { Toast.MakeText(Application.Context, ex.Message, ToastLength.Long); } }; var result = GetTasks(); if (result.Result == TaskStatus.OK) { GetOrderParameters(); } else if (result.Result == TaskStatus.OrderNotImplemented) { StaticUser.NamePadeAbsenceSomething = "OrderNotFoundForDriver"; Android.App.FragmentTransaction transaction1 = this.FragmentManager.BeginTransaction(); NotFoundOrdersActivity content = new NotFoundOrdersActivity(); transaction1.Replace(Resource.Id.frameDriverlayout, content); transaction1.Commit(); } else { FragmentTransaction ft = this.FragmentManager.BeginTransaction(); TaskNotFoundActivity act = new TaskNotFoundActivity(); ft.Replace(Resource.Id.frameDriverlayout, act); ft.Commit(); } return(view); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var view = inflater.Inflate(Resource.Layout.driver_map, container, false); lstTask = view.FindViewById <ListView>(Resource.Id.tasklistview); var result = GetTasks(); if (result.Result == TaskStatus.OK) { // Use this to return your custom view for this Fragment mMapView = view.FindViewById <MapView>(Resource.Id.fragmentMap3); var layout = view.FindViewById <SlidingUpPanelLayout>(Resource.Id.sliding_layout); var btn_open_map = view.FindViewById <Button>(Resource.Id.btn_open_map); view.FindViewById <TextView>(Resource.Id.txt_title_tasks).MovementMethod = new LinkMovementMethod(); lstTask = view.FindViewById <ListView>(Resource.Id.tasklistview); _gpsService = new GPSService(Activity); _gpsService.UpdateLocation(); // layout.ShadowDrawable = Resources.GetDrawable(Resource.Drawable.above_shadow); layout.AnchorPoint = 0.3f; layout.PanelExpanded += (s, e) => Log.Info(Tag, "PanelExpanded"); layout.PanelCollapsed += (s, e) => Log.Info(Tag, "PanelCollapsed"); layout.PanelAnchored += (s, e) => Log.Info(Tag, "PanelAnchored"); layout.PanelSlide += (s, e) => { if (e.SlideOffset < 0.2) { //if (SupportActionBar.IsShowing) // SupportActionBar.Hide(); } else { //if (!SupportActionBar.IsShowing) // SupportActionBar.Show(); } }; var actionBarHidden = savedInstanceState != null && savedInstanceState.GetBoolean(SavedStateActionBarHidden, false); //if (actionBarHidden) // SupportActionBar.Hide(); btn_open_map.Click += async delegate { var location = new Location(StaticTask.way_points[1].lat, StaticTask.way_points[1].lng); var options = new MapLaunchOptions { NavigationMode = NavigationMode.Driving }; try { await Map.OpenAsync(location, options); } catch (System.Exception ex) { Toast.MakeText(Activity, ex.Message, ToastLength.Long); } }; MapsInitializer.Initialize(Activity); // HomeService.SetListViewHeightBasedOnChildren(lstTask); switch (GooglePlayServicesUtil.IsGooglePlayServicesAvailable(Activity)) { case ConnectionResult.Success: Toast.MakeText(Activity, "SUCCESS", ToastLength.Long).Show(); mMapView.OnCreate(savedInstanceState); mMapView.GetMapAsync(this); break; case ConnectionResult.ServiceMissing: Toast.MakeText(Activity, "ServiceMissing", ToastLength.Long).Show(); break; case ConnectionResult.ServiceVersionUpdateRequired: Toast.MakeText(Activity, "Update", ToastLength.Long).Show(); break; default: Toast.MakeText(Activity, GooglePlayServicesUtil.IsGooglePlayServicesAvailable(Activity), ToastLength.Long).Show(); break; } } else { FragmentTransaction transaction1 = this.FragmentManager.BeginTransaction(); TaskNotFoundActivity content = new TaskNotFoundActivity(); transaction1.Replace(Resource.Id.frameDriverlayout, content); transaction1.Commit(); } return(view); }