async void HomeFragment_TripActionEndTripAsync(object sender, EventArgs e) { status = "NORMAL"; homeFragment.ResetAfterTrip(); ShowProgressDialogue(); LatLng pickupLatLng = new LatLng(newRideDetails.PickupLat, newRideDetails.PickupLng); double fares = await mapHelper.CalculateFares(pickupLatLng, mLastLatLng); CloseProgressDialogue(); newTripEventListener.EndTrip(fares); newTripEventListener = null; CollectPaymentFragment collectPaymentFragment = new CollectPaymentFragment(fares); collectPaymentFragment.Cancelable = false; var trans = SupportFragmentManager.BeginTransaction(); collectPaymentFragment.Show(trans, "pay"); collectPaymentFragment.PaymentCollected += (o, u) => { collectPaymentFragment.Dismiss(); }; AvailabilityListener.ReActivate(); }
public void TripEnd() { durationCounter.Stop(); double durationMins = int.Parse(durationCounter.ElapsedMilliseconds.ToString()) / 60000; double fares = mapHelper.CalculateFares(durationMins); newtripListener.EndTrip(fares); // Reset App After Trip; googleMap.Clear(); status = ""; rideDetailsView.Hidden = true; centerMarker.Hidden = false; tripButton.BackgroundColor = UIColor.FromRGB(24, 191, 242); tripButton.SetTitle("ARRIVED PICKUP", UIControlState.Normal); goOnlineButton.BackgroundColor = UIColor.FromRGB(7, 175, 18); goOnlineButton.SetTitle("GO OFFLINE", UIControlState.Normal); goOnlineButton.Enabled = true; availabiltyListener.ReActivate(); faresAmountText.Text = "$" + fares.ToString(); overlay.Hidden = false; colletPaymentView.Hidden = false; collectPayementButton.TouchUpInside += (o, obj) => { colletPaymentView.Hidden = true; overlay.Hidden = true; TopUpEarning(fares); }; }