refactor check for compass pressed
This commit is contained in:
parent
29c28aab0c
commit
503ba1c087
1 changed files with 9 additions and 4 deletions
|
@ -276,12 +276,17 @@ public class MapControlsLayer extends OsmandMapLayer {
|
|||
public void onClick(View v) {
|
||||
boolean followingMode = app.getRoutingHelper().isFollowingMode();
|
||||
|
||||
if (compassPressed + COMPASS_PRESSED_TIME_INTERVAL_MS > System.currentTimeMillis() || !followingMode) {
|
||||
if (followingMode) {
|
||||
if (compassPressed + COMPASS_PRESSED_TIME_INTERVAL_MS > System.currentTimeMillis()) {
|
||||
compassPressed = 0;
|
||||
mapActivity.getMapViewTrackingUtilities().switchRotateMapMode();
|
||||
} else {
|
||||
compassPressed = System.currentTimeMillis();
|
||||
app.showShortToastMessage(app.getString(R.string.press_again_to_change_the_map_orientation));
|
||||
}
|
||||
} else {
|
||||
compassPressed = 0;
|
||||
mapActivity.getMapViewTrackingUtilities().switchRotateMapMode();
|
||||
} else {
|
||||
compassPressed = System.currentTimeMillis();
|
||||
app.showShortToastMessage(app.getString(R.string.press_again_to_change_the_map_orientation));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue