remove some duplicated code

This commit is contained in:
Jesse Vincent 2010-12-26 03:49:13 +00:00
parent 8c6df94739
commit 8488b55e09
1 changed files with 14 additions and 9 deletions

View File

@ -1507,12 +1507,8 @@ public class MessageView extends K9Activity implements OnClickListener
toast.show(); toast.show();
return; return;
} }
Intent intent = new Intent(this, ChooseFolder.class);
intent.putExtra(ChooseFolder.EXTRA_ACCOUNT, mAccount.getUuid()); startRefileActivity(ACTIVITY_CHOOSE_FOLDER_MOVE);
intent.putExtra(ChooseFolder.EXTRA_CUR_FOLDER, mMessageReference.folderName);
intent.putExtra(ChooseFolder.EXTRA_SEL_FOLDER, mAccount.getLastSelectedFolderName());
intent.putExtra(ChooseFolder.EXTRA_MESSAGE, mMessageReference);
startActivityForResult(intent, ACTIVITY_CHOOSE_FOLDER_MOVE);
} }
private void onCopy() private void onCopy()
@ -1528,18 +1524,27 @@ public class MessageView extends K9Activity implements OnClickListener
toast.show(); toast.show();
return; return;
} }
startRefileActivity(ACTIVITY_CHOOSE_FOLDER_COPY);
}
private void startRefileActivity(int activity)
{
Intent intent = new Intent(this, ChooseFolder.class); Intent intent = new Intent(this, ChooseFolder.class);
intent.putExtra(ChooseFolder.EXTRA_ACCOUNT, mAccount.getUuid()); intent.putExtra(ChooseFolder.EXTRA_ACCOUNT, mAccount.getUuid());
intent.putExtra(ChooseFolder.EXTRA_CUR_FOLDER, mMessageReference.folderName); intent.putExtra(ChooseFolder.EXTRA_CUR_FOLDER, mMessageReference.folderName);
intent.putExtra(ChooseFolder.EXTRA_SEL_FOLDER, mAccount.getLastSelectedFolderName()); intent.putExtra(ChooseFolder.EXTRA_SEL_FOLDER, mAccount.getLastSelectedFolderName());
intent.putExtra(ChooseFolder.EXTRA_MESSAGE, mMessageReference); intent.putExtra(ChooseFolder.EXTRA_MESSAGE, mMessageReference);
startActivityForResult(intent, ACTIVITY_CHOOSE_FOLDER_COPY); startActivityForResult(intent, activity);
} }
private void onShowAdditionalHeaders() private void onShowAdditionalHeaders()
{ {
int currentVisibility = mAdditionalHeadersView.getVisibility(); int currentVisibility = mAdditionalHeadersView.getVisibility();
if (currentVisibility == View.VISIBLE) if (currentVisibility == View.VISIBLE)
{ {
mHandler.hideAdditionalHeaders(); mHandler.hideAdditionalHeaders();