always exit app when map is focused and back button is pressed (fix for #650)
This commit is contained in:
parent
9a654ae8fa
commit
8f06d3678b
@ -66,7 +66,6 @@ public class IITC_Mobile extends Activity implements OnSharedPreferenceChangeLis
|
|||||||
|
|
||||||
// Used for custom back stack handling
|
// Used for custom back stack handling
|
||||||
private final Stack<Pane> mBackStack = new Stack<IITC_NavigationHelper.Pane>();
|
private final Stack<Pane> mBackStack = new Stack<IITC_NavigationHelper.Pane>();
|
||||||
private boolean mBackStackPush = true;
|
|
||||||
private Pane mCurrentPane = Pane.MAP;
|
private Pane mCurrentPane = Pane.MAP;
|
||||||
private boolean mBackButtonPressed = false;
|
private boolean mBackButtonPressed = false;
|
||||||
|
|
||||||
@ -397,7 +396,6 @@ public class IITC_Mobile extends Activity implements OnSharedPreferenceChangeLis
|
|||||||
}
|
}
|
||||||
|
|
||||||
Pane pane = mBackStack.pop();
|
Pane pane = mBackStack.pop();
|
||||||
mBackStackPush = false;
|
|
||||||
switchToPane(pane);
|
switchToPane(pane);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -405,11 +403,9 @@ public class IITC_Mobile extends Activity implements OnSharedPreferenceChangeLis
|
|||||||
// ensure no double adds
|
// ensure no double adds
|
||||||
if (pane == mCurrentPane) return;
|
if (pane == mCurrentPane) return;
|
||||||
|
|
||||||
if (mBackStackPush) {
|
// map pane is top-lvl. clear stack.
|
||||||
mBackStack.push(mCurrentPane);
|
if (pane == Pane.MAP) mBackStack.clear();
|
||||||
} else {
|
else mBackStack.push(mCurrentPane);
|
||||||
mBackStackPush = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
mCurrentPane = pane;
|
mCurrentPane = pane;
|
||||||
mNavigationHelper.switchTo(pane);
|
mNavigationHelper.switchTo(pane);
|
||||||
@ -465,8 +461,6 @@ public class IITC_Mobile extends Activity implements OnSharedPreferenceChangeLis
|
|||||||
|
|
||||||
switch (itemId) {
|
switch (itemId) {
|
||||||
case android.R.id.home:
|
case android.R.id.home:
|
||||||
mBackStack.clear();
|
|
||||||
mBackStackPush = false;
|
|
||||||
switchToPane(Pane.MAP);
|
switchToPane(Pane.MAP);
|
||||||
return true;
|
return true;
|
||||||
case R.id.reload_button:
|
case R.id.reload_button:
|
||||||
@ -517,7 +511,6 @@ public class IITC_Mobile extends Activity implements OnSharedPreferenceChangeLis
|
|||||||
mNavigationHelper.reset();
|
mNavigationHelper.reset();
|
||||||
mMapSettings.reset();
|
mMapSettings.reset();
|
||||||
mBackStack.clear();
|
mBackStack.clear();
|
||||||
mBackStackPush = true;
|
|
||||||
// iitc starts on map after reload
|
// iitc starts on map after reload
|
||||||
mCurrentPane = Pane.MAP;
|
mCurrentPane = Pane.MAP;
|
||||||
loadUrl(mIntelUrl);
|
loadUrl(mIntelUrl);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user