diff --git a/res/values/themes.xml b/res/values/themes.xml index 01fe2b659..95636971c 100644 --- a/res/values/themes.xml +++ b/res/values/themes.xml @@ -1,11 +1,11 @@ - - diff --git a/src/com/fsck/k9/activity/Accounts.java b/src/com/fsck/k9/activity/Accounts.java index 71739ec1d..0026d9128 100644 --- a/src/com/fsck/k9/activity/Accounts.java +++ b/src/com/fsck/k9/activity/Accounts.java @@ -29,8 +29,8 @@ import android.util.Log; import android.util.SparseBooleanArray; import android.util.TypedValue; import android.view.ContextMenu; -import android.view.Menu; -import android.view.MenuItem; +import com.actionbarsherlock.view.Menu; +import com.actionbarsherlock.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.view.Window; @@ -1040,7 +1040,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC } @Override - public boolean onContextItemSelected(MenuItem item) { + public boolean onContextItemSelected(android.view.MenuItem item) { AdapterContextMenuInfo menuInfo = (AdapterContextMenuInfo)item.getMenuInfo(); // submenus don't actually set the menuInfo, so the "advanced" // submenu wouldn't work. @@ -1242,7 +1242,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); - getMenuInflater().inflate(R.menu.accounts_option, menu); + getSupportMenuInflater().inflate(R.menu.accounts_option, menu); return true; } @@ -1262,7 +1262,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC if (account instanceof SearchAccount) { for (int i = 0; i < menu.size(); i++) { - MenuItem item = menu.getItem(i); + android.view.MenuItem item = menu.getItem(i); if (item.getItemId() != R.id.open) { item.setVisible(false); } diff --git a/src/com/fsck/k9/activity/ChooseFolder.java b/src/com/fsck/k9/activity/ChooseFolder.java index a5aa71849..a7ba8f7cc 100644 --- a/src/com/fsck/k9/activity/ChooseFolder.java +++ b/src/com/fsck/k9/activity/ChooseFolder.java @@ -14,8 +14,8 @@ import android.os.Handler; import android.text.Editable; import android.text.TextWatcher; import android.util.Log; -import android.view.Menu; -import android.view.MenuItem; +import com.actionbarsherlock.view.Menu; +import com.actionbarsherlock.view.MenuItem; import android.view.View; import android.view.Window; import android.widget.AdapterView; @@ -170,7 +170,7 @@ public class ChooseFolder extends K9ListActivity { @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); - getMenuInflater().inflate(R.menu.folder_select_option, menu); + getSupportMenuInflater().inflate(R.menu.folder_select_option, menu); return true; } diff --git a/src/com/fsck/k9/activity/FolderList.java b/src/com/fsck/k9/activity/FolderList.java index 1b25aeb87..2c2eadbfb 100644 --- a/src/com/fsck/k9/activity/FolderList.java +++ b/src/com/fsck/k9/activity/FolderList.java @@ -1,5 +1,11 @@ package com.fsck.k9.activity; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; + import android.app.AlertDialog; import android.app.Dialog; import android.content.Context; @@ -13,20 +19,42 @@ import android.text.Editable; import android.text.TextWatcher; import android.util.Log; import android.util.TypedValue; -import android.view.*; +import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; +import android.view.KeyEvent; +import android.view.LayoutInflater; +import android.view.View; import android.view.View.OnClickListener; -import android.widget.*; +import android.view.ViewGroup; +import android.view.Window; +import android.widget.AdapterView; import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.AdapterView.OnItemClickListener; +import android.widget.BaseAdapter; +import android.widget.EditText; +import android.widget.Filter; +import android.widget.Filterable; +import android.widget.LinearLayout; +import android.widget.ListView; +import android.widget.RelativeLayout; +import android.widget.TextView; +import android.widget.Toast; -import com.fsck.k9.*; +import com.actionbarsherlock.view.Menu; +import com.actionbarsherlock.view.MenuItem; +import com.fsck.k9.Account; import com.fsck.k9.Account.FolderMode; -import com.fsck.k9.activity.FolderInfoHolder; +import com.fsck.k9.AccountStats; +import com.fsck.k9.BaseAccount; +import com.fsck.k9.FontSizes; +import com.fsck.k9.K9; +import com.fsck.k9.Preferences; +import com.fsck.k9.R; +import com.fsck.k9.SearchSpecification; import com.fsck.k9.activity.FolderList.FolderListAdapter.FolderListFilter; -import com.fsck.k9.activity.setup.Prefs; import com.fsck.k9.activity.setup.AccountSettings; import com.fsck.k9.activity.setup.FolderSettings; +import com.fsck.k9.activity.setup.Prefs; import com.fsck.k9.controller.MessagingController; import com.fsck.k9.controller.MessagingListener; import com.fsck.k9.helper.SizeFormatter; @@ -35,14 +63,9 @@ import com.fsck.k9.helper.power.TracingPowerManager.TracingWakeLock; import com.fsck.k9.mail.Flag; import com.fsck.k9.mail.Folder; import com.fsck.k9.mail.Message; -import com.fsck.k9.mail.store.LocalStore.LocalFolder; import com.fsck.k9.mail.MessagingException; +import com.fsck.k9.mail.store.LocalStore.LocalFolder; import com.fsck.k9.service.MailService; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.LinkedList; -import java.util.List; /** * FolderList is the primary user interface for the program. This @@ -578,11 +601,11 @@ public class FolderList extends K9ListActivity { @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); - getMenuInflater().inflate(R.menu.folder_list_option, menu); + getSupportMenuInflater().inflate(R.menu.folder_list_option, menu); return true; } - @Override public boolean onContextItemSelected(MenuItem item) { + @Override public boolean onContextItemSelected(android.view.MenuItem item) { AdapterContextMenuInfo info = (AdapterContextMenuInfo) item .getMenuInfo(); FolderInfoHolder folder = (FolderInfoHolder) mAdapter.getItem(info.position); diff --git a/src/com/fsck/k9/activity/K9Activity.java b/src/com/fsck/k9/activity/K9Activity.java index 228477489..afd9c5bf8 100644 --- a/src/com/fsck/k9/activity/K9Activity.java +++ b/src/com/fsck/k9/activity/K9Activity.java @@ -3,7 +3,6 @@ package com.fsck.k9.activity; import java.util.Locale; -import android.app.Activity; import android.content.Context; import android.content.res.Configuration; import android.content.res.TypedArray; @@ -15,10 +14,12 @@ import android.view.MotionEvent; import android.view.animation.AccelerateInterpolator; import android.view.animation.Animation; import android.view.animation.TranslateAnimation; + +import com.actionbarsherlock.app.SherlockActivity; import com.fsck.k9.K9; -public class K9Activity extends Activity { +public class K9Activity extends SherlockActivity { protected static final int BEZEL_SWIPE_THRESHOLD = 20; protected GestureDetector mGestureDetector; diff --git a/src/com/fsck/k9/activity/K9ListActivity.java b/src/com/fsck/k9/activity/K9ListActivity.java index 613b22119..4c01d49df 100644 --- a/src/com/fsck/k9/activity/K9ListActivity.java +++ b/src/com/fsck/k9/activity/K9ListActivity.java @@ -1,15 +1,16 @@ package com.fsck.k9.activity; -import android.app.ListActivity; import android.util.Log; import android.view.KeyEvent; import android.widget.AdapterView; import android.widget.ListView; import android.os.Bundle; + +import com.actionbarsherlock.app.SherlockListActivity; import com.fsck.k9.K9; import com.fsck.k9.helper.DateFormatter; -public class K9ListActivity extends ListActivity { +public class K9ListActivity extends SherlockListActivity { @Override public void onCreate(Bundle icicle) { K9Activity.setLanguage(this, K9.getK9Language()); diff --git a/src/com/fsck/k9/activity/K9PreferenceActivity.java b/src/com/fsck/k9/activity/K9PreferenceActivity.java index fff69b028..3ad26718d 100644 --- a/src/com/fsck/k9/activity/K9PreferenceActivity.java +++ b/src/com/fsck/k9/activity/K9PreferenceActivity.java @@ -1,20 +1,28 @@ package com.fsck.k9.activity; +import com.actionbarsherlock.app.SherlockPreferenceActivity; import com.fsck.k9.K9; + +import android.os.Build; import android.os.Bundle; -import android.preference.PreferenceActivity; import android.preference.ListPreference; import android.preference.Preference; -public class K9PreferenceActivity extends PreferenceActivity { +public class K9PreferenceActivity extends SherlockPreferenceActivity { @Override public void onCreate(Bundle icicle) { K9Activity.setLanguage(this, K9.getK9Language()); - // http://code.google.com/p/k9mail/issues/detail?id=2439 - // Re-enable themeing support in preferences when - // http://code.google.com/p/android/issues/detail?id=4611 is resolved - // setTheme(K9.getK9Theme()); + + if (Build.VERSION.SDK_INT >= 6 && Build.VERSION.SDK_INT < 11) { + // there's a display bug in 2.1, 2.2, 2.3 (unsure about 2.0) + // which causes PreferenceScreens to have a black background. + // http://code.google.com/p/android/issues/detail?id=4611 + setTheme(K9.getK9ThemeResourceId(K9.THEME_DARK)); + }else{ + setTheme(K9.getK9ThemeResourceId()); + } + super.onCreate(icicle); } diff --git a/src/com/fsck/k9/activity/ManageIdentities.java b/src/com/fsck/k9/activity/ManageIdentities.java index a15aaaa6f..7f69bf50d 100644 --- a/src/com/fsck/k9/activity/ManageIdentities.java +++ b/src/com/fsck/k9/activity/ManageIdentities.java @@ -1,12 +1,16 @@ package com.fsck.k9.activity; import android.content.Intent; -import android.view.*; +import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; +import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.ListView; import android.widget.Toast; + +import com.actionbarsherlock.view.Menu; +import com.actionbarsherlock.view.MenuItem; import com.fsck.k9.Identity; import com.fsck.k9.Preferences; import com.fsck.k9.R; @@ -40,7 +44,7 @@ public class ManageIdentities extends ChooseIdentity { @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); - getMenuInflater().inflate(R.menu.manage_identities_option, menu); + getSupportMenuInflater().inflate(R.menu.manage_identities_option, menu); return true; } @@ -66,7 +70,7 @@ public class ManageIdentities extends ChooseIdentity { } @Override - public boolean onContextItemSelected(MenuItem item) { + public boolean onContextItemSelected(android.view.MenuItem item) { AdapterContextMenuInfo menuInfo = (AdapterContextMenuInfo)item.getMenuInfo(); switch (item.getItemId()) { case R.id.edit: diff --git a/src/com/fsck/k9/activity/MessageCompose.java b/src/com/fsck/k9/activity/MessageCompose.java index 3d177de80..4aab1a75b 100644 --- a/src/com/fsck/k9/activity/MessageCompose.java +++ b/src/com/fsck/k9/activity/MessageCompose.java @@ -22,8 +22,8 @@ import android.text.util.Rfc822Tokenizer; import android.util.Log; import android.util.TypedValue; import android.view.LayoutInflater; -import android.view.Menu; -import android.view.MenuItem; +import com.actionbarsherlock.view.Menu; +import com.actionbarsherlock.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnFocusChangeListener; @@ -2180,7 +2180,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); - getMenuInflater().inflate(R.menu.message_compose_option, menu); + getSupportMenuInflater().inflate(R.menu.message_compose_option, menu); // Disable the 'Save' menu option if Drafts folder is set to -NONE- if (!mAccount.hasDraftsFolder()) { diff --git a/src/com/fsck/k9/activity/MessageList.java b/src/com/fsck/k9/activity/MessageList.java index 281ddf747..b0aa96701 100644 --- a/src/com/fsck/k9/activity/MessageList.java +++ b/src/com/fsck/k9/activity/MessageList.java @@ -30,8 +30,8 @@ import android.view.ContextMenu.ContextMenuInfo; import android.view.GestureDetector; import android.view.KeyEvent; import android.view.LayoutInflater; -import android.view.Menu; -import android.view.MenuItem; +import com.actionbarsherlock.view.Menu; +import com.actionbarsherlock.view.MenuItem; import android.view.MotionEvent; import android.view.View; import android.view.View.OnClickListener; @@ -1677,13 +1677,13 @@ public class MessageList @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); - getMenuInflater().inflate(R.menu.message_list_option, menu); + getSupportMenuInflater().inflate(R.menu.message_list_option, menu); return true; } @Override - public boolean onContextItemSelected(MenuItem item) { + public boolean onContextItemSelected(android.view.MenuItem item) { AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo(); final MessageInfoHolder holder = mSelectedMessage == null ? (MessageInfoHolder) mAdapter.getItem(info.position) : mSelectedMessage; // don't need this anymore diff --git a/src/com/fsck/k9/activity/MessageView.java b/src/com/fsck/k9/activity/MessageView.java index d96b5f6af..dba252334 100644 --- a/src/com/fsck/k9/activity/MessageView.java +++ b/src/com/fsck/k9/activity/MessageView.java @@ -1,5 +1,10 @@ package com.fsck.k9.activity; +import java.io.File; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + import android.app.Dialog; import android.app.ProgressDialog; import android.content.Context; @@ -8,24 +13,34 @@ import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.util.Log; -import android.view.*; +import android.view.GestureDetector; +import android.view.KeyEvent; +import android.view.MotionEvent; +import android.view.View; import android.view.View.OnClickListener; -import android.widget.*; -import com.fsck.k9.*; +import android.widget.Toast; + +import com.actionbarsherlock.view.Menu; +import com.actionbarsherlock.view.MenuItem; +import com.actionbarsherlock.view.Window; +import com.fsck.k9.Account; +import com.fsck.k9.K9; +import com.fsck.k9.Preferences; +import com.fsck.k9.R; import com.fsck.k9.controller.MessagingController; import com.fsck.k9.controller.MessagingListener; import com.fsck.k9.crypto.PgpData; import com.fsck.k9.helper.FileBrowserHelper; import com.fsck.k9.helper.FileBrowserHelper.FileBrowserFailOverCallback; -import com.fsck.k9.mail.*; +import com.fsck.k9.mail.Flag; +import com.fsck.k9.mail.Message; +import com.fsck.k9.mail.MessagingException; +import com.fsck.k9.mail.Part; import com.fsck.k9.mail.store.LocalStore.LocalMessage; import com.fsck.k9.mail.store.StorageManager; import com.fsck.k9.view.AttachmentView; -import com.fsck.k9.view.SingleMessageView; import com.fsck.k9.view.AttachmentView.AttachmentFileDownloadCallback; - -import java.io.File; -import java.util.*; +import com.fsck.k9.view.SingleMessageView; public class MessageView extends K9Activity implements OnClickListener { private static final String EXTRA_MESSAGE_REFERENCE = "com.fsck.k9.MessageView_messageReference"; @@ -301,7 +316,6 @@ public class MessageView extends K9Activity implements OnClickListener { public void onCreate(Bundle icicle) { super.onCreate(icicle); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); - requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.message_view); mMessageView = (SingleMessageView) findViewById(R.id.message_view); @@ -891,7 +905,7 @@ public class MessageView extends K9Activity implements OnClickListener { @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); - getMenuInflater().inflate(R.menu.message_view_option, menu); + getSupportMenuInflater().inflate(R.menu.message_view_option, menu); if (!mController.isCopyCapable(mAccount)) { menu.findItem(R.id.copy).setVisible(false); }