Skip to content

Commit

Permalink
- Force restart history
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Torres committed Mar 15, 2016
1 parent 174db20 commit 32f8984
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand All @@ -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();
}
});
Expand Down Expand Up @@ -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() {
Expand All @@ -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);
}
});
}

}
Expand Down

0 comments on commit 32f8984

Please sign in to comment.