Hide debug mode according to prefs
This commit is contained in:
parent
94b1663df6
commit
00f5b2f3b7
@ -100,6 +100,7 @@ public class IITC_Mobile extends Activity {
|
|||||||
}
|
}
|
||||||
if (key.equals("pref_advanced_menu")) {
|
if (key.equals("pref_advanced_menu")) {
|
||||||
mAdvancedMenu = sharedPreferences.getBoolean("pref_advanced_menu", false);
|
mAdvancedMenu = sharedPreferences.getBoolean("pref_advanced_menu", false);
|
||||||
|
mNavigationHelper.setDebugMode(mAdvancedMenu);
|
||||||
invalidateOptionsMenu();
|
invalidateOptionsMenu();
|
||||||
// no reload needed
|
// no reload needed
|
||||||
return;
|
return;
|
||||||
|
@ -52,8 +52,15 @@ public class IITC_NavigationHelper extends ActionBarDrawerToggle implements OnNa
|
|||||||
public NavigationAdapter() {
|
public NavigationAdapter() {
|
||||||
super(mIitc, android.R.layout.simple_list_item_1);
|
super(mIitc, android.R.layout.simple_list_item_1);
|
||||||
|
|
||||||
addAll(Pane.values());
|
add(Pane.MAP);
|
||||||
// TODO: remove debug according to preferences
|
add(Pane.INFO);
|
||||||
|
add(Pane.FULL);
|
||||||
|
add(Pane.COMPACT);
|
||||||
|
add(Pane.PUBLIC);
|
||||||
|
add(Pane.FACTION);
|
||||||
|
|
||||||
|
if (mPrefs.getBoolean("pref_advanced_menu", false))
|
||||||
|
add(Pane.DEBUG);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -255,6 +262,12 @@ public class IITC_NavigationHelper extends ActionBarDrawerToggle implements OnNa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDebugMode(boolean enabled) {
|
||||||
|
mNavigationAdapter.remove(Pane.DEBUG); // avoid duplicates
|
||||||
|
if (enabled)
|
||||||
|
mNavigationAdapter.add(Pane.DEBUG);
|
||||||
|
}
|
||||||
|
|
||||||
public void setFullscreen(boolean fullscreen) {
|
public void setFullscreen(boolean fullscreen) {
|
||||||
mFullscreen = fullscreen;
|
mFullscreen = fullscreen;
|
||||||
if (mFullscreen && mHideInFullscreen) {
|
if (mFullscreen && mHideInFullscreen) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user