am 1bf33372: am de7cc129: am 26bb2398: Merge "Fix layout with no access points" into jb-mr1-dev
* commit '1bf3337289e640f93bf16ae4436d96b7847ff91f':
Fix layout with no access points
diff --git a/src/com/android/settings/nfc/AndroidBeam.java b/src/com/android/settings/nfc/AndroidBeam.java
index 032681a..bf02c13 100644
--- a/src/com/android/settings/nfc/AndroidBeam.java
+++ b/src/com/android/settings/nfc/AndroidBeam.java
@@ -38,7 +38,6 @@
private ImageView mImageView;
private NfcAdapter mNfcAdapter;
private Switch mActionBarSwitch;
- private CharSequence mOldActivityTitle;
@Override
@@ -50,6 +49,7 @@
if (activity instanceof PreferenceActivity) {
PreferenceActivity preferenceActivity = (PreferenceActivity) activity;
+ if (preferenceActivity.onIsHidingHeaders() || !preferenceActivity.onIsMultiPane()) {
final int padding = activity.getResources().getDimensionPixelSize(
R.dimen.action_bar_switch_padding);
mActionBarSwitch.setPadding(0, 0, padding, 0);
@@ -59,10 +59,8 @@
ActionBar.LayoutParams.WRAP_CONTENT,
ActionBar.LayoutParams.WRAP_CONTENT,
Gravity.CENTER_VERTICAL | Gravity.END));
- if (!preferenceActivity.onIsMultiPane() || preferenceActivity.onIsHidingHeaders()) {
- mOldActivityTitle = getActivity().getTitle();
- activity.getActionBar().setTitle(R.string.android_beam_settings_title);
- }
+ activity.getActionBar().setTitle(R.string.android_beam_settings_title);
+ }
}
mActionBarSwitch.setOnCheckedChangeListener(this);
@@ -78,14 +76,6 @@
initView(mView);
return mView;
}
- @Override
- public void onDestroyView() {
- getActivity().getActionBar().setCustomView(null);
- if (mOldActivityTitle != null) {
- getActivity().getActionBar().setTitle(mOldActivityTitle);
- }
- super.onDestroyView();
- }
private void initView(View view) {
mActionBarSwitch.setOnCheckedChangeListener(this);