diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:49 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:49 -0800 |
commit | 2cb8df4a54d65554c34faa79d8b2a46a86ff7b52 (patch) | |
tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /src/com/android/calendar/EditResponseHelper.java | |
parent | 0d78b568cd2c23fda9475c1dfaddad7c57ec3984 (diff) | |
download | android_packages_apps_Calendar-2cb8df4a54d65554c34faa79d8b2a46a86ff7b52.tar.gz android_packages_apps_Calendar-2cb8df4a54d65554c34faa79d8b2a46a86ff7b52.tar.bz2 android_packages_apps_Calendar-2cb8df4a54d65554c34faa79d8b2a46a86ff7b52.zip |
auto import from //depot/cupcake/@135843
Diffstat (limited to 'src/com/android/calendar/EditResponseHelper.java')
-rw-r--r-- | src/com/android/calendar/EditResponseHelper.java | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/src/com/android/calendar/EditResponseHelper.java b/src/com/android/calendar/EditResponseHelper.java deleted file mode 100644 index 378ef458..00000000 --- a/src/com/android/calendar/EditResponseHelper.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.calendar; - -import android.app.Activity; -import android.app.AlertDialog; -import android.content.DialogInterface; -import android.widget.Button; - -/** - * A helper class for editing the response to an invitation when the invitation - * is a repeating event. - */ -public class EditResponseHelper implements DialogInterface.OnClickListener { - private final Activity mParent; - private int mWhichEvents = -1; - private AlertDialog mAlertDialog; - - /** - * This callback is passed in to this object when this object is created - * and is invoked when the "Ok" button is selected. - */ - private DialogInterface.OnClickListener mDialogListener; - - public EditResponseHelper(Activity parent) { - mParent = parent; - } - - public void setOnClickListener(DialogInterface.OnClickListener listener) { - mDialogListener = listener; - } - - public int getWhichEvents() { - return mWhichEvents; - } - - public void onClick(DialogInterface dialog, int which) { - } - - /** - * This callback is used when a list item is selected - */ - private DialogInterface.OnClickListener mListListener = - new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int which) { - mWhichEvents = which; - - // Enable the "ok" button now that the user has selected which - // events in the series to delete. - Button ok = mAlertDialog.getButton(DialogInterface.BUTTON_POSITIVE); - ok.setEnabled(true); - } - }; - - public void showDialog(int whichEvents) { - // We need to have a non-null listener, otherwise we get null when - // we try to fetch the "Ok" button. - if (mDialogListener == null) { - mDialogListener = this; - } - AlertDialog dialog = new AlertDialog.Builder(mParent) - .setTitle(R.string.change_response_title) - .setIcon(android.R.drawable.ic_dialog_alert) - .setSingleChoiceItems(R.array.change_response_labels, whichEvents, - mListListener) - .setPositiveButton(android.R.string.ok, mDialogListener) - .setNegativeButton(android.R.string.cancel, null) - .show(); - mAlertDialog = dialog; - - if (whichEvents == -1) { - // Disable the "Ok" button until the user selects which events to - // delete. - Button ok = dialog.getButton(DialogInterface.BUTTON_POSITIVE); - ok.setEnabled(false); - } - } -} |