Mode code cleaning: remove obsolete references to EXTRA_NO_HEADERS

- the EXTRA_NO_HEADERS flag as no more meaning as we are showing
the Tiles (previously named "Headers") only in the Dashboard
(which is the main Settings screen)

Change-Id: I55656de0d28ca9c84adbe6647d870838b4ac230b
This commit is contained in:
Fabrice Di Meglio
2014-05-13 13:10:34 -07:00
parent e9326d2761
commit 15826d4ea1
13 changed files with 15 additions and 65 deletions

View File

@@ -46,7 +46,6 @@ public class ChooseLockGeneric extends SettingsActivity {
public Intent getIntent() {
Intent modIntent = new Intent(super.getIntent());
modIntent.putExtra(EXTRA_SHOW_FRAGMENT, ChooseLockGenericFragment.class.getName());
modIntent.putExtra(EXTRA_NO_HEADERS, true);
return modIntent;
}

View File

@@ -58,7 +58,6 @@ public class ChooseLockPassword extends SettingsActivity {
public Intent getIntent() {
Intent modIntent = new Intent(super.getIntent());
modIntent.putExtra(EXTRA_SHOW_FRAGMENT, ChooseLockPasswordFragment.class.getName());
modIntent.putExtra(EXTRA_NO_HEADERS, true);
return modIntent;
}

View File

@@ -63,7 +63,6 @@ public class ChooseLockPattern extends SettingsActivity {
public Intent getIntent() {
Intent modIntent = new Intent(super.getIntent());
modIntent.putExtra(EXTRA_SHOW_FRAGMENT, ChooseLockPatternFragment.class.getName());
modIntent.putExtra(EXTRA_NO_HEADERS, true);
return modIntent;
}

View File

@@ -48,7 +48,6 @@ public class ConfirmLockPassword extends SettingsActivity {
public Intent getIntent() {
Intent modIntent = new Intent(super.getIntent());
modIntent.putExtra(EXTRA_SHOW_FRAGMENT, ConfirmLockPasswordFragment.class.getName());
modIntent.putExtra(EXTRA_NO_HEADERS, true);
return modIntent;
}

View File

@@ -72,7 +72,6 @@ public class ConfirmLockPattern extends SettingsActivity {
public Intent getIntent() {
Intent modIntent = new Intent(super.getIntent());
modIntent.putExtra(EXTRA_SHOW_FRAGMENT, ConfirmLockPatternFragment.class.getName());
modIntent.putExtra(EXTRA_NO_HEADERS, true);
return modIntent;
}

View File

@@ -153,15 +153,6 @@ public class SettingsActivity extends Activity
*/
public static final String EXTRA_FRAGMENT_ARG_KEY = ":settings:fragment_args_key";
/**
* When starting this activity, the invoking Intent can contain this extra
* boolean that the header list should not be displayed. This is most often
* used in conjunction with {@link #EXTRA_SHOW_FRAGMENT} to launch
* the activity to display a specific fragment that the user has navigated
* to.
*/
public static final String EXTRA_NO_HEADERS = ":settings:no_headers";
public static final String BACK_STACK_PREFS = ":settings:prefs";
// extras that allow any preference activity to be launched as part of a wizard
@@ -670,17 +661,6 @@ public class SettingsActivity extends Activity
return false;
}
/**
* Called to determine whether the header list should be hidden.
* The default implementation returns the
* value given in {@link #EXTRA_NO_HEADERS} or false if it is not supplied.
* This is set to false, for example, when the activity is being re-launched
* to show a particular preference activity.
*/
public boolean onIsHidingHeaders() {
return getIntent().getBooleanExtra(EXTRA_NO_HEADERS, false);
}
@Override
public Intent getIntent() {
Intent superIntent = super.getIntent();

View File

@@ -555,7 +555,6 @@ public class Utils {
intent.putExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT, fragmentName);
intent.putExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT_ARGUMENTS, args);
intent.putExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT_TITLE, title);
intent.putExtra(SettingsActivity.EXTRA_NO_HEADERS, true);
return intent;
}
}

View File

@@ -146,9 +146,7 @@ public abstract class ToggleFeaturePreferenceFragment
public void setTitle(String title) {
final SettingsActivity activity = (SettingsActivity) getActivity();
if (!activity.onIsHidingHeaders()) {
getActivity().setTitle(title);
}
getActivity().setTitle(title);
}
protected void onProcessArguments(Bundle arguments) {

View File

@@ -29,7 +29,6 @@ public class SyncSettingsActivity extends SettingsActivity {
public Intent getIntent() {
Intent modIntent = new Intent(super.getIntent());
modIntent.putExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT, SyncSettings.class.getName());
modIntent.putExtra(SettingsActivity.EXTRA_NO_HEADERS, true);
return modIntent;
}

View File

@@ -25,7 +25,6 @@ public class InstalledAppDetailsTop extends SettingsActivity {
public Intent getIntent() {
Intent modIntent = new Intent(super.getIntent());
modIntent.putExtra(EXTRA_SHOW_FRAGMENT, InstalledAppDetails.class.getName());
modIntent.putExtra(EXTRA_NO_HEADERS, true);
return modIntent;
}

View File

@@ -141,10 +141,8 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment implem
public void onStop() {
super.onStop();
final SettingsActivity activity = (SettingsActivity) getActivity();
if (!activity.onIsHidingHeaders()) {
activity.getActionBar().setDisplayOptions(0, ActionBar.DISPLAY_SHOW_CUSTOM);
activity.getActionBar().setCustomView(null);
}
activity.getActionBar().setDisplayOptions(0, ActionBar.DISPLAY_SHOW_CUSTOM);
activity.getActionBar().setCustomView(null);
}
@Override

View File

@@ -25,7 +25,6 @@ public class InputMethodAndSubtypeEnablerActivity extends SettingsActivity {
final Intent modIntent = new Intent(super.getIntent());
if (!modIntent.hasExtra(EXTRA_SHOW_FRAGMENT)) {
modIntent.putExtra(EXTRA_SHOW_FRAGMENT, InputMethodAndSubtypeEnabler.class.getName());
modIntent.putExtra(EXTRA_NO_HEADERS, true);
}
return modIntent;
}

View File

@@ -416,24 +416,17 @@ public class WifiSettings extends RestrictedSettingsFragment
final Activity activity = getActivity();
mSwitch = new Switch(activity.getActionBar().getThemedContext());
boolean addSwitch = true;
if (activity instanceof WifiPickerActivity) {
PreferenceActivity pa = (PreferenceActivity) activity;
addSwitch = pa.onIsHidingHeaders();
}
final int padding = activity.getResources().getDimensionPixelSize(
R.dimen.action_bar_switch_padding);
mSwitch.setPaddingRelative(0, 0, padding, 0);
if (addSwitch) {
final int padding = activity.getResources().getDimensionPixelSize(
R.dimen.action_bar_switch_padding);
mSwitch.setPaddingRelative(0, 0, padding, 0);
activity.getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM,
ActionBar.DISPLAY_SHOW_CUSTOM);
activity.getActionBar().setCustomView(mSwitch, new ActionBar.LayoutParams(
ActionBar.LayoutParams.WRAP_CONTENT,
ActionBar.LayoutParams.WRAP_CONTENT,
Gravity.CENTER_VERTICAL | Gravity.END));
}
activity.getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM,
ActionBar.DISPLAY_SHOW_CUSTOM);
activity.getActionBar().setCustomView(mSwitch, new ActionBar.LayoutParams(
ActionBar.LayoutParams.WRAP_CONTENT,
ActionBar.LayoutParams.WRAP_CONTENT,
Gravity.CENTER_VERTICAL | Gravity.END));
mWifiEnabler = new WifiEnabler(activity, mSwitch);
}
@@ -442,19 +435,9 @@ public class WifiSettings extends RestrictedSettingsFragment
@Override
public void onStop() {
super.onStop();
Activity activity = getActivity();
boolean onIsHidingHeaders = true;
if (activity instanceof SettingsActivity){
SettingsActivity sa = (SettingsActivity) activity;
onIsHidingHeaders = sa.onIsHidingHeaders();
} else if (activity instanceof PreferenceActivity) {
PreferenceActivity pa = (PreferenceActivity) activity;
onIsHidingHeaders = pa.onIsHidingHeaders();
}
if (!onIsHidingHeaders) {
activity.getActionBar().setDisplayOptions(0, ActionBar.DISPLAY_SHOW_CUSTOM);
activity.getActionBar().setCustomView(null);
}
final Activity activity = getActivity();
activity.getActionBar().setDisplayOptions(0, ActionBar.DISPLAY_SHOW_CUSTOM);
activity.getActionBar().setCustomView(null);
}
@Override