made action bar optional in fullscreen mode (see #216)
This commit is contained in:
parent
e2f8c7c5cf
commit
0eaf076a75
@ -34,10 +34,12 @@
|
|||||||
<string name="pref_misc_cat">Misc</string>
|
<string name="pref_misc_cat">Misc</string>
|
||||||
<string name="pref_plugins">Plugins</string>
|
<string name="pref_plugins">Plugins</string>
|
||||||
<string name="pref_plugins_title">Available plugins</string>
|
<string name="pref_plugins_title">Available plugins</string>
|
||||||
<string name="pref_user_zoom">Show zoom control</string>
|
|
||||||
<string name="pref_user_zoom_sum">Shows +/- buttons even on multitouch capable devices.</string>
|
|
||||||
<string name="pref_user_loc">Display user location</string>
|
<string name="pref_user_loc">Display user location</string>
|
||||||
<string name="pref_user_loc_sum">Show users position on map</string>
|
<string name="pref_user_loc_sum">Show users position on map</string>
|
||||||
|
<string name="pref_user_zoom">Show zoom control</string>
|
||||||
|
<string name="pref_user_zoom_sum">Shows +/- buttons even on multitouch capable devices.</string>
|
||||||
|
<string name="pref_fullscreen_actionbar">Hide Action Bar in fullscreen mode</string>
|
||||||
|
<string name="pref_fullscreen_actionbar_sum">Nice for screenshots. Note: IITCM cannot be controlled without Action Bar.</string>
|
||||||
<string name="pref_force_https">Force https</string>
|
<string name="pref_force_https">Force https</string>
|
||||||
<string name="pref_force_https_sum">Disabling may improve performance</string>
|
<string name="pref_force_https_sum">Disabling may improve performance</string>
|
||||||
<string name="pref_developer_options">Developer options</string>
|
<string name="pref_developer_options">Developer options</string>
|
||||||
|
@ -12,15 +12,20 @@
|
|||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
android:key="pref_about_cat"
|
android:key="pref_about_cat"
|
||||||
android:title="@string/pref_ui_cat">
|
android:title="@string/pref_ui_cat">
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:key="pref_user_loc"
|
||||||
|
android:title="@string/pref_user_loc"
|
||||||
|
android:summary="@string/pref_user_loc_sum"
|
||||||
|
android:defaultValue="false" />
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:key="pref_user_zoom"
|
android:key="pref_user_zoom"
|
||||||
android:title="@string/pref_user_zoom"
|
android:title="@string/pref_user_zoom"
|
||||||
android:summary="@string/pref_user_zoom_sum"
|
android:summary="@string/pref_user_zoom_sum"
|
||||||
android:defaultValue="false" />
|
android:defaultValue="false" />
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:key="pref_user_loc"
|
android:key="pref_fullscreen_actionbar"
|
||||||
android:title="@string/pref_user_loc"
|
android:title="@string/pref_fullscreen_actionbar"
|
||||||
android:summary="@string/pref_user_loc_sum"
|
android:summary="@string/pref_fullscreen_actionbar_sum"
|
||||||
android:defaultValue="false" />
|
android:defaultValue="false" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ public class IITC_Mobile extends Activity {
|
|||||||
private LocationListener loc_listener = null;
|
private LocationListener loc_listener = null;
|
||||||
private boolean keyboad_open = false;
|
private boolean keyboad_open = false;
|
||||||
private boolean fullscreen_mode = false;
|
private boolean fullscreen_mode = false;
|
||||||
|
private boolean fullscreen_actionbar = false;
|
||||||
private ActionBar actionBar;
|
private ActionBar actionBar;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -58,6 +59,7 @@ public class IITC_Mobile extends Activity {
|
|||||||
actionBar.setTitle(getString(R.string.menu_map));
|
actionBar.setTitle(getString(R.string.menu_map));
|
||||||
actionBar.setHomeButtonEnabled(true);
|
actionBar.setHomeButtonEnabled(true);
|
||||||
|
|
||||||
|
// do something if user changed something in the settings
|
||||||
SharedPreferences sharedPref = PreferenceManager
|
SharedPreferences sharedPref = PreferenceManager
|
||||||
.getDefaultSharedPreferences(this);
|
.getDefaultSharedPreferences(this);
|
||||||
listener = new OnSharedPreferenceChangeListener() {
|
listener = new OnSharedPreferenceChangeListener() {
|
||||||
@ -67,6 +69,12 @@ public class IITC_Mobile extends Activity {
|
|||||||
if (key.equals("pref_user_loc"))
|
if (key.equals("pref_user_loc"))
|
||||||
user_loc = sharedPreferences.getBoolean("pref_user_loc",
|
user_loc = sharedPreferences.getBoolean("pref_user_loc",
|
||||||
false);
|
false);
|
||||||
|
if (key.equals("pref_fullscreen_actionbar")) {
|
||||||
|
fullscreen_actionbar =sharedPreferences.getBoolean("pref_fullscreen_actionbar",
|
||||||
|
false);
|
||||||
|
if (fullscreen_mode)
|
||||||
|
IITC_Mobile.this.getActionBar().hide();
|
||||||
|
}
|
||||||
IITC_Mobile.this.loadUrl(intel_url);
|
IITC_Mobile.this.loadUrl(intel_url);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -222,6 +230,8 @@ public class IITC_Mobile extends Activity {
|
|||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
// leave fullscreen mode if it is enabled
|
// leave fullscreen mode if it is enabled
|
||||||
if (fullscreen_mode) {
|
if (fullscreen_mode) {
|
||||||
|
if (fullscreen_actionbar)
|
||||||
|
this.getActionBar().show();
|
||||||
// show notification bar again
|
// show notification bar again
|
||||||
WindowManager.LayoutParams attrs = getWindow().getAttributes();
|
WindowManager.LayoutParams attrs = getWindow().getAttributes();
|
||||||
attrs.flags ^= WindowManager.LayoutParams.FLAG_FULLSCREEN;
|
attrs.flags ^= WindowManager.LayoutParams.FLAG_FULLSCREEN;
|
||||||
@ -280,6 +290,8 @@ public class IITC_Mobile extends Activity {
|
|||||||
// toggle fullscreen
|
// toggle fullscreen
|
||||||
case R.id.toggle_fullscreen :
|
case R.id.toggle_fullscreen :
|
||||||
if (!this.fullscreen_mode) {
|
if (!this.fullscreen_mode) {
|
||||||
|
if (fullscreen_actionbar)
|
||||||
|
this.getActionBar().hide();
|
||||||
// hide notification bar
|
// hide notification bar
|
||||||
WindowManager.LayoutParams attrs = getWindow()
|
WindowManager.LayoutParams attrs = getWindow()
|
||||||
.getAttributes();
|
.getAttributes();
|
||||||
@ -291,6 +303,8 @@ public class IITC_Mobile extends Activity {
|
|||||||
"Press back button to exit fullscreen",
|
"Press back button to exit fullscreen",
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
} else {
|
} else {
|
||||||
|
if (fullscreen_actionbar)
|
||||||
|
this.getActionBar().show();
|
||||||
// show notification bar again
|
// show notification bar again
|
||||||
WindowManager.LayoutParams attrs = getWindow()
|
WindowManager.LayoutParams attrs = getWindow()
|
||||||
.getAttributes();
|
.getAttributes();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user