Commit a91f4578 authored by ankit2.kumar's avatar ankit2.kumar Committed by Commit bot

Move *Picker.java and *PickerDialog.java to ui/android/java/...

There is no reason for the following files to live in content/ layer
and they should all be moved to ui/ layer.

BUG=302114

Review URL: https://codereview.chromium.org/574673003

Cr-Commit-Position: refs/heads/master@{#296637}
parent 76e47747
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2013 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical"
android:gravity="start">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/time_picker_dialog_title"
android:textSize="20sp"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:gravity="start"
android:textColor="#33B5E5"
/>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:background="#33B5E5"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="horizontal"
android:gravity="center">
<NumberPicker
android:id="@+id/hour"
android:layout_width="0dp"
android:layout_weight=".2"
android:textSize="12sp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:contentDescription="@string/accessibility_time_picker_hour"
/>
<TextView
android:layout_width="wrap_content"
android:textSize="12sp"
android:layout_height="wrap_content"
android:text="@string/time_picker_dialog_hour_minute_separator"
/>
<NumberPicker
android:id="@+id/minute"
android:layout_width="0dp"
android:layout_weight=".2"
android:textSize="12sp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:contentDescription="@string/accessibility_time_picker_minute"
/>
<TextView
android:id="@+id/second_colon"
android:layout_width="wrap_content"
android:textSize="12sp"
android:layout_height="wrap_content"
android:text="@string/time_picker_dialog_minute_second_separator" />
<NumberPicker
android:id="@+id/second"
android:layout_width="0dp"
android:layout_weight=".2"
android:textSize="12sp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:contentDescription="@string/accessibility_time_picker_second"
/>
<TextView
android:id="@+id/second_dot"
android:layout_width="wrap_content"
android:textSize="12sp"
android:layout_height="wrap_content"
android:text="@string/time_picker_dialog_second_subsecond_separator"
/>
<NumberPicker
android:id="@+id/milli"
android:layout_width="0dp"
android:layout_weight=".2"
android:textSize="12sp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:contentDescription="@string/accessibility_time_picker_milli"
/>
<NumberPicker
android:id="@+id/ampm"
android:layout_width="0dp"
android:layout_weight=".2"
android:textSize="12sp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:contentDescription="@string/accessibility_time_picker_ampm"
/>
</LinearLayout>
</LinearLayout>
...@@ -57,10 +57,6 @@ public final class R { ...@@ -57,10 +57,6 @@ public final class R {
} }
/** layouts */ /** layouts */
public static final class layout { public static final class layout {
public static int date_time_picker_dialog;
public static int date_time_suggestion;
public static int two_field_date_picker;
public static int multi_field_time_picker_dialog;
public static int validation_message_bubble; public static int validation_message_bubble;
} }
/** menus */ /** menus */
...@@ -70,24 +66,16 @@ public final class R { ...@@ -70,24 +66,16 @@ public final class R {
/** strings */ /** strings */
public static final class string { public static final class string {
public static int accessibility_content_view; public static int accessibility_content_view;
public static int accessibility_date_picker_month;
public static int accessibility_date_picker_week;
public static int accessibility_date_picker_year;
public static int accessibility_datetime_picker_date; public static int accessibility_datetime_picker_date;
public static int accessibility_datetime_picker_time; public static int accessibility_datetime_picker_time;
public static int actionbar_share; public static int actionbar_share;
public static int actionbar_web_search; public static int actionbar_web_search;
public static int date_picker_dialog_clear;
public static int date_picker_dialog_set;
public static int date_picker_dialog_title;
public static int date_picker_dialog_other_button_label;
public static int date_time_picker_dialog_title; public static int date_time_picker_dialog_title;
public static int media_player_error_button; public static int media_player_error_button;
public static int media_player_error_text_invalid_progressive_playback; public static int media_player_error_text_invalid_progressive_playback;
public static int media_player_error_text_unknown; public static int media_player_error_text_unknown;
public static int media_player_error_title; public static int media_player_error_title;
public static int media_player_loading_video; public static int media_player_loading_video;
public static int month_picker_dialog_title;
public static int profiler_error_toast; public static int profiler_error_toast;
public static int profiler_no_storage_toast; public static int profiler_no_storage_toast;
public static int profiler_started_toast; public static int profiler_started_toast;
...@@ -97,8 +85,6 @@ public final class R { ...@@ -97,8 +85,6 @@ public final class R {
public static int time_picker_dialog_minute_second_separator; public static int time_picker_dialog_minute_second_separator;
public static int time_picker_dialog_second_subsecond_separator; public static int time_picker_dialog_second_subsecond_separator;
public static int time_picker_dialog_pm; public static int time_picker_dialog_pm;
public static int time_picker_dialog_title;
public static int week_picker_dialog_title;
} }
/** styles */ /** styles */
public static final class style { public static final class style {
......
...@@ -9,6 +9,8 @@ import android.content.Context; ...@@ -9,6 +9,8 @@ import android.content.Context;
import org.chromium.base.CalledByNative; import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace; import org.chromium.base.JNINamespace;
import org.chromium.content.browser.ContentViewCore; import org.chromium.content.browser.ContentViewCore;
import org.chromium.ui.picker.DateTimeSuggestion;
import org.chromium.ui.picker.InputDialogContainer;
/** /**
* Plumbing for the different date/time dialog adapters. * Plumbing for the different date/time dialog adapters.
......
...@@ -22,6 +22,7 @@ import java.lang.CharSequence; ...@@ -22,6 +22,7 @@ import java.lang.CharSequence;
import org.chromium.base.CalledByNative; import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace; import org.chromium.base.JNINamespace;
import org.chromium.base.VisibleForTesting; import org.chromium.base.VisibleForTesting;
import org.chromium.ui.picker.InputDialogContainer;
/** /**
* Adapts and plumbs android IME service onto the chrome text input API. * Adapts and plumbs android IME service onto the chrome text input API.
......
...@@ -102,75 +102,6 @@ ...@@ -102,75 +102,6 @@
<message desc="Content description for the content view that holds the web contents [CHAR-LIMIT=32]" name="IDS_ACCESSIBILITY_CONTENT_VIEW"> <message desc="Content description for the content view that holds the web contents [CHAR-LIMIT=32]" name="IDS_ACCESSIBILITY_CONTENT_VIEW">
Web View Web View
</message> </message>
<message desc="Title for the date picker dialog, which can be used to choose a date. [CHAR-LIMIT=32]" name="IDS_DATE_PICKER_DIALOG_TITLE">
Set date
</message>
<message desc="Label for 'set' button in date picker dialog and time picker dialog, used to replace the contents of a field with the chosen date or time [CHAR-LIMIT=12]" name="IDS_DATE_PICKER_DIALOG_SET">
Set
</message>
<message desc="Label for 'clear' button in date picker dialog and time picker dialog, used to replace the contents of a field with the empty string [CHAR-LIMIT=12]" name="IDS_DATE_PICKER_DIALOG_CLEAR">
Clear
</message>
<message desc="Label for 'other' button in date picker dialog and time picker dialog, used to close the list of suggestions and open the the full date/time picker [CHAR-LIMIT=32]" name="IDS_DATE_PICKER_DIALOG_OTHER_BUTTON_LABEL">
Other
</message>
<message desc="Title for the date/time picker dialog, which can be used to choose a date and time. [CHAR-LIMIT=32]" name="IDS_DATE_TIME_PICKER_DIALOG_TITLE">
Set date and time
</message>
<message desc="Title for the time picker dialog, which can be used to choose a time. [CHAR-LIMIT=32]" name="IDS_TIME_PICKER_DIALOG_TITLE">
Set time
</message>
<message desc="Value for AM in AM/PM in the time picker dialog. AM represents the morning (ante-meridiem). [CHAR-LIMIT=12]" name="IDS_TIME_PICKER_DIALOG_AM">
AM
</message>
<message desc="Value for PM in AM/PM in the time picker dialog. PM represents the afternoon (post-meridiem). [CHAR-LIMIT=12]" name="IDS_TIME_PICKER_DIALOG_PM">
PM
</message>
<message desc="Separator used between hours and minutes in the time pickerr dialog (hh:mm) [CHAR-LIMIT=1]" name="IDS_TIME_PICKER_DIALOG_HOUR_MINUTE_SEPARATOR">
:
</message>
<message desc="Separator used between minutes and seconds in the time picker dialog (hh:mm:ss) [CHAR-LIMIT=1]" name="IDS_TIME_PICKER_DIALOG_MINUTE_SECOND_SEPARATOR">
:
</message>
<message desc="Separator used between seconds and subseconds in the time picker dialog (hh:mm:ss.sss) [CHAR-LIMIT=1]" name="IDS_TIME_PICKER_DIALOG_SECOND_SUBSECOND_SEPARATOR">
.
</message>
<message desc="Title for the month picker dialog, which can be used to choose a month. [CHAR-LIMIT=32]" name="IDS_MONTH_PICKER_DIALOG_TITLE">
Set month
</message>
<message desc="Title for the week picker dialog, which can be used to choose a week. [CHAR-LIMIT=32]" name="IDS_WEEK_PICKER_DIALOG_TITLE">
Set week
</message>
<message desc="Content description for the date time picker date component. [CHAR-LIMIT=32]" name="IDS_ACCESSIBILITY_DATETIME_PICKER_DATE">
Date
</message>
<message desc="Content description for the date time picker time component. [CHAR-LIMIT=32]" name="IDS_ACCESSIBILITY_DATETIME_PICKER_TIME">
Time
</message>
<message desc="Content description for the date time picker month component. [CHAR-LIMIT=32]" name="IDS_ACCESSIBILITY_DATE_PICKER_MONTH">
Month
</message>
<message desc="Content description for the date time picker week component. [CHAR-LIMIT=32]" name="IDS_ACCESSIBILITY_DATE_PICKER_WEEK">
Week
</message>
<message desc="Content description for the date time picker year component. [CHAR-LIMIT=32]" name="IDS_ACCESSIBILITY_DATE_PICKER_YEAR">
Year
</message>
<message desc="Content description for the time picker hour component. [CHAR-LIMIT=32]" name="IDS_ACCESSIBILITY_TIME_PICKER_HOUR">
Hour
</message>
<message desc="Content description for the time picker minute component. [CHAR-LIMIT=32]" name="IDS_ACCESSIBILITY_TIME_PICKER_MINUTE">
Minute
</message>
<message desc="Content description for the time picker second component. [CHAR-LIMIT=32]" name="IDS_ACCESSIBILITY_TIME_PICKER_SECOND">
Second
</message>
<message desc="Content description for the time picker milli component. [CHAR-LIMIT=32]" name="IDS_ACCESSIBILITY_TIME_PICKER_MILLI">
Millisecond
</message>
<message desc="Content description for the time picker AM/PM component. [CHAR-LIMIT=32]" name="IDS_ACCESSIBILITY_TIME_PICKER_AMPM">
AM/PM
</message>
<message desc="NO DESCRIPTION [CHAR-LIMIT=32]" name="IDS_MEDIA_PLAYER_ERROR_TITLE"> <message desc="NO DESCRIPTION [CHAR-LIMIT=32]" name="IDS_MEDIA_PLAYER_ERROR_TITLE">
Cannot play video Cannot play video
</message> </message>
......
...@@ -9,6 +9,7 @@ import android.test.AndroidTestCase; ...@@ -9,6 +9,7 @@ import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.SmallTest; import android.test.suitebuilder.annotation.SmallTest;
import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Feature;
import org.chromium.ui.picker.InputDialogContainer;
public class InputDialogContainerTest extends AndroidTestCase { public class InputDialogContainerTest extends AndroidTestCase {
private static final int TEXT_INPUT_TYPE_DATE = 0; private static final int TEXT_INPUT_TYPE_DATE = 0;
...@@ -373,7 +374,7 @@ public class InputDialogContainerTest extends AndroidTestCase { ...@@ -373,7 +374,7 @@ public class InputDialogContainerTest extends AndroidTestCase {
} }
@Override @Override
void showPickerDialog(final int dialogType, protected void showPickerDialog(final int dialogType,
int year, int month, int monthDay, int year, int month, int monthDay,
int hourOfDay, int minute, int second, int millis, int week, int hourOfDay, int minute, int second, int millis, int week,
double min, double max, double step) { double min, double max, double step) {
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved. <!-- Copyright 2012 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. found in the LICENSE file.
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2013 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical"
android:gravity="start">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/time_picker_dialog_title"
android:textSize="20sp"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:gravity="start"
android:textColor="#33B5E5"
/>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:background="#33B5E5"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="horizontal"
android:gravity="center">
<NumberPicker
android:id="@+id/hour"
android:layout_width="0dp"
android:layout_weight=".2"
android:textSize="12sp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:contentDescription="@string/accessibility_time_picker_hour"
/>
<TextView
android:layout_width="wrap_content"
android:textSize="12sp"
android:layout_height="wrap_content"
android:text="@string/time_picker_dialog_hour_minute_separator"
/>
<NumberPicker
android:id="@+id/minute"
android:layout_width="0dp"
android:layout_weight=".2"
android:textSize="12sp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:contentDescription="@string/accessibility_time_picker_minute"
/>
<TextView
android:id="@+id/second_colon"
android:layout_width="wrap_content"
android:textSize="12sp"
android:layout_height="wrap_content"
android:text="@string/time_picker_dialog_minute_second_separator" />
<NumberPicker
android:id="@+id/second"
android:layout_width="0dp"
android:layout_weight=".2"
android:textSize="12sp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:contentDescription="@string/accessibility_time_picker_second"
/>
<TextView
android:id="@+id/second_dot"
android:layout_width="wrap_content"
android:textSize="12sp"
android:layout_height="wrap_content"
android:text="@string/time_picker_dialog_second_subsecond_separator"
/>
<NumberPicker
android:id="@+id/milli"
android:layout_width="0dp"
android:layout_weight=".2"
android:textSize="12sp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:contentDescription="@string/accessibility_time_picker_milli"
/>
<NumberPicker
android:id="@+id/ampm"
android:layout_width="0dp"
android:layout_weight=".2"
android:textSize="12sp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:contentDescription="@string/accessibility_time_picker_ampm"
/>
</LinearLayout>
</LinearLayout>
...@@ -16,6 +16,9 @@ package org.chromium.ui; ...@@ -16,6 +16,9 @@ package org.chromium.ui;
*/ */
public final class R { public final class R {
public static final class string { public static final class string {
public static int accessibility_date_picker_month;
public static int accessibility_date_picker_year;
public static int accessibility_date_picker_week;
public static int copy_to_clipboard_failure_message; public static int copy_to_clipboard_failure_message;
public static int low_memory_error; public static int low_memory_error;
public static int opening_file_error; public static int opening_file_error;
...@@ -34,6 +37,13 @@ public final class R { ...@@ -34,6 +37,13 @@ public final class R {
public static int color_picker_button_yellow; public static int color_picker_button_yellow;
public static int color_picker_button_black; public static int color_picker_button_black;
public static int color_picker_button_white; public static int color_picker_button_white;
public static int date_picker_dialog_set;
public static int date_picker_dialog_other_button_label;
public static int date_picker_dialog_clear;
public static int date_picker_dialog_title;
public static int month_picker_dialog_title;
public static int time_picker_dialog_title;
public static int week_picker_dialog_title;
} }
public static final class id { public static final class id {
public static int dropdown_label; public static int dropdown_label;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
package org.chromium.content.browser.input; package org.chromium.ui.picker;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
package org.chromium.content.browser.input; package org.chromium.ui.picker;
import android.widget.DatePicker; import android.widget.DatePicker;
import android.widget.DatePicker.OnDateChangedListener; import android.widget.DatePicker.OnDateChangedListener;
...@@ -13,7 +13,7 @@ import java.util.TimeZone; ...@@ -13,7 +13,7 @@ import java.util.TimeZone;
/** /**
* Normalize a date dialog so that it respect min and max. * Normalize a date dialog so that it respect min and max.
*/ */
class DateDialogNormalizer { public class DateDialogNormalizer {
private static void setLimits(DatePicker picker, long minMillis, long maxMillis) { private static void setLimits(DatePicker picker, long minMillis, long maxMillis) {
// DatePicker intervals are non inclusive, the DatePicker will throw an // DatePicker intervals are non inclusive, the DatePicker will throw an
...@@ -56,7 +56,7 @@ class DateDialogNormalizer { ...@@ -56,7 +56,7 @@ class DateDialogNormalizer {
* Normalizes an existing DateDialogPicker changing the default date if * Normalizes an existing DateDialogPicker changing the default date if
* needed to comply with the {@code min} and {@code max} attributes. * needed to comply with the {@code min} and {@code max} attributes.
*/ */
static void normalize(DatePicker picker, OnDateChangedListener listener, public static void normalize(DatePicker picker, OnDateChangedListener listener,
int year, int month, int day, int hour, int minute, long minMillis, long maxMillis) { int year, int month, int day, int hour, int minute, long minMillis, long maxMillis) {
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT")); Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
calendar.clear(); calendar.clear();
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
package org.chromium.content.browser.input; package org.chromium.ui.picker;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.Context; import android.content.Context;
...@@ -16,9 +16,9 @@ import android.widget.DatePicker.OnDateChangedListener; ...@@ -16,9 +16,9 @@ import android.widget.DatePicker.OnDateChangedListener;
import android.widget.TimePicker; import android.widget.TimePicker;
import android.widget.TimePicker.OnTimeChangedListener; import android.widget.TimePicker.OnTimeChangedListener;
import org.chromium.content.R; import org.chromium.ui.R;
class DateTimePickerDialog extends AlertDialog implements OnClickListener, public class DateTimePickerDialog extends AlertDialog implements OnClickListener,
OnDateChangedListener, OnTimeChangedListener { OnDateChangedListener, OnTimeChangedListener {
private final DatePicker mDatePicker; private final DatePicker mDatePicker;
private final TimePicker mTimePicker; private final TimePicker mTimePicker;
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
package org.chromium.content.browser.input; package org.chromium.ui.picker;
/** /**
* Date/time suggestion container used to store information for each suggestion that will be shown * Date/time suggestion container used to store information for each suggestion that will be shown
* in the suggestion list dialog. Keep in sync with date_time_suggestion.h. * in the suggestion list dialog. Keep in sync with date_time_suggestion.h.
*/ */
class DateTimeSuggestion { public class DateTimeSuggestion {
private final double mValue; private final double mValue;
private final String mLocalizedValue; private final String mLocalizedValue;
private final String mLabel; private final String mLabel;
...@@ -19,7 +19,7 @@ class DateTimeSuggestion { ...@@ -19,7 +19,7 @@ class DateTimeSuggestion {
* @param localizedValue The suggested value localized. * @param localizedValue The suggested value localized.
* @param label The label for the suggestion. * @param label The label for the suggestion.
*/ */
DateTimeSuggestion(double value, String localizedValue, String label) { public DateTimeSuggestion(double value, String localizedValue, String label) {
mValue = value; mValue = value;
mLocalizedValue = localizedValue; mLocalizedValue = localizedValue;
mLabel = label; mLabel = label;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
package org.chromium.content.browser.input; package org.chromium.ui.picker;
import android.content.Context; import android.content.Context;
import android.view.LayoutInflater; import android.view.LayoutInflater;
...@@ -11,7 +11,7 @@ import android.view.ViewGroup; ...@@ -11,7 +11,7 @@ import android.view.ViewGroup;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.TextView; import android.widget.TextView;
import org.chromium.content.R; import org.chromium.ui.R;
import java.util.List; import java.util.List;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
package org.chromium.content.browser.input; package org.chromium.ui.picker;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.DatePickerDialog.OnDateSetListener; import android.app.DatePickerDialog.OnDateSetListener;
...@@ -16,9 +16,9 @@ import android.widget.DatePicker; ...@@ -16,9 +16,9 @@ import android.widget.DatePicker;
import android.widget.ListView; import android.widget.ListView;
import android.widget.TimePicker; import android.widget.TimePicker;
import org.chromium.content.R; import org.chromium.ui.R;
import org.chromium.content.browser.input.DateTimePickerDialog.OnDateTimeSetListener; import org.chromium.ui.picker.DateTimePickerDialog.OnDateTimeSetListener;
import org.chromium.content.browser.input.MultiFieldTimePickerDialog.OnMultiFieldTimeSetListener; import org.chromium.ui.picker.MultiFieldTimePickerDialog.OnMultiFieldTimeSetListener;
import java.util.Arrays; import java.util.Arrays;
import java.util.Calendar; import java.util.Calendar;
...@@ -28,11 +28,11 @@ import java.util.TimeZone; ...@@ -28,11 +28,11 @@ import java.util.TimeZone;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
/** /**
* Opens the approprate date/time picker dialog for the given dialog type. * Opens the appropriate date/time picker dialog for the given dialog type.
*/ */
public class InputDialogContainer { public class InputDialogContainer {
interface InputActionDelegate { public interface InputActionDelegate {
void cancelDateTimeDialog(); void cancelDateTimeDialog();
void replaceDateTime(double value); void replaceDateTime(double value);
} }
...@@ -52,7 +52,7 @@ public class InputDialogContainer { ...@@ -52,7 +52,7 @@ public class InputDialogContainer {
private AlertDialog mDialog; private AlertDialog mDialog;
private final InputActionDelegate mInputActionDelegate; private final InputActionDelegate mInputActionDelegate;
static void initializeInputTypes(int textInputTypeDate, public static void initializeInputTypes(int textInputTypeDate,
int textInputTypeDateTime, int textInputTypeDateTimeLocal, int textInputTypeDateTime, int textInputTypeDateTimeLocal,
int textInputTypeMonth, int textInputTypeTime, int textInputTypeMonth, int textInputTypeTime,
int textInputTypeWeek) { int textInputTypeWeek) {
...@@ -64,18 +64,18 @@ public class InputDialogContainer { ...@@ -64,18 +64,18 @@ public class InputDialogContainer {
sTextInputTypeWeek = textInputTypeWeek; sTextInputTypeWeek = textInputTypeWeek;
} }
static boolean isDialogInputType(int type) { public static boolean isDialogInputType(int type) {
return type == sTextInputTypeDate || type == sTextInputTypeTime return type == sTextInputTypeDate || type == sTextInputTypeTime
|| type == sTextInputTypeDateTime || type == sTextInputTypeDateTimeLocal || type == sTextInputTypeDateTime || type == sTextInputTypeDateTimeLocal
|| type == sTextInputTypeMonth || type == sTextInputTypeWeek; || type == sTextInputTypeMonth || type == sTextInputTypeWeek;
} }
InputDialogContainer(Context context, InputActionDelegate inputActionDelegate) { public InputDialogContainer(Context context, InputActionDelegate inputActionDelegate) {
mContext = context; mContext = context;
mInputActionDelegate = inputActionDelegate; mInputActionDelegate = inputActionDelegate;
} }
void showPickerDialog(final int dialogType, double dialogValue, public void showPickerDialog(final int dialogType, double dialogValue,
double min, double max, double step) { double min, double max, double step) {
Calendar cal; Calendar cal;
// |dialogValue|, |min|, |max| mean different things depending on the |dialogType|. // |dialogValue|, |min|, |max| mean different things depending on the |dialogType|.
...@@ -193,7 +193,7 @@ public class InputDialogContainer { ...@@ -193,7 +193,7 @@ public class InputDialogContainer {
mDialog.show(); mDialog.show();
} }
void showDialog(final int type, final double value, public void showDialog(final int type, final double value,
double min, double max, double step, double min, double max, double step,
DateTimeSuggestion[] suggestions) { DateTimeSuggestion[] suggestions) {
// When the web page asks to show a dialog while there is one already open, // When the web page asks to show a dialog while there is one already open,
...@@ -206,7 +206,7 @@ public class InputDialogContainer { ...@@ -206,7 +206,7 @@ public class InputDialogContainer {
} }
} }
void showPickerDialog(final int dialogType, protected void showPickerDialog(final int dialogType,
int year, int month, int monthDay, int year, int month, int monthDay,
int hourOfDay, int minute, int second, int millis, int week, int hourOfDay, int minute, int second, int millis, int week,
double min, double max, double step) { double min, double max, double step) {
...@@ -249,8 +249,7 @@ public class InputDialogContainer { ...@@ -249,8 +249,7 @@ public class InputDialogContainer {
mDialog.setButton(DialogInterface.BUTTON_POSITIVE, mDialog.setButton(DialogInterface.BUTTON_POSITIVE,
mContext.getText(R.string.date_picker_dialog_set), mContext.getText(R.string.date_picker_dialog_set),
(DialogInterface.OnClickListener) mDialog); (DialogInterface.OnClickListener)mDialog);
mDialog.setButton(DialogInterface.BUTTON_NEGATIVE, mDialog.setButton(DialogInterface.BUTTON_NEGATIVE,
mContext.getText(android.R.string.cancel), mContext.getText(android.R.string.cancel),
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
package org.chromium.content.browser.input; package org.chromium.ui.picker;
import android.content.Context; import android.content.Context;
import org.chromium.content.R; import org.chromium.ui.R;
import java.text.DateFormatSymbols; import java.text.DateFormatSymbols;
import java.util.Arrays; import java.util.Arrays;
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
package org.chromium.content.browser.input; package org.chromium.ui.picker;
import android.content.Context; import android.content.Context;
import org.chromium.content.R; import org.chromium.ui.R;
public class MonthPickerDialog extends TwoFieldDatePickerDialog { public class MonthPickerDialog extends TwoFieldDatePickerDialog {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
package org.chromium.content.browser.input; package org.chromium.ui.picker;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.Context; import android.content.Context;
...@@ -12,7 +12,7 @@ import android.view.LayoutInflater; ...@@ -12,7 +12,7 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.widget.NumberPicker; import android.widget.NumberPicker;
import org.chromium.content.R; import org.chromium.ui.R;
import java.util.ArrayList; import java.util.ArrayList;
......
aurimas@chromium.org
miguelg@chromium.org
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
package org.chromium.content.browser.input; package org.chromium.ui.picker;
import android.content.Context; import android.content.Context;
import android.text.format.DateUtils; import android.text.format.DateUtils;
...@@ -12,7 +12,7 @@ import android.widget.FrameLayout; ...@@ -12,7 +12,7 @@ import android.widget.FrameLayout;
import android.widget.NumberPicker; import android.widget.NumberPicker;
import android.widget.NumberPicker.OnValueChangeListener; import android.widget.NumberPicker.OnValueChangeListener;
import org.chromium.content.R; import org.chromium.ui.R;
import java.util.Calendar; import java.util.Calendar;
import java.util.TimeZone; import java.util.TimeZone;
......
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
package org.chromium.content.browser.input; package org.chromium.ui.picker;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener; import android.content.DialogInterface.OnClickListener;
import org.chromium.content.R; import org.chromium.ui.R;
import org.chromium.content.browser.input.TwoFieldDatePicker.OnMonthOrWeekChangedListener; import org.chromium.ui.picker.TwoFieldDatePicker.OnMonthOrWeekChangedListener;
public abstract class TwoFieldDatePickerDialog extends AlertDialog implements OnClickListener, public abstract class TwoFieldDatePickerDialog extends AlertDialog implements OnClickListener,
OnMonthOrWeekChangedListener { OnMonthOrWeekChangedListener {
...@@ -19,7 +19,7 @@ public abstract class TwoFieldDatePickerDialog extends AlertDialog implements On ...@@ -19,7 +19,7 @@ public abstract class TwoFieldDatePickerDialog extends AlertDialog implements On
private static final String POSITION_IN_YEAR = "position_in_year"; private static final String POSITION_IN_YEAR = "position_in_year";
protected final TwoFieldDatePicker mPicker; protected final TwoFieldDatePicker mPicker;
protected final OnValueSetListener mCallBack; protected final OnValueSetListener mCallBack;
/** /**
* The callback used to indicate the user is done filling in the date. * The callback used to indicate the user is done filling in the date.
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
package org.chromium.content.browser.input; package org.chromium.ui.picker;
import android.content.Context; import android.content.Context;
import org.chromium.content.R; import org.chromium.ui.R;
import java.util.Calendar; import java.util.Calendar;
import java.util.TimeZone; import java.util.TimeZone;
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
package org.chromium.content.browser.input; package org.chromium.ui.picker;
import android.content.Context; import android.content.Context;
import org.chromium.content.R; import org.chromium.ui.R;
public class WeekPickerDialog extends TwoFieldDatePickerDialog { public class WeekPickerDialog extends TwoFieldDatePickerDialog {
......
...@@ -147,6 +147,75 @@ ...@@ -147,6 +147,75 @@
<message desc="Notification for when copying to the clipboard fails. [CHAR-LIMIT=64]" name="IDS_COPY_TO_CLIPBOARD_FAILURE_MESSAGE"> <message desc="Notification for when copying to the clipboard fails. [CHAR-LIMIT=64]" name="IDS_COPY_TO_CLIPBOARD_FAILURE_MESSAGE">
Failed to copy to the clipboard Failed to copy to the clipboard
</message> </message>
<message desc="Content description for the date time picker month component. [CHAR-LIMIT=32]" name="IDS_ACCESSIBILITY_DATE_PICKER_MONTH">
Month
</message>
<message desc="Content description for the date time picker year component. [CHAR-LIMIT=32]" name="IDS_ACCESSIBILITY_DATE_PICKER_YEAR">
Year
</message>
<message desc="Label for 'set' button in date picker dialog and time picker dialog, used to replace the contents of a field with the chosen date or time [CHAR-LIMIT=12]" name="IDS_DATE_PICKER_DIALOG_SET">
Set
</message>
<message desc="Title for the month picker dialog, which can be used to choose a month. [CHAR-LIMIT=32]" name="IDS_MONTH_PICKER_DIALOG_TITLE">
Set month
</message>
<message desc="Content description for the date time picker week component. [CHAR-LIMIT=32]" name="IDS_ACCESSIBILITY_DATE_PICKER_WEEK">
Week
</message>
<message desc="Title for the week picker dialog, which can be used to choose a week. [CHAR-LIMIT=32]" name="IDS_WEEK_PICKER_DIALOG_TITLE">
Set week
</message>
<message desc="Value for AM in AM/PM in the time picker dialog. AM represents the morning (ante-meridiem). [CHAR-LIMIT=12]" name="IDS_TIME_PICKER_DIALOG_AM">
AM
</message>
<message desc="Value for PM in AM/PM in the time picker dialog. PM represents the afternoon (post-meridiem). [CHAR-LIMIT=12]" name="IDS_TIME_PICKER_DIALOG_PM">
PM
</message>
<message desc="Title for the time picker dialog, which can be used to choose a time. [CHAR-LIMIT=32]" name="IDS_TIME_PICKER_DIALOG_TITLE">
Set time
</message>
<message desc="Content description for the time picker hour component. [CHAR-LIMIT=32]" name="IDS_ACCESSIBILITY_TIME_PICKER_HOUR">
Hour
</message>
<message desc="Content description for the time picker minute component. [CHAR-LIMIT=32]" name="IDS_ACCESSIBILITY_TIME_PICKER_MINUTE">
Minute
</message>
<message desc="Content description for the time picker second component. [CHAR-LIMIT=32]" name="IDS_ACCESSIBILITY_TIME_PICKER_SECOND">
Second
</message>
<message desc="Content description for the time picker milli component. [CHAR-LIMIT=32]" name="IDS_ACCESSIBILITY_TIME_PICKER_MILLI">
Millisecond
</message>
<message desc="Content description for the time picker AM/PM component. [CHAR-LIMIT=32]" name="IDS_ACCESSIBILITY_TIME_PICKER_AMPM">
AM/PM
</message>
<message desc="Separator used between hours and minutes in the time pickerr dialog (hh:mm) [CHAR-LIMIT=1]" name="IDS_TIME_PICKER_DIALOG_HOUR_MINUTE_SEPARATOR">
:
</message>
<message desc="Separator used between minutes and seconds in the time picker dialog (hh:mm:ss) [CHAR-LIMIT=1]" name="IDS_TIME_PICKER_DIALOG_MINUTE_SECOND_SEPARATOR">
:
</message>
<message desc="Separator used between seconds and subseconds in the time picker dialog (hh:mm:ss.sss) [CHAR-LIMIT=1]" name="IDS_TIME_PICKER_DIALOG_SECOND_SUBSECOND_SEPARATOR">
.
</message>
<message desc="Title for the date/time picker dialog, which can be used to choose a date and time. [CHAR-LIMIT=32]" name="IDS_DATE_TIME_PICKER_DIALOG_TITLE">
Set date and time
</message>
<message desc="Content description for the date time picker date component. [CHAR-LIMIT=32]" name="IDS_ACCESSIBILITY_DATETIME_PICKER_DATE">
Date
</message>
<message desc="Content description for the date time picker time component. [CHAR-LIMIT=32]" name="IDS_ACCESSIBILITY_DATETIME_PICKER_TIME">
Time
</message>
<message desc="Label for 'other' button in date picker dialog and time picker dialog, used to close the list of suggestions and open the the full date/time picker [CHAR-LIMIT=32]" name="IDS_DATE_PICKER_DIALOG_OTHER_BUTTON_LABEL">
Other
</message>
<message desc="Title for the date picker dialog, which can be used to choose a date. [CHAR-LIMIT=32]" name="IDS_DATE_PICKER_DIALOG_TITLE">
Set date
</message>
<message desc="Label for 'clear' button in date picker dialog and time picker dialog, used to replace the contents of a field with the empty string [CHAR-LIMIT=12]" name="IDS_DATE_PICKER_DIALOG_CLEAR">
Clear
</message>
</messages> </messages>
</release> </release>
</grit> </grit>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment