From 6fdf69d45bffb0004b49742c5282a2af20e426f6 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Tue, 8 Dec 2009 07:07:03 +0000 Subject: [PATCH] Revert "Fixed issue 858: Added option to choose which side the widgets in message list will be on" This reverts commit b334e397431225280f30e5297f73392f331f2dc3. --- ...t_item_right.xml => message_list_item.xml} | 7 +-- res/layout-land/message_list_item_left.xml | 55 ------------------- ...t_item_right.xml => message_list_item.xml} | 2 +- res/layout/message_list_item_left.xml | 54 ------------------ ...ets_right.xml => message_list_widgets.xml} | 0 res/layout/message_list_widgets_left.xml | 28 ---------- res/values/arrays.xml | 12 +--- res/values/strings.xml | 5 +- res/xml/global_preferences.xml | 10 +--- src/com/android/email/Email.java | 19 ------- .../android/email/activity/MessageList.java | 20 +------ .../android/email/activity/setup/Prefs.java | 19 ------- 12 files changed, 9 insertions(+), 222 deletions(-) rename res/layout-land/{message_list_item_right.xml => message_list_item.xml} (88%) delete mode 100644 res/layout-land/message_list_item_left.xml rename res/layout/{message_list_item_right.xml => message_list_item.xml} (96%) delete mode 100644 res/layout/message_list_item_left.xml rename res/layout/{message_list_widgets_right.xml => message_list_widgets.xml} (100%) delete mode 100644 res/layout/message_list_widgets_left.xml diff --git a/res/layout-land/message_list_item_right.xml b/res/layout-land/message_list_item.xml similarity index 88% rename from res/layout-land/message_list_item_right.xml rename to res/layout-land/message_list_item.xml index a783162ea..714c5ede1 100644 --- a/res/layout-land/message_list_item_right.xml +++ b/res/layout-land/message_list_item.xml @@ -13,7 +13,7 @@ android:layout_height="20dip" android:layout_centerVertical="true" android:layout_alignParentLeft="true" /> - + - - - - - - - diff --git a/res/layout/message_list_item_right.xml b/res/layout/message_list_item.xml similarity index 96% rename from res/layout/message_list_item_right.xml rename to res/layout/message_list_item.xml index 1f897c80a..d615d1500 100644 --- a/res/layout/message_list_item_right.xml +++ b/res/layout/message_list_item.xml @@ -13,7 +13,7 @@ android:layout_width="4dip" android:layout_height="fill_parent" android:layout_centerVertical="true" /> - + - - - - - - - diff --git a/res/layout/message_list_widgets_right.xml b/res/layout/message_list_widgets.xml similarity index 100% rename from res/layout/message_list_widgets_right.xml rename to res/layout/message_list_widgets.xml diff --git a/res/layout/message_list_widgets_left.xml b/res/layout/message_list_widgets_left.xml deleted file mode 100644 index 7906bf7f1..000000000 --- a/res/layout/message_list_widgets_left.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - diff --git a/res/values/arrays.xml b/res/values/arrays.xml index fa9a39b68..d2571b2e4 100644 --- a/res/values/arrays.xml +++ b/res/values/arrays.xml @@ -212,15 +212,5 @@ @string/date_format_common @string/date_format_iso8601 - - - @string/message_list_widget_left_side - @string/message_list_widget_right_side - - - - LEFT - RIGHT - - + diff --git a/res/values/strings.xml b/res/values/strings.xml index 84250ed2e..320047493 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -571,9 +571,6 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin MEDIUM dd-MMM-yyyy yyyy-MM-dd - - Message list's widget side - Left - Right + diff --git a/res/xml/global_preferences.xml b/res/xml/global_preferences.xml index 3647a5882..c32151f4e 100644 --- a/res/xml/global_preferences.xml +++ b/res/xml/global_preferences.xml @@ -25,20 +25,12 @@ android:entryValues="@array/settings_theme_values" android:dialogTitle="@string/settings_theme_label" /> - - - - diff --git a/src/com/android/email/Email.java b/src/com/android/email/Email.java index f86dfa57a..79d09e635 100644 --- a/src/com/android/email/Email.java +++ b/src/com/android/email/Email.java @@ -33,13 +33,6 @@ public class Email extends Application private static int theme = android.R.style.Theme_Light; - public enum MessageListWidgetSide - { - LEFT, RIGHT - } - - private static MessageListWidgetSide messageListWidgetSide = MessageListWidgetSide.RIGHT; - private static BACKGROUND_OPS backgroundOps = BACKGROUND_OPS.WHEN_CHECKED; /** * Some log messages can be sent to a file, so that the logs @@ -476,7 +469,6 @@ public class Email extends Application editor.putBoolean("enableSensitiveLogging", Email.DEBUG_SENSITIVE); editor.putString("backgroundOperations", Email.backgroundOps.toString()); editor.putInt("theme", theme); - editor.putString("messageListWidgetSide", messageListWidgetSide.toString()); } @Override @@ -499,7 +491,6 @@ public class Email extends Application } Email.setK9Theme(sprefs.getInt("theme", android.R.style.Theme_Light)); - Email.setMessageListWidgetSide(MessageListWidgetSide.valueOf(sprefs.getString("messageListWidgetSide", MessageListWidgetSide.RIGHT.toString()))); MessagingController.getInstance(this).resetVisibleLimits(prefs.getAccounts()); /* @@ -568,16 +559,6 @@ public class Email extends Application { Email.backgroundOps = BACKGROUND_OPS.valueOf(nbackgroundOps); } - - public static MessageListWidgetSide getMessageListWidgetSide() - { - return Email.messageListWidgetSide; - } - - public static void setMessageListWidgetSide(MessageListWidgetSide messageListWidgetSide) - { - Email.messageListWidgetSide = messageListWidgetSide; - } } diff --git a/src/com/android/email/activity/MessageList.java b/src/com/android/email/activity/MessageList.java index 34a60bbac..ccb22cdd2 100644 --- a/src/com/android/email/activity/MessageList.java +++ b/src/com/android/email/activity/MessageList.java @@ -1745,28 +1745,14 @@ public class MessageList MessageInfoHolder message = (MessageInfoHolder) getItem(position); View view; - if ((convertView != null) - && ( - (convertView.getId() == R.layout.message_list_item_left) - || (convertView.getId() == R.layout.message_list_item_right) - ) - ) + if ((convertView != null) && (convertView.getId() == R.layout.message_list_item)) { view = convertView; } else { - int layoutId; - if (Email.getMessageListWidgetSide()==Email.MessageListWidgetSide.LEFT) - { - layoutId = R.layout.message_list_item_left; - } - else - { - layoutId = R.layout.message_list_item_right; - } - view = mInflater.inflate(layoutId, parent, false); - view.setId(layoutId); + view = mInflater.inflate(R.layout.message_list_item, parent, false); + view.setId(R.layout.message_list_item); } diff --git a/src/com/android/email/activity/setup/Prefs.java b/src/com/android/email/activity/setup/Prefs.java index 14a781006..0433f9f78 100644 --- a/src/com/android/email/activity/setup/Prefs.java +++ b/src/com/android/email/activity/setup/Prefs.java @@ -11,7 +11,6 @@ import android.preference.Preference; import android.view.KeyEvent; import com.android.email.Email; -import com.android.email.Email.MessageListWidgetSide; import com.android.email.K9PreferenceActivity; import com.android.email.Preferences; import com.android.email.R; @@ -23,14 +22,12 @@ public class Prefs extends K9PreferenceActivity private static final String PREFERENCE_THEME = "theme"; private static final String PREFERENCE_DATE_FORMAT = "dateFormat"; - private static final String PREFERENCE_MESSAGE_LIST_WIDGET_SIDE = "messageListWidgetSide"; private static final String PREFERENCE_BACKGROUND_OPS = "background_ops"; private static final String PREFERENCE_DEBUG_LOGGING = "debug_logging"; private static final String PREFERENCE_SENSITIVE_LOGGING = "sensitive_logging"; private ListPreference mTheme; private ListPreference mDateFormat; - private ListPreference mMessageListWidgetSide; private ListPreference mBackgroundOps; private CheckBoxPreference mDebugLogging; private CheckBoxPreference mSensitiveLogging; @@ -94,21 +91,6 @@ public class Prefs extends K9PreferenceActivity } }); - mMessageListWidgetSide = (ListPreference) findPreference(PREFERENCE_MESSAGE_LIST_WIDGET_SIDE); - mMessageListWidgetSide.setValue(Email.getMessageListWidgetSide().toString()); - mMessageListWidgetSide.setSummary(mMessageListWidgetSide.getEntry()); - mMessageListWidgetSide.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() - { - public boolean onPreferenceChange(Preference preference, Object newValue) - { - final String summary = newValue.toString(); - int index = mMessageListWidgetSide.findIndexOfValue(summary); - mMessageListWidgetSide.setSummary(mMessageListWidgetSide.getEntries()[index]); - mMessageListWidgetSide.setValue(summary); - return false; - } - }); - mBackgroundOps = (ListPreference) findPreference(PREFERENCE_BACKGROUND_OPS); initBackgroundOps = Email.getBackgroundOps().toString(); mBackgroundOps.setValue(initBackgroundOps); @@ -143,7 +125,6 @@ public class Prefs extends K9PreferenceActivity { SharedPreferences preferences = Preferences.getPreferences(this).getPreferences(); Email.setK9Theme(mTheme.getValue().equals("dark") ? android.R.style.Theme : android.R.style.Theme_Light); - Email.setMessageListWidgetSide(MessageListWidgetSide.valueOf(mMessageListWidgetSide.getValue())); Email.DEBUG = mDebugLogging.isChecked(); Email.DEBUG_SENSITIVE = mSensitiveLogging.isChecked(); String newBackgroundOps = mBackgroundOps.getValue();