hide text zoom pref in Email2

Bug: 5287963
Change-Id: I6661149a8e8a98d5cebb9ea0fcfe6b4bc7976ff7
This commit is contained in:
Andy Huang 2012-04-25 19:59:20 -07:00
parent a4d8ff2293
commit b354794c21
2 changed files with 67 additions and 60 deletions

View File

@ -17,59 +17,54 @@
<!-- App-wide preferences -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:key="category_general_preferences"
android:title="@string/category_general_preferences">
<CheckBoxPreference
android:key="confirm_delete"
android:persistent="true"
android:defaultValue="false"
android:title="@string/general_preference_confirm_delete_label"
android:summary="@string/general_preference_confirm_delete_summary" />
<CheckBoxPreference
android:key="confirm_delete"
android:persistent="true"
android:defaultValue="false"
android:title="@string/general_preference_confirm_delete_label"
android:summary="@string/general_preference_confirm_delete_summary" />
<CheckBoxPreference
android:key="confirm_send"
android:persistent="true"
android:defaultValue="false"
android:title="@string/general_preference_confirm_send_label"
android:summary="@string/general_preference_confirm_send_summary" />
<CheckBoxPreference
android:key="confirm_send"
android:persistent="true"
android:defaultValue="false"
android:title="@string/general_preference_confirm_send_label"
android:summary="@string/general_preference_confirm_send_summary" />
<ListPreference
android:key="auto_advance"
android:title="@string/general_preference_auto_advance_label"
android:summary="@string/general_preference_auto_advance_summary"
android:entries="@array/general_preference_auto_advance_entries"
android:entryValues="@array/general_preference_auto_advance_values"
android:dialogTitle="@string/general_preference_auto_advance_dialog_title" />
<ListPreference
android:key="auto_advance"
android:title="@string/general_preference_auto_advance_label"
android:summary="@string/general_preference_auto_advance_summary"
android:entries="@array/general_preference_auto_advance_entries"
android:entryValues="@array/general_preference_auto_advance_values"
android:dialogTitle="@string/general_preference_auto_advance_dialog_title" />
<!-- Note, summary is set dynamically in GeneralPreferences.java -->
<ListPreference
android:key="text_zoom"
android:title="@string/general_preference_text_zoom_label"
android:entries="@array/general_preference_text_zoom_entries"
android:entryValues="@array/general_preference_text_zoom_values"
android:dialogTitle="@string/general_preference_text_zoom_dialog_title" />
<!-- Note, summary is set dynamically in GeneralPreferences.java -->
<ListPreference
android:key="text_zoom"
android:title="@string/general_preference_text_zoom_label"
android:entries="@array/general_preference_text_zoom_entries"
android:entryValues="@array/general_preference_text_zoom_values"
android:dialogTitle="@string/general_preference_text_zoom_dialog_title" />
<CheckBoxPreference
android:key="hide_checkboxes"
android:persistent="true"
android:defaultValue="false"
android:title="@string/general_preference_hide_checkboxes_label"
android:summary="@string/general_preference_hide_checkboxes_summary" />
<CheckBoxPreference
android:key="hide_checkboxes"
android:persistent="true"
android:defaultValue="false"
android:title="@string/general_preference_hide_checkboxes_label"
android:summary="@string/general_preference_hide_checkboxes_summary" />
<!-- This may be removed in GeneralPreferences.java -->
<CheckBoxPreference
android:key="reply_all"
android:persistent="true"
android:defaultValue="false"
android:title="@string/general_preference_reply_all_label"
android:summary="@string/general_preference_reply_all_summary" />
<!-- This may be removed in GeneralPreferences.java -->
<CheckBoxPreference
android:key="reply_all"
android:persistent="true"
android:defaultValue="false"
android:title="@string/general_preference_reply_all_label"
android:summary="@string/general_preference_reply_all_summary" />
<PreferenceScreen
android:key="clear_trusted_senders"
android:title="@string/general_preferences_clear_trusted_senders_title"
android:summary="@string/general_preferences_clear_trusted_senders_summary" />
<PreferenceScreen
android:key="clear_trusted_senders"
android:title="@string/general_preferences_clear_trusted_senders_title"
android:summary="@string/general_preferences_clear_trusted_senders_summary" />
</PreferenceCategory>
</PreferenceScreen>

View File

@ -44,6 +44,11 @@ public class GeneralPreferences extends EmailPreferenceFragment implements
private Preferences mPreferences;
private ListPreference mAutoAdvance;
/**
* TODO: remove this when we've decided for certain that an app setting is unnecessary
* (b/5287963)
*/
@Deprecated
private ListPreference mTextZoom;
private CheckBoxPreference mConfirmDelete;
private CheckBoxPreference mConfirmSend;
@ -61,6 +66,9 @@ public class GeneralPreferences extends EmailPreferenceFragment implements
// Load the preferences from an XML resource
addPreferencesFromResource(R.xml.general_preferences);
// Merely hide app pref for font size until we're sure it's unnecessary (b/5287963)
getPreferenceScreen().removePreference(findPreference(PREFERENCE_KEY_TEXT_ZOOM));
}
@Override
@ -139,8 +147,10 @@ public class GeneralPreferences extends EmailPreferenceFragment implements
mAutoAdvance.setOnPreferenceChangeListener(this);
mTextZoom = (ListPreference) findPreference(PREFERENCE_KEY_TEXT_ZOOM);
mTextZoom.setValueIndex(mPreferences.getTextZoom());
mTextZoom.setOnPreferenceChangeListener(this);
if (mTextZoom != null) {
mTextZoom.setValueIndex(mPreferences.getTextZoom());
mTextZoom.setOnPreferenceChangeListener(this);
}
mConfirmDelete = (CheckBoxPreference) findPreference(PREFERENCE_KEY_CONFIRM_DELETE);
mConfirmSend = (CheckBoxPreference) findPreference(PREFERENCE_KEY_CONFIRM_SEND);
@ -153,16 +163,18 @@ public class GeneralPreferences extends EmailPreferenceFragment implements
* Reload any preference summaries that are updated dynamically
*/
private void reloadDynamicSummaries() {
int textZoomIndex = mPreferences.getTextZoom();
// Update summary - but only load the array once
if (mSizeSummaries == null) {
mSizeSummaries = getActivity().getResources()
.getTextArray(R.array.general_preference_text_zoom_summary_array);
if (mTextZoom != null) {
int textZoomIndex = mPreferences.getTextZoom();
// Update summary - but only load the array once
if (mSizeSummaries == null) {
mSizeSummaries = getActivity().getResources()
.getTextArray(R.array.general_preference_text_zoom_summary_array);
}
CharSequence summary = null;
if (textZoomIndex >= 0 && textZoomIndex < mSizeSummaries.length) {
summary = mSizeSummaries[textZoomIndex];
}
mTextZoom.setSummary(summary);
}
CharSequence summary = null;
if (textZoomIndex >= 0 && textZoomIndex < mSizeSummaries.length) {
summary = mSizeSummaries[textZoomIndex];
}
mTextZoom.setSummary(summary);
}
}