1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-25 00:58:50 -05:00

Don't show a disabled preference if there is nothing a user can do to enable it.

This commit is contained in:
Joe Steele 2013-04-04 12:00:18 -04:00
parent f363333c87
commit 0ecc49815f

View File

@ -17,6 +17,7 @@ import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceCategory;
import android.preference.PreferenceScreen;
import android.text.TextUtils;
import android.widget.Toast;
@ -94,6 +95,7 @@ public class Prefs extends K9PreferenceActivity {
private static final int ACTIVITY_CHOOSE_FOLDER = 1;
private static final String PREFERENCE_CATEGORY_MESSAGEVIEW_PREFERENCES = "messageview_preferences";
private ListPreference mLanguage;
private ListPreference mTheme;
@ -282,11 +284,10 @@ public class Prefs extends K9PreferenceActivity {
mShowNext.setChecked(K9.messageViewShowNext());
mMobileOptimizedLayout = (CheckBoxPreference) findPreference(PREFERENCE_MESSAGEVIEW_MOBILE_LAYOUT);
if (!MessageWebView.isSingleColumnLayoutSupported()) {
mMobileOptimizedLayout.setEnabled(false);
mMobileOptimizedLayout.setChecked(false);
} else {
mMobileOptimizedLayout.setChecked(K9.mobileOptimizedLayout());
if (!MessageWebView.isSingleColumnLayoutSupported()) {
PreferenceCategory category = (PreferenceCategory) findPreference(PREFERENCE_CATEGORY_MESSAGEVIEW_PREFERENCES);
category.removePreference(mMobileOptimizedLayout);
}
mQuietTimeEnabled = (CheckBoxPreference) findPreference(PREFERENCE_QUIET_TIME_ENABLED);