Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1457)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/input/InputDialogContainer.java

Issue 429633003: [Android] Pass the right listener to DatePickerDialog (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/android/java/src/org/chromium/content/browser/input/InputDialogContainer.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/InputDialogContainer.java b/content/public/android/java/src/org/chromium/content/browser/input/InputDialogContainer.java
index 44bf207b3b6d7f2de6523420c20ebb2ef1b67fa4..f2c91e6a9c6304bb69b330bd9fd41e68a16ef879 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/InputDialogContainer.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/InputDialogContainer.java
@@ -16,6 +16,7 @@ import android.widget.DatePicker;
import android.widget.ListView;
import android.widget.TimePicker;
+import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.content.R;
import org.chromium.content.browser.input.DateTimePickerDialog.OnDateTimeSetListener;
import org.chromium.content.browser.input.MultiFieldTimePickerDialog.OnMultiFieldTimeSetListener;
@@ -246,10 +247,11 @@ public class InputDialogContainer {
mDialog = new WeekPickerDialog(mContext, new MonthOrWeekListener(dialogType),
year, week, min, max);
}
-
- mDialog.setButton(DialogInterface.BUTTON_POSITIVE,
- mContext.getText(R.string.date_picker_dialog_set),
- (DialogInterface.OnClickListener) mDialog);
+ if (ApiCompatibilityUtils.datePickerRequiresAccept()) {
+ mDialog.setButton(DialogInterface.BUTTON_POSITIVE,
+ mContext.getText(R.string.date_picker_dialog_set),
+ (DialogInterface.OnClickListener) mDialog);
+ }
mDialog.setButton(DialogInterface.BUTTON_NEGATIVE,
mContext.getText(android.R.string.cancel),

Powered by Google App Engine
This is Rietveld 408576698