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

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

Issue 85643002: Transfer date/time value to chooser as double (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@doubledate2
Patch Set: Created 7 years 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/TwoFieldDatePickerDialog.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/TwoFieldDatePickerDialog.java b/content/public/android/java/src/org/chromium/content/browser/input/TwoFieldDatePickerDialog.java
index 7c36c36cf206f7b893b66b886b7998203096e986..d862e6e078cb86449c7ae9f9da89fabfa161d728 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/TwoFieldDatePickerDialog.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/TwoFieldDatePickerDialog.java
@@ -29,8 +29,7 @@ public abstract class TwoFieldDatePickerDialog extends AlertDialog implements On
/**
* @param year The year that was set.
- * @param positionInYear The week in year.
- * with {@link java.util.Calendar}.
+ * @param positionInYear The position in the year that was set.
*/
void onValueSet(int year, int positionInYear);
}
@@ -45,8 +44,8 @@ public abstract class TwoFieldDatePickerDialog extends AlertDialog implements On
OnValueSetListener callBack,
int year,
int positionInYear,
- long minValue,
- long maxValue) {
+ double minValue,
+ double maxValue) {
this(context, 0, callBack, year, positionInYear, minValue, maxValue);
}
@@ -62,8 +61,8 @@ public abstract class TwoFieldDatePickerDialog extends AlertDialog implements On
OnValueSetListener callBack,
int year,
int positionInYear,
- long minValue,
- long maxValue) {
+ double minValue,
+ double maxValue) {
super(context, theme);
mCallBack = callBack;
@@ -79,7 +78,7 @@ public abstract class TwoFieldDatePickerDialog extends AlertDialog implements On
mPicker.init(year, positionInYear, this);
}
- protected TwoFieldDatePicker createPicker(Context context, long minValue, long maxValue) {
+ protected TwoFieldDatePicker createPicker(Context context, double minValue, double maxValue) {
return null;
}
@@ -91,7 +90,12 @@ public abstract class TwoFieldDatePickerDialog extends AlertDialog implements On
/**
* Notifies the listener, if such, that a date has been set.
*/
- protected abstract void tryNotifyDateSet();
+ protected void tryNotifyDateSet() {
+ if (mCallBack != null) {
+ mPicker.clearFocus();
+ mCallBack.onValueSet(mPicker.getYear(), mPicker.getPositionInYear());
+ }
+ }
@Override
protected void onStop() {

Powered by Google App Engine
This is Rietveld 408576698