From 32f8984d55552e3eb86aacfcf885f42cf8c483c7 Mon Sep 17 00:00:00 2001 From: Jose Torres Date: Mon, 14 Mar 2016 19:31:50 -0600 Subject: [PATCH] - Force restart history --- .../controllers/order/OrderStatusActivity.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/bentonow/bentonow/controllers/order/OrderStatusActivity.java b/app/src/main/java/com/bentonow/bentonow/controllers/order/OrderStatusActivity.java index 9423e22..792761b 100644 --- a/app/src/main/java/com/bentonow/bentonow/controllers/order/OrderStatusActivity.java +++ b/app/src/main/java/com/bentonow/bentonow/controllers/order/OrderStatusActivity.java @@ -111,7 +111,7 @@ public class OrderStatusActivity extends BaseFragmentActivity implements View.On private User mCurrentUser; private int iPositionStart = 0; private int iDurationDirections = 0; - private int iPadding = 300; + private int iPadding = 200; private double fRotation; private boolean bUseGoogleDirections; private boolean bGetGoogleDirections = true; @@ -257,6 +257,7 @@ public void onSuccess(int statusCode, Header[] headers, String responseString) { if (mOrderItem.getOrderId().equals(mOrderItem.getOrderId())) { bIsStillInProgress = true; if (!mOrder.getOrder_status().equals(mOrderItem.getOrder_status())) { + SharedPreferencesUtil.setAppPreference(SharedPreferencesUtil.ORDER_HISTORY_FORCE_REFRESH, true); mOrder = mOrderItem; updateStatus(true); DebugUtils.logDebug(TAG, "New Order Status:: " + mOrder.getOrder_status()); @@ -269,10 +270,10 @@ public void onSuccess(int statusCode, Header[] headers, String responseString) { } if (!bIsStillInProgress) { + SharedPreferencesUtil.setAppPreference(SharedPreferencesUtil.ORDER_HISTORY_FORCE_REFRESH, true); runOnUiThread(new Runnable() { @Override public void run() { - SharedPreferencesUtil.setAppPreference(SharedPreferencesUtil.ORDER_HISTORY_FORCE_REFRESH, true); OrderStatusActivity.this.finish(); } }); @@ -528,6 +529,7 @@ public void onDriverLocation(double lat, double lng) { if (mOrder.getOrder_status().equals("En Route")) { mHandler.removeCallbacks(mLoadingTask); mDriverLocation = new LatLng(lat, lng); + iPositionStart = 0; runOnUiThread(new Runnable() { @Override public void run() { @@ -551,7 +553,13 @@ public void onSuccess(int statusCode, Header[] headers, String responseString) { mWaypoint = GoogleDirectionParser.parseDirections(responseString); if (mWaypoint != null) { - sEta = LocationUtils.getStringSecondsLeft(mWaypoint.getDuration()); + sEta = String.format(getString(R.string.order_status_eta), LocationUtils.getStringSecondsLeft(mWaypoint.getDuration())); + runOnUiThread(new Runnable() { + @Override + public void run() { + findMarker(getDriverMarker()).setSnippet(sEta); + } + }); } }