Merge "Split ActionBar in Settings"
This commit is contained in:
committed by
Android (Google) Code Review
commit
22559fcac9
@@ -125,10 +125,6 @@
|
|||||||
android:value="com.android.settings.wifi.WifiSettings" />
|
android:value="com.android.settings.wifi.WifiSettings" />
|
||||||
<meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
|
<meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
|
||||||
android:resource="@id/wireless_settings" />
|
android:resource="@id/wireless_settings" />
|
||||||
<meta-data android:name="com.android.settings.PARENT_FRAGMENT_TITLE"
|
|
||||||
android:resource="@string/wireless_networks_settings_title" />
|
|
||||||
<meta-data android:name="com.android.settings.PARENT_FRAGMENT_CLASS"
|
|
||||||
android:value="com.android.settings.Settings$WirelessSettingsActivity" />
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity android:name=".wifi.WifiPickerActivity"
|
<activity android:name=".wifi.WifiPickerActivity"
|
||||||
@@ -233,10 +229,6 @@
|
|||||||
android:value="com.android.settings.bluetooth.BluetoothSettings" />
|
android:value="com.android.settings.bluetooth.BluetoothSettings" />
|
||||||
<meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
|
<meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
|
||||||
android:resource="@id/wireless_settings" />
|
android:resource="@id/wireless_settings" />
|
||||||
<meta-data android:name="com.android.settings.PARENT_FRAGMENT_TITLE"
|
|
||||||
android:resource="@string/wireless_networks_settings_title" />
|
|
||||||
<meta-data android:name="com.android.settings.PARENT_FRAGMENT_CLASS"
|
|
||||||
android:value="com.android.settings.Settings$WirelessSettingsActivity" />
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity-alias android:name=".bluetooth.AdvancedBluetoothSettings"
|
<activity-alias android:name=".bluetooth.AdvancedBluetoothSettings"
|
||||||
@@ -873,10 +865,6 @@
|
|||||||
android:value="com.android.settings.DevelopmentSettings" />
|
android:value="com.android.settings.DevelopmentSettings" />
|
||||||
<meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
|
<meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
|
||||||
android:resource="@id/application_settings" />
|
android:resource="@id/application_settings" />
|
||||||
<meta-data android:name="com.android.settings.PARENT_FRAGMENT_TITLE"
|
|
||||||
android:resource="@string/applications_settings_header" />
|
|
||||||
<meta-data android:name="com.android.settings.PARENT_FRAGMENT_CLASS"
|
|
||||||
android:value="com.android.settings.Settings$ApplicationSettingsActivity" />
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity-alias android:name="DevelopmentSettings"
|
<activity-alias android:name="DevelopmentSettings"
|
||||||
@@ -894,10 +882,6 @@
|
|||||||
android:value="com.android.settings.DevelopmentSettings" />
|
android:value="com.android.settings.DevelopmentSettings" />
|
||||||
<meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
|
<meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
|
||||||
android:resource="@id/application_settings" />
|
android:resource="@id/application_settings" />
|
||||||
<meta-data android:name="com.android.settings.PARENT_FRAGMENT_TITLE"
|
|
||||||
android:resource="@string/applications_settings_header" />
|
|
||||||
<meta-data android:name="com.android.settings.PARENT_FRAGMENT_CLASS"
|
|
||||||
android:value="com.android.settings.Settings$ApplicationSettingsActivity" />
|
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|
||||||
|
|
||||||
|
@@ -936,8 +936,8 @@
|
|||||||
|
|
||||||
<!-- Bluetooth settings: The title of the preference (list item) that initiates a scan for devices -->
|
<!-- Bluetooth settings: The title of the preference (list item) that initiates a scan for devices -->
|
||||||
<string name="bluetooth_preference_scan_title">Scan for devices</string>
|
<string name="bluetooth_preference_scan_title">Scan for devices</string>
|
||||||
<!-- Bluetooth settings: The title of the preference (list item) that finds nearby devices [CHAR LIMIT=30] -->
|
<!-- Bluetooth settings: The title of the action button that finds nearby devices [CHAR LIMIT=20] -->
|
||||||
<string name="bluetooth_preference_find_nearby_title">Find nearby devices</string>
|
<string name="bluetooth_preference_find_nearby_title">Scan</string>
|
||||||
<!-- Bluetooth settings: The sub heading for device settings. [CHAR LIMIT=30] -->
|
<!-- Bluetooth settings: The sub heading for device settings. [CHAR LIMIT=30] -->
|
||||||
<string name="bluetooth_preference_device_settings">Device settings</string>
|
<string name="bluetooth_preference_device_settings">Device settings</string>
|
||||||
<!-- Bluetooth settings: The sub heading for paired devices. [CHAR LIMIT=30] -->
|
<!-- Bluetooth settings: The sub heading for paired devices. [CHAR LIMIT=30] -->
|
||||||
|
@@ -76,6 +76,7 @@ public class Settings extends PreferenceActivity implements ButtonBarHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
setTheme(android.R.style.Theme_Holo_SplitActionBarWhenNarrow);
|
||||||
getMetaData();
|
getMetaData();
|
||||||
mInLocalHeaderSwitch = true;
|
mInLocalHeaderSwitch = true;
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -107,6 +108,10 @@ public class Settings extends PreferenceActivity implements ButtonBarHandler {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO Add support for android.R.id.home in all Setting's onOptionsItemSelected
|
||||||
|
// getActionBar().setDisplayOptions(ActionBar.DISPLAY_HOME_AS_UP,
|
||||||
|
// ActionBar.DISPLAY_HOME_AS_UP);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -40,9 +40,8 @@ import com.android.settings.R;
|
|||||||
public final class BluetoothSettings extends DeviceListPreferenceFragment {
|
public final class BluetoothSettings extends DeviceListPreferenceFragment {
|
||||||
private static final String TAG = "BluetoothSettings";
|
private static final String TAG = "BluetoothSettings";
|
||||||
|
|
||||||
private static final int MENU_ID_MAKE_DISCOVERABLE = Menu.FIRST;
|
private static final int MENU_ID_SCAN = Menu.FIRST;
|
||||||
private static final int MENU_ID_SCAN = Menu.FIRST + 1;
|
private static final int MENU_ID_ADVANCED = Menu.FIRST + 1;
|
||||||
private static final int MENU_ID_ADVANCED = Menu.FIRST + 2;
|
|
||||||
|
|
||||||
private BluetoothEnabler mBluetoothEnabler;
|
private BluetoothEnabler mBluetoothEnabler;
|
||||||
|
|
||||||
@@ -80,8 +79,6 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment {
|
|||||||
activity.getActionBar().setSubtitle(mLocalAdapter.getName());
|
activity.getActionBar().setSubtitle(mLocalAdapter.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO activity.setTheme(android.R.style.Theme_Holo_SplitActionBarWhenNarrow);
|
|
||||||
|
|
||||||
setHasOptionsMenu(true);
|
setHasOptionsMenu(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,23 +101,22 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||||
boolean bluetoothIsEnabled = mLocalAdapter.getBluetoothState() == BluetoothAdapter.STATE_ON;
|
boolean bluetoothIsEnabled = mLocalAdapter.getBluetoothState() == BluetoothAdapter.STATE_ON;
|
||||||
menu.add(Menu.NONE, MENU_ID_MAKE_DISCOVERABLE, 0, R.string.bluetooth_visibility)
|
|
||||||
.setEnabled(bluetoothIsEnabled);
|
|
||||||
menu.add(Menu.NONE, MENU_ID_SCAN, 0, R.string.bluetooth_preference_find_nearby_title)
|
menu.add(Menu.NONE, MENU_ID_SCAN, 0, R.string.bluetooth_preference_find_nearby_title)
|
||||||
.setIcon(R.drawable.ic_menu_scan_network).setEnabled(bluetoothIsEnabled);
|
//.setIcon(R.drawable.ic_menu_scan_network)
|
||||||
|
.setEnabled(bluetoothIsEnabled)
|
||||||
|
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
||||||
menu.add(Menu.NONE, MENU_ID_ADVANCED, 0, R.string.bluetooth_menu_advanced)
|
menu.add(Menu.NONE, MENU_ID_ADVANCED, 0, R.string.bluetooth_menu_advanced)
|
||||||
.setIcon(android.R.drawable.ic_menu_manage);
|
//.setIcon(android.R.drawable.ic_menu_manage)
|
||||||
|
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case MENU_ID_MAKE_DISCOVERABLE:
|
|
||||||
// TODO
|
// TODO
|
||||||
// if (mLocalAdapter.getBluetoothState() == BluetoothAdapter.STATE_ON) {
|
// if (mLocalAdapter.getBluetoothState() == BluetoothAdapter.STATE_ON) {
|
||||||
// onAddNetworkPressed();
|
// onAddNetworkPressed();
|
||||||
// }
|
// }
|
||||||
return true;
|
|
||||||
case MENU_ID_SCAN:
|
case MENU_ID_SCAN:
|
||||||
if (mLocalAdapter.getBluetoothState() == BluetoothAdapter.STATE_ON) {
|
if (mLocalAdapter.getBluetoothState() == BluetoothAdapter.STATE_ON) {
|
||||||
mLocalAdapter.startScanning(true);
|
mLocalAdapter.startScanning(true);
|
||||||
|
@@ -253,11 +253,16 @@ public class WifiSettings extends SettingsPreferenceFragment
|
|||||||
if (!mInXlSetupWizard) {
|
if (!mInXlSetupWizard) {
|
||||||
final boolean wifiIsEnabled = mWifiManager.isWifiEnabled();
|
final boolean wifiIsEnabled = mWifiManager.isWifiEnabled();
|
||||||
menu.add(Menu.NONE, MENU_ID_SCAN, 0, R.string.wifi_menu_scan)
|
menu.add(Menu.NONE, MENU_ID_SCAN, 0, R.string.wifi_menu_scan)
|
||||||
.setIcon(R.drawable.ic_menu_scan_network).setEnabled(wifiIsEnabled);
|
//.setIcon(R.drawable.ic_menu_scan_network)
|
||||||
|
.setEnabled(wifiIsEnabled)
|
||||||
|
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
||||||
menu.add(Menu.NONE, MENU_ID_ADD_NETWORK, 0, R.string.wifi_add_network)
|
menu.add(Menu.NONE, MENU_ID_ADD_NETWORK, 0, R.string.wifi_add_network)
|
||||||
.setIcon(android.R.drawable.ic_menu_add).setEnabled(wifiIsEnabled);
|
//.setIcon(android.R.drawable.ic_menu_add)
|
||||||
|
.setEnabled(wifiIsEnabled)
|
||||||
|
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
||||||
menu.add(Menu.NONE, MENU_ID_ADVANCED, 0, R.string.wifi_menu_advanced)
|
menu.add(Menu.NONE, MENU_ID_ADVANCED, 0, R.string.wifi_menu_advanced)
|
||||||
.setIcon(android.R.drawable.ic_menu_manage);
|
//.setIcon(android.R.drawable.ic_menu_manage)
|
||||||
|
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
||||||
}
|
}
|
||||||
super.onCreateOptionsMenu(menu, inflater);
|
super.onCreateOptionsMenu(menu, inflater);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user