1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 19:52:17 -05:00
This commit is contained in:
Jesse Vincent 2011-01-23 00:56:01 +00:00
parent c06643bd47
commit 098851684f
2 changed files with 49 additions and 42 deletions

View File

@ -342,48 +342,53 @@ public class ChooseFolder extends K9ListActivity
});
mAdapter.setNotifyOnChange(false);
int selectedFolder = -1;
try {
mAdapter.clear();
int position = 0;
for (String name : localFolders)
{
if (K9.INBOX.equalsIgnoreCase(name))
{
mAdapter.add(getString(R.string.special_mailbox_name_inbox));
heldInbox = name;
}
else if (!K9.ERROR_FOLDER_NAME.equals(name))
{
mAdapter.add(name);
}
try
{
mAdapter.clear();
int position = 0;
for (String name : localFolders)
{
if (K9.INBOX.equalsIgnoreCase(name))
{
mAdapter.add(getString(R.string.special_mailbox_name_inbox));
heldInbox = name;
}
else if (!K9.ERROR_FOLDER_NAME.equals(name))
{
mAdapter.add(name);
}
if (mSelectFolder != null)
{
/*
* Never select EXTRA_CUR_FOLDER (mFolder) if EXTRA_SEL_FOLDER
* (mSelectedFolder) was provided.
*/
if (mSelectFolder != null)
{
/*
* Never select EXTRA_CUR_FOLDER (mFolder) if EXTRA_SEL_FOLDER
* (mSelectedFolder) was provided.
*/
if (name.equals(mSelectFolder))
{
selectedFolder = position;
}
}
else if (name.equals(mFolder) ||
(K9.INBOX.equalsIgnoreCase(mFolder) && K9.INBOX.equalsIgnoreCase(name)))
{
selectedFolder = position;
}
position++;
}
} finally {
mAdapter.setNotifyOnChange(true);
runOnUiThread(new Runnable() {
public void run() {
// runOnUiThread(
mAdapter.notifyDataSetChanged();
}
});
if (name.equals(mSelectFolder))
{
selectedFolder = position;
}
}
else if (name.equals(mFolder) ||
(K9.INBOX.equalsIgnoreCase(mFolder) && K9.INBOX.equalsIgnoreCase(name)))
{
selectedFolder = position;
}
position++;
}
}
finally
{
mAdapter.setNotifyOnChange(true);
runOnUiThread(new Runnable()
{
public void run()
{
// runOnUiThread(
mAdapter.notifyDataSetChanged();
}
});
}
mHandler.dataChanged();

View File

@ -31,7 +31,8 @@ public class ToggleScrollView extends ScrollView
@Override
public boolean onInterceptTouchEvent(MotionEvent ev)
{
if(!mScrolling) {
if(!mScrolling)
{
return false;
}
@ -63,7 +64,8 @@ public class ToggleScrollView extends ScrollView
{
return false;
}
} catch (Exception e)
}
catch (Exception e)
{
// nothing
}