Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #1155 - Map Info Dialog Glitch #1156

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,6 @@ public synchronized void clear() {
mMarkerData.clear();
mMarkerData = null;
}
if (mCustomInfoWindowAdapter != null) {
mCustomInfoWindowAdapter.cancelUpdates();
}
}

/**
Expand Down Expand Up @@ -532,17 +529,12 @@ public void onInfoWindowClick(Marker marker) {
// Show trip details screen for the vehicle associated with this marker
ObaTripStatus status = mMarkerData.getStatusFromMarker(marker);
if (status != null) {
// Stop any callbacks to refresh the vehicle marker popup balloons
mCustomInfoWindowAdapter.cancelUpdates();

if (status != null) {
if (mController != null && mController.getFocusedStopId() != null) {
TripDetailsActivity.start(mActivity, status.getActiveTripId(),
mController.getFocusedStopId(), TripDetailsListFragment.SCROLL_MODE_VEHICLE);
} else {
TripDetailsActivity.start(mActivity, status.getActiveTripId(),
TripDetailsListFragment.SCROLL_MODE_VEHICLE);
}
if (mController != null && mController.getFocusedStopId() != null) {
TripDetailsActivity.start(mActivity, status.getActiveTripId(),
mController.getFocusedStopId(), TripDetailsListFragment.SCROLL_MODE_VEHICLE);
} else {
TripDetailsActivity.start(mActivity, status.getActiveTripId(),
TripDetailsListFragment.SCROLL_MODE_VEHICLE);
}
}
}
Expand Down Expand Up @@ -960,11 +952,6 @@ public View getInfoContents(Marker marker) {
}
lastUpdatedView.setText(lastUpdated);

if (mMarkerRefreshHandler != null) {
mMarkerRefreshHandler.removeCallbacks(mMarkerRefresh);
mMarkerRefreshHandler.postDelayed(mMarkerRefresh, MARKER_REFRESH_PERIOD);
}

if (status.getOccupancyStatus() != null) {
// Real-time occupancy data
UIUtils.setOccupancyVisibilityAndColor(occupancyView, status.getOccupancyStatus(), OccupancyState.REALTIME);
Expand All @@ -978,27 +965,6 @@ public View getInfoContents(Marker marker) {
return view;
}

private final long MARKER_REFRESH_PERIOD = TimeUnit.SECONDS.toMillis(1);

private final Handler mMarkerRefreshHandler = new Handler();

private final Runnable mMarkerRefresh = new Runnable() {
public void run() {
if (mCurrentFocusVehicleMarker != null &&
mCurrentFocusVehicleMarker.isInfoWindowShown()) {
// Force an update of the marker balloon, so "last updated" time ticks up
mCurrentFocusVehicleMarker.showInfoWindow();
}
}
};

/**
* Cancels any pending updates of the marker balloon contents
*/
public void cancelUpdates() {
if (mMarkerRefreshHandler != null) {
mMarkerRefreshHandler.removeCallbacks(mMarkerRefresh);
}
}
}
}
}
Loading