Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

inbox: fix menu on Honeycomb

put options menu on InboxActivity instead of
InboxListActivity the slave activity
  • Loading branch information...
commit 65186aba75015e71c95f72bb73faf5747062e0db 1 parent ee1e2f0
@talklittle authored
View
266 src/com/andrewshu/android/reddit/mail/InboxActivity.java
@@ -21,20 +21,47 @@
import org.apache.http.client.HttpClient;
-import com.andrewshu.android.reddit.common.Constants;
-import com.andrewshu.android.reddit.common.RedditIsFunHttpClientFactory;
-import com.andrewshu.android.reddit.settings.RedditSettings;
-
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.app.ProgressDialog;
import android.app.TabActivity;
+import android.content.Context;
import android.content.Intent;
+import android.graphics.drawable.Drawable;
import android.os.Bundle;
+import android.view.ContextThemeWrapper;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.View.OnClickListener;
import android.view.Window;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.TextView;
+import android.widget.Toast;
-public class InboxActivity extends TabActivity {
+import com.andrewshu.android.reddit.R;
+import com.andrewshu.android.reddit.captcha.CaptchaCheckRequiredTask;
+import com.andrewshu.android.reddit.captcha.CaptchaDownloadTask;
+import com.andrewshu.android.reddit.common.Common;
+import com.andrewshu.android.reddit.common.Constants;
+import com.andrewshu.android.reddit.common.RedditIsFunHttpClientFactory;
+import com.andrewshu.android.reddit.settings.RedditSettings;
+import com.andrewshu.android.reddit.things.ThingInfo;
+public class InboxActivity extends TabActivity {
+
private final RedditSettings mSettings = new RedditSettings();
private final HttpClient mClient = RedditIsFunHttpClientFactory.getGzipHttpClient();
+ private static final String[] whichInboxes = {"inbox", "moderator"};
+
+ private volatile String mCaptchaIden = null;
+ private volatile String mCaptchaUrl = null;
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -46,8 +73,8 @@ protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_PROGRESS);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
- addInboxTab("inbox");
- addInboxTab("moderator");
+ for (String whichInbox : whichInboxes)
+ addInboxTab(whichInbox);
getTabHost().setCurrentTab(0);
}
@@ -70,8 +97,229 @@ private void relaunchActivity() {
}
private void addInboxTab(String whichInbox) {
- Intent inboxIntent = new Intent(getApplicationContext(), InboxListActivity.class);
- inboxIntent.putExtra(Constants.WHICH_INBOX_KEY, whichInbox);
+ Intent inboxIntent = createInboxIntent(whichInbox);
getTabHost().addTab(getTabHost().newTabSpec(whichInbox).setIndicator(whichInbox).setContent(inboxIntent));
}
+
+ private Intent createInboxIntent(String whichInbox) {
+ return new Intent(this, InboxListActivity.class)
+ .putExtra(Constants.WHICH_INBOX_KEY, whichInbox);
+ }
+
+ /**
+ * Populates the menu.
+ */
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ super.onCreateOptionsMenu(menu);
+
+ MenuInflater inflater = getMenuInflater();
+ inflater.inflate(R.menu.inbox, menu);
+
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+
+ switch (item.getItemId()) {
+ case R.id.compose_message_menu_id:
+ showDialog(Constants.DIALOG_COMPOSE);
+ break;
+ case R.id.refresh_menu_id:
+ String whichInbox = whichInboxes[getTabHost().getCurrentTab()];
+ InboxListActivity inboxListActivity = (InboxListActivity) getLocalActivityManager().getActivity(whichInbox);
+ if (inboxListActivity != null)
+ inboxListActivity.refresh();
+ break;
+ case android.R.id.home:
+ Common.goHome(this);
+ break;
+ }
+
+ return true;
+ }
+
+ @Override
+ protected Dialog onCreateDialog(int id) {
+ Dialog dialog;
+ ProgressDialog pdialog;
+ AlertDialog.Builder builder;
+ LayoutInflater inflater;
+ View layout; // used for inflated views for AlertDialog.Builder.setView()
+
+ switch (id) {
+ case Constants.DIALOG_COMPOSE:
+ inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ builder = new AlertDialog.Builder(new ContextThemeWrapper(this, mSettings.getDialogTheme()));
+ layout = inflater.inflate(R.layout.compose_dialog, null);
+ dialog = builder.setView(layout).create();
+ final Dialog composeDialog = dialog;
+ final EditText composeDestination = (EditText) layout.findViewById(R.id.compose_destination_input);
+ final EditText composeSubject = (EditText) layout.findViewById(R.id.compose_subject_input);
+ final EditText composeText = (EditText) layout.findViewById(R.id.compose_text_input);
+ final Button composeSendButton = (Button) layout.findViewById(R.id.compose_send_button);
+ final Button composeCancelButton = (Button) layout.findViewById(R.id.compose_cancel_button);
+ final EditText composeCaptcha = (EditText) layout.findViewById(R.id.compose_captcha_input);
+ composeSendButton.setOnClickListener(new OnClickListener() {
+ public void onClick(View v) {
+ ThingInfo thingInfo = new ThingInfo();
+ // reddit.com performs these sanity checks too.
+ if ("".equals(composeDestination.getText().toString().trim())) {
+ Toast.makeText(InboxActivity.this, "please enter a username", Toast.LENGTH_LONG).show();
+ return;
+ }
+ if ("".equals(composeSubject.getText().toString().trim())) {
+ Toast.makeText(InboxActivity.this, "please enter a subject", Toast.LENGTH_LONG).show();
+ return;
+ }
+ if ("".equals(composeText.getText().toString().trim())) {
+ Toast.makeText(InboxActivity.this, "you need to enter a message", Toast.LENGTH_LONG).show();
+ return;
+ }
+ if (composeCaptcha.getVisibility() == View.VISIBLE && "".equals(composeCaptcha.getText().toString().trim())) {
+ Toast.makeText(InboxActivity.this, "", Toast.LENGTH_LONG).show();
+ return;
+ }
+ thingInfo.setDest(composeDestination.getText().toString().trim());
+ thingInfo.setSubject(composeSubject.getText().toString().trim());
+ new MyMessageComposeTask(
+ composeDialog,
+ thingInfo,
+ composeCaptcha.getText().toString().trim(),
+ mCaptchaIden,
+ mSettings,
+ mClient,
+ InboxActivity.this
+ ).execute(composeText.getText().toString().trim());
+ removeDialog(Constants.DIALOG_COMPOSE);
+ }
+ });
+ composeCancelButton.setOnClickListener(new OnClickListener() {
+ public void onClick(View v) {
+ removeDialog(Constants.DIALOG_COMPOSE);
+ }
+ });
+ break;
+
+ case Constants.DIALOG_COMPOSING:
+ pdialog = new ProgressDialog(new ContextThemeWrapper(this, mSettings.getDialogTheme()));
+ pdialog.setMessage("Composing message...");
+ pdialog.setIndeterminate(true);
+ pdialog.setCancelable(false);
+ dialog = pdialog;
+ break;
+ default:
+ throw new IllegalArgumentException("Unexpected dialog id "+id);
+ }
+ return dialog;
+ }
+
+ @Override
+ protected void onPrepareDialog(int id, Dialog dialog) {
+ switch (id) {
+ case Constants.DIALOG_COMPOSE:
+ new MyCaptchaCheckRequiredTask(dialog).execute();
+ break;
+ }
+ }
+
+ private class MyMessageComposeTask extends MessageComposeTask {
+
+ public MyMessageComposeTask(Dialog dialog,
+ ThingInfo targetThingInfo, String captcha, String captchaIden,
+ RedditSettings settings, HttpClient client, Context context) {
+ super(dialog, targetThingInfo, captcha, captchaIden, settings, client, context);
+ }
+
+ @Override
+ public void onPreExecute() {
+ showDialog(Constants.DIALOG_COMPOSING);
+ }
+
+ @Override
+ public void onPostExecute(Boolean success) {
+ removeDialog(Constants.DIALOG_COMPOSING);
+ if (success) {
+ Toast.makeText(InboxActivity.this, "Message sent.", Toast.LENGTH_SHORT).show();
+ // TODO: add the reply beneath the original, OR redirect to sent messages page
+ } else {
+ Common.showErrorToast(_mUserError, Toast.LENGTH_LONG, InboxActivity.this);
+ }
+ }
+ }
+
+ private class MyCaptchaCheckRequiredTask extends CaptchaCheckRequiredTask {
+
+ Dialog _mDialog;
+
+ public MyCaptchaCheckRequiredTask(Dialog dialog) {
+ super(Constants.REDDIT_BASE_URL + "/message/compose/", mClient);
+ _mDialog = dialog;
+ }
+
+ @Override
+ protected void saveState() {
+ InboxActivity.this.mCaptchaIden = _mCaptchaIden;
+ InboxActivity.this.mCaptchaUrl = _mCaptchaUrl;
+ }
+
+ @Override
+ public void onPreExecute() {
+ // Hide send button so user can't send until we know whether he needs captcha
+ final Button sendButton = (Button) _mDialog.findViewById(R.id.compose_send_button);
+ sendButton.setVisibility(View.INVISIBLE);
+ // Show "loading captcha" label
+ final TextView loadingCaptcha = (TextView) _mDialog.findViewById(R.id.compose_captcha_loading);
+ loadingCaptcha.setVisibility(View.VISIBLE);
+ }
+
+ @Override
+ public void onPostExecute(Boolean required) {
+ final TextView captchaLabel = (TextView) _mDialog.findViewById(R.id.compose_captcha_textview);
+ final ImageView captchaImage = (ImageView) _mDialog.findViewById(R.id.compose_captcha_image);
+ final EditText captchaEdit = (EditText) _mDialog.findViewById(R.id.compose_captcha_input);
+ final TextView loadingCaptcha = (TextView) _mDialog.findViewById(R.id.compose_captcha_loading);
+ final Button sendButton = (Button) _mDialog.findViewById(R.id.compose_send_button);
+ if (required == null) {
+ Common.showErrorToast("Error retrieving captcha. Use the menu to try again.", Toast.LENGTH_LONG, InboxActivity.this);
+ return;
+ }
+ if (required) {
+ captchaLabel.setVisibility(View.VISIBLE);
+ captchaImage.setVisibility(View.VISIBLE);
+ captchaEdit.setVisibility(View.VISIBLE);
+ // Launch a task to download captcha and display it
+ new MyCaptchaDownloadTask(_mDialog).execute();
+ } else {
+ captchaLabel.setVisibility(View.GONE);
+ captchaImage.setVisibility(View.GONE);
+ captchaEdit.setVisibility(View.GONE);
+ }
+ loadingCaptcha.setVisibility(View.GONE);
+ sendButton.setVisibility(View.VISIBLE);
+ }
+ }
+
+ private class MyCaptchaDownloadTask extends CaptchaDownloadTask {
+
+ Dialog _mDialog;
+
+ public MyCaptchaDownloadTask(Dialog dialog) {
+ super(mCaptchaUrl, mClient);
+ _mDialog = dialog;
+ }
+
+ @Override
+ public void onPostExecute(Drawable captcha) {
+ if (captcha == null) {
+ Common.showErrorToast("Error retrieving captcha. Use the menu to try again.", Toast.LENGTH_LONG, InboxActivity.this);
+ return;
+ }
+ final ImageView composeCaptchaView = (ImageView) _mDialog.findViewById(R.id.compose_captcha_image);
+ composeCaptchaView.setVisibility(View.VISIBLE);
+ composeCaptchaView.setImageDrawable(captcha);
+ }
+ }
+
}
View
272 src/com/andrewshu/android/reddit/mail/InboxListActivity.java
@@ -50,7 +50,6 @@
import android.content.Context;
import android.content.Intent;
import android.graphics.Typeface;
-import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.text.Html;
@@ -66,7 +65,6 @@
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.Menu;
-import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
@@ -77,15 +75,11 @@
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
-import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import com.andrewshu.android.reddit.R;
-import com.andrewshu.android.reddit.captcha.CaptchaCheckRequiredTask;
-import com.andrewshu.android.reddit.captcha.CaptchaDownloadTask;
-import com.andrewshu.android.reddit.captcha.CaptchaException;
import com.andrewshu.android.reddit.comments.CommentsListActivity;
import com.andrewshu.android.reddit.common.Common;
import com.andrewshu.android.reddit.common.Constants;
@@ -147,9 +141,6 @@
private String mLastBefore = null;
private int mLastCount = 0;
- private volatile String mCaptchaIden = null;
- private volatile String mCaptchaUrl = null;
-
// ProgressDialogs with percentage bars
// private AutoResetProgressDialog mLoadingCommentsProgress;
// private int mNumVisibleMessages;
@@ -259,7 +250,10 @@ public Object onRetainNonConfigurationInstance() {
private void restoreLastNonConfigurationInstance() {
mMessagesList = (ArrayList<ThingInfo>) getLastNonConfigurationInstance();
}
-
+
+ public void refresh() {
+ new DownloadMessagesTask(mWhichInbox).execute(Constants.DEFAULT_COMMENT_DOWNLOAD_LIMIT);
+ }
/**
@@ -914,207 +908,6 @@ public void onPostExecute(Boolean success) {
}
}
- private class MessageComposeTask extends AsyncTask<String, Void, Boolean> {
- Dialog _mDialog; // needed to update CAPTCHA on failure
- ThingInfo _mTargetThingInfo;
- String _mUserError = "Error composing message. Please try again.";
- String _mCaptcha;
-
- MessageComposeTask(Dialog dialog, ThingInfo targetThingInfo, String captcha) {
- _mDialog = dialog;
- _mTargetThingInfo = targetThingInfo;
- _mCaptcha = captcha;
- }
-
- @Override
- public Boolean doInBackground(String... text) {
- HttpEntity entity = null;
-
- if (!mSettings.isLoggedIn()) {
- Common.showErrorToast("You must be logged in to compose a message.", Toast.LENGTH_LONG, InboxListActivity.this);
- _mUserError = "Not logged in";
- return false;
- }
- // Update the modhash if necessary
- if (mSettings.getModhash() == null) {
- String modhash = Common.doUpdateModhash(mClient);
- if (modhash == null) {
- // doUpdateModhash should have given an error about credentials
- Common.doLogout(mSettings, mClient, getApplicationContext());
- if (Constants.LOGGING) Log.e(TAG, "Message compose failed because doUpdateModhash() failed");
- return false;
- }
- mSettings.setModhash(modhash);
- }
-
- try {
- // Construct data
- List<NameValuePair> nvps = new ArrayList<NameValuePair>();
- nvps.add(new BasicNameValuePair("text", text[0].toString()));
- nvps.add(new BasicNameValuePair("subject", _mTargetThingInfo.getSubject()));
- nvps.add(new BasicNameValuePair("to", _mTargetThingInfo.getDest()));
- nvps.add(new BasicNameValuePair("uh", mSettings.getModhash().toString()));
- nvps.add(new BasicNameValuePair("thing_id", ""));
- if (mCaptchaIden != null) {
- nvps.add(new BasicNameValuePair("iden", mCaptchaIden));
- nvps.add(new BasicNameValuePair("captcha", _mCaptcha.toString()));
- }
-
- HttpPost httppost = new HttpPost(Constants.REDDIT_BASE_URL + "/api/compose");
- httppost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));
-
- if (Constants.LOGGING) Log.d(TAG, nvps.toString());
-
- // Perform the HTTP POST request
- HttpResponse response = mClient.execute(httppost);
- entity = response.getEntity();
-
- // Don't need the return value ID since reply isn't posted to inbox
- Common.checkIDResponse(response, entity);
-
- return true;
-
- } catch (CaptchaException e) {
- if (Constants.LOGGING) Log.e(TAG, "CaptchaException", e);
- _mUserError = e.getMessage();
- new MyCaptchaDownloadTask(_mDialog).execute();
- } catch (Exception e) {
- if (Constants.LOGGING) Log.e(TAG, "MessageComposeTask", e);
- _mUserError = e.getMessage();
- } finally {
- if (entity != null) {
- try {
- entity.consumeContent();
- } catch (IOException e2) {
- if (Constants.LOGGING) Log.e(TAG, "entity.consumeContent()", e2);
- }
- }
- }
- return false;
- }
-
- @Override
- public void onPreExecute() {
- showDialog(Constants.DIALOG_COMPOSING);
- }
-
- @Override
- public void onPostExecute(Boolean success) {
- removeDialog(Constants.DIALOG_COMPOSING);
- if (success) {
- Toast.makeText(InboxListActivity.this, "Message sent.", Toast.LENGTH_SHORT).show();
- // TODO: add the reply beneath the original, OR redirect to sent messages page
- } else {
- Common.showErrorToast(_mUserError, Toast.LENGTH_LONG, InboxListActivity.this);
- }
- }
- }
-
- private class MyCaptchaCheckRequiredTask extends CaptchaCheckRequiredTask {
-
- Dialog _mDialog;
-
- public MyCaptchaCheckRequiredTask(Dialog dialog) {
- super(Constants.REDDIT_BASE_URL + "/message/compose/", mClient);
- _mDialog = dialog;
- }
-
- @Override
- protected void saveState() {
- InboxListActivity.this.mCaptchaIden = _mCaptchaIden;
- InboxListActivity.this.mCaptchaUrl = _mCaptchaUrl;
- }
-
- @Override
- public void onPreExecute() {
- // Hide send button so user can't send until we know whether he needs captcha
- final Button sendButton = (Button) _mDialog.findViewById(R.id.compose_send_button);
- sendButton.setVisibility(View.INVISIBLE);
- // Show "loading captcha" label
- final TextView loadingCaptcha = (TextView) _mDialog.findViewById(R.id.compose_captcha_loading);
- loadingCaptcha.setVisibility(View.VISIBLE);
- }
-
- @Override
- public void onPostExecute(Boolean required) {
- final TextView captchaLabel = (TextView) _mDialog.findViewById(R.id.compose_captcha_textview);
- final ImageView captchaImage = (ImageView) _mDialog.findViewById(R.id.compose_captcha_image);
- final EditText captchaEdit = (EditText) _mDialog.findViewById(R.id.compose_captcha_input);
- final TextView loadingCaptcha = (TextView) _mDialog.findViewById(R.id.compose_captcha_loading);
- final Button sendButton = (Button) _mDialog.findViewById(R.id.compose_send_button);
- if (required == null) {
- Common.showErrorToast("Error retrieving captcha. Use the menu to try again.", Toast.LENGTH_LONG, InboxListActivity.this);
- return;
- }
- if (required) {
- captchaLabel.setVisibility(View.VISIBLE);
- captchaImage.setVisibility(View.VISIBLE);
- captchaEdit.setVisibility(View.VISIBLE);
- // Launch a task to download captcha and display it
- new MyCaptchaDownloadTask(_mDialog).execute();
- } else {
- captchaLabel.setVisibility(View.GONE);
- captchaImage.setVisibility(View.GONE);
- captchaEdit.setVisibility(View.GONE);
- }
- loadingCaptcha.setVisibility(View.GONE);
- sendButton.setVisibility(View.VISIBLE);
- }
- }
-
- private class MyCaptchaDownloadTask extends CaptchaDownloadTask {
-
- Dialog _mDialog;
-
- public MyCaptchaDownloadTask(Dialog dialog) {
- super(mCaptchaUrl, mClient);
- _mDialog = dialog;
- }
-
- @Override
- public void onPostExecute(Drawable captcha) {
- if (captcha == null) {
- Common.showErrorToast("Error retrieving captcha. Use the menu to try again.", Toast.LENGTH_LONG, InboxListActivity.this);
- return;
- }
- final ImageView composeCaptchaView = (ImageView) _mDialog.findViewById(R.id.compose_captcha_image);
- composeCaptchaView.setVisibility(View.VISIBLE);
- composeCaptchaView.setImageDrawable(captcha);
- }
- }
-
-
-
- /**
- * Populates the menu.
- */
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- super.onCreateOptionsMenu(menu);
-
- MenuInflater inflater = getMenuInflater();
- inflater.inflate(R.menu.inbox, menu);
-
- return true;
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
-
- switch (item.getItemId()) {
- case R.id.compose_message_menu_id:
- showDialog(Constants.DIALOG_COMPOSE);
- break;
- case R.id.refresh_menu_id:
- new DownloadMessagesTask(mWhichInbox).execute(Constants.DEFAULT_COMMENT_DOWNLOAD_LIMIT);
- break;
- case android.R.id.home:
- Common.goHome(this);
- break;
- }
-
- return true;
- }
@Override
protected Dialog onCreateDialog(int id) {
@@ -1158,52 +951,6 @@ public void onClick(View v) {
}
});
break;
- case Constants.DIALOG_COMPOSE:
- inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- builder = new AlertDialog.Builder(new ContextThemeWrapper(this, mSettings.getDialogTheme()));
- layout = inflater.inflate(R.layout.compose_dialog, null);
- dialog = builder.setView(layout).create();
- final Dialog composeDialog = dialog;
- final EditText composeDestination = (EditText) layout.findViewById(R.id.compose_destination_input);
- final EditText composeSubject = (EditText) layout.findViewById(R.id.compose_subject_input);
- final EditText composeText = (EditText) layout.findViewById(R.id.compose_text_input);
- final Button composeSendButton = (Button) layout.findViewById(R.id.compose_send_button);
- final Button composeCancelButton = (Button) layout.findViewById(R.id.compose_cancel_button);
- final EditText composeCaptcha = (EditText) layout.findViewById(R.id.compose_captcha_input);
- composeSendButton.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- ThingInfo hi = new ThingInfo();
- // reddit.com performs these sanity checks too.
- if ("".equals(composeDestination.getText().toString().trim())) {
- Toast.makeText(InboxListActivity.this, "please enter a username", Toast.LENGTH_LONG).show();
- return;
- }
- if ("".equals(composeSubject.getText().toString().trim())) {
- Toast.makeText(InboxListActivity.this, "please enter a subject", Toast.LENGTH_LONG).show();
- return;
- }
- if ("".equals(composeText.getText().toString().trim())) {
- Toast.makeText(InboxListActivity.this, "you need to enter a message", Toast.LENGTH_LONG).show();
- return;
- }
- if (composeCaptcha.getVisibility() == View.VISIBLE && "".equals(composeCaptcha.getText().toString().trim())) {
- Toast.makeText(InboxListActivity.this, "", Toast.LENGTH_LONG).show();
- return;
- }
- hi.setDest(composeDestination.getText().toString().trim());
- hi.setSubject(composeSubject.getText().toString().trim());
- new MessageComposeTask(composeDialog, hi, composeCaptcha.getText().toString().trim())
- .execute(composeText.getText().toString().trim());
- removeDialog(Constants.DIALOG_COMPOSE);
- }
- });
- composeCancelButton.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- removeDialog(Constants.DIALOG_COMPOSE);
- }
- });
- break;
-
// "Please wait"
case Constants.DIALOG_LOGGING_IN:
pdialog = new ProgressDialog(new ContextThemeWrapper(this, mSettings.getDialogTheme()));
@@ -1219,13 +966,6 @@ public void onClick(View v) {
pdialog.setCancelable(false);
dialog = pdialog;
break;
- case Constants.DIALOG_COMPOSING:
- pdialog = new ProgressDialog(new ContextThemeWrapper(this, mSettings.getDialogTheme()));
- pdialog.setMessage("Composing message...");
- pdialog.setIndeterminate(true);
- pdialog.setCancelable(false);
- dialog = pdialog;
- break;
default:
throw new IllegalArgumentException("Unexpected dialog id "+id);
@@ -1254,10 +994,6 @@ protected void onPrepareDialog(int id, Dialog dialog) {
}
break;
- case Constants.DIALOG_COMPOSE:
- new MyCaptchaCheckRequiredTask(dialog).execute();
- break;
-
default:
// No preparation based on app state is required.
break;
Please sign in to comment.
Something went wrong with that request. Please try again.