diff options
author | Keith Packard <keithp@keithp.com> | 2015-05-31 23:09:18 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2015-05-31 23:09:18 -0700 |
commit | a533ea525620f194fd89fedad043659bb433d71b (patch) | |
tree | 717088ac146290cd2cdbf254fd0dbf17b0174ba0 | |
parent | 0beb02f1848e34892cca6e34ba83d6ca836d6df2 (diff) |
altosdroid: Switch from custom title to standard Holo theme
This gives us the menu button, which is awfully useful on devices
without a hardware version...
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | altosdroid/res/menu/option_menu.xml | 6 | ||||
-rw-r--r-- | altosdroid/res/values/CustomTheme.xml | 3 | ||||
-rw-r--r-- | altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java | 20 |
3 files changed, 9 insertions, 20 deletions
diff --git a/altosdroid/res/menu/option_menu.xml b/altosdroid/res/menu/option_menu.xml index 2109ae04..1b3142a8 100644 --- a/altosdroid/res/menu/option_menu.xml +++ b/altosdroid/res/menu/option_menu.xml @@ -22,9 +22,6 @@ <item android:id="@+id/disconnect" android:icon="@android:drawable/ic_notification_clear_all" android:title="@string/disconnect_device" /> - <item android:id="@+id/quit" - android:icon="@android:drawable/ic_menu_close_clear_cancel" - android:title="@string/quit" /> <item android:id="@+id/select_freq" android:icon="@android:drawable/ic_menu_preferences" android:title="@string/select_freq" /> @@ -40,4 +37,7 @@ <item android:id="@+id/map_type" android:icon="@android:drawable/ic_menu_mapmode" android:title="@string/map_type" /> + <item android:id="@+id/quit" + android:icon="@android:drawable/ic_menu_close_clear_cancel" + android:title="@string/quit" /> </menu> diff --git a/altosdroid/res/values/CustomTheme.xml b/altosdroid/res/values/CustomTheme.xml index 4daed1f8..6c701ea2 100644 --- a/altosdroid/res/values/CustomTheme.xml +++ b/altosdroid/res/values/CustomTheme.xml @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <resources> - <style name="CustomTheme" parent="android:Theme"> - <item name="android:windowNoTitle">false</item> + <style name="CustomTheme" parent="android:Theme.Holo"> </style> </resources> diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java index 5be9ba84..293dff7f 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java @@ -82,9 +82,6 @@ public class AltosDroid extends FragmentActivity implements AltosUnitsListener { private BluetoothAdapter mBluetoothAdapter = null; - // Layout Views - private TextView mTitle; - // Flight state values private TextView mCallsignView; private TextView mRSSIView; @@ -221,20 +218,20 @@ public class AltosDroid extends FragmentActivity implements AltosUnitsListener { if (telemetry_state.telemetry_rate != AltosLib.ao_telemetry_rate_38400) str = str.concat(String.format(" %d bps", AltosLib.ao_telemetry_rate_values[telemetry_state.telemetry_rate])); - mTitle.setText(str); + setTitle(str); } else { - mTitle.setText(R.string.title_connected_to); + setTitle(R.string.title_connected_to); } break; case TelemetryState.CONNECT_CONNECTING: if (telemetry_state.address != null) - mTitle.setText(String.format("Connecting to %s...", telemetry_state.address.name)); + setTitle(String.format("Connecting to %s...", telemetry_state.address.name)); else - mTitle.setText("Connecting to something..."); + setTitle("Connecting to something..."); break; case TelemetryState.CONNECT_DISCONNECTED: case TelemetryState.CONNECT_NONE: - mTitle.setText(R.string.title_not_connected); + setTitle(R.string.title_not_connected); break; } } @@ -427,9 +424,7 @@ public class AltosDroid extends FragmentActivity implements AltosUnitsListener { fm = getSupportFragmentManager(); // Set up the window layout - requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(R.layout.altosdroid); - getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title); // Create the Tabs and ViewPager mTabHost = (TabHost)findViewById(android.R.id.tabhost); @@ -447,11 +442,6 @@ public class AltosDroid extends FragmentActivity implements AltosUnitsListener { mTabsAdapter.addTab(mTabHost.newTabSpec("map").setIndicator(create_tab_view("Map")), TabMap.class, null); mTabsAdapter.addTab(mTabHost.newTabSpec("offmap").setIndicator(create_tab_view("OffMap")), TabMapOffline.class, null); - // Set up the custom title - mTitle = (TextView) findViewById(R.id.title_left_text); - mTitle.setText(R.string.app_name); - mTitle = (TextView) findViewById(R.id.title_right_text); - // Display the Version mVersion = (TextView) findViewById(R.id.version); mVersion.setText("Version: " + BuildInfo.version + |