From a5c1a0a3b7241e3ec567d4fb32673fcfd98d4fc4 Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Mon, 27 Nov 2017 13:03:23 -0500 Subject: [PATCH] Deprecate opt/datetimepicker Internal classes moved to package-private. Views loaded from XML and public API classes marked deprecated. Change-Id: I68ba08b68f4e7f3800a02ce34f91178deaa133e1 Fixes: 69630074 Test: make --- src/com/android/datetimepicker/AccessibleLinearLayout.java | 3 +++ src/com/android/datetimepicker/AccessibleTextView.java | 3 +++ src/com/android/datetimepicker/HapticFeedbackController.java | 3 +++ src/com/android/datetimepicker/Utils.java | 3 +++ .../android/datetimepicker/date/AccessibleDateAnimator.java | 2 +- src/com/android/datetimepicker/date/DatePickerController.java | 2 +- src/com/android/datetimepicker/date/DatePickerDialog.java | 3 +++ src/com/android/datetimepicker/date/DayPickerView.java | 2 +- src/com/android/datetimepicker/date/MonthAdapter.java | 2 +- src/com/android/datetimepicker/date/MonthView.java | 2 +- src/com/android/datetimepicker/date/SimpleDayPickerView.java | 2 +- src/com/android/datetimepicker/date/SimpleMonthAdapter.java | 2 +- src/com/android/datetimepicker/date/SimpleMonthView.java | 2 +- .../datetimepicker/date/TextViewWithCircularIndicator.java | 3 +++ src/com/android/datetimepicker/date/YearPickerView.java | 2 +- src/com/android/datetimepicker/time/AmPmCirclesView.java | 2 +- src/com/android/datetimepicker/time/CircleView.java | 2 +- src/com/android/datetimepicker/time/RadialPickerLayout.java | 2 ++ src/com/android/datetimepicker/time/RadialSelectorView.java | 2 +- src/com/android/datetimepicker/time/RadialTextsView.java | 2 +- src/com/android/datetimepicker/time/TimePickerDialog.java | 3 +++ 21 files changed, 36 insertions(+), 13 deletions(-) diff --git a/src/com/android/datetimepicker/AccessibleLinearLayout.java b/src/com/android/datetimepicker/AccessibleLinearLayout.java index 629f856..a67d809 100644 --- a/src/com/android/datetimepicker/AccessibleLinearLayout.java +++ b/src/com/android/datetimepicker/AccessibleLinearLayout.java @@ -25,7 +25,10 @@ /** * Fake Button class, used so TextViews can announce themselves as Buttons, for accessibility. + * + * @deprecated This module is deprecated. Do not use this class. */ +@Deprecated public class AccessibleLinearLayout extends LinearLayout { public AccessibleLinearLayout(Context context, AttributeSet attrs) { diff --git a/src/com/android/datetimepicker/AccessibleTextView.java b/src/com/android/datetimepicker/AccessibleTextView.java index 98fa744..9a2ecbb 100644 --- a/src/com/android/datetimepicker/AccessibleTextView.java +++ b/src/com/android/datetimepicker/AccessibleTextView.java @@ -25,7 +25,10 @@ /** * Fake Button class, used so TextViews can announce themselves as Buttons, for accessibility. + * + * @deprecated This module is deprecated. Do not use this class. */ +@Deprecated public class AccessibleTextView extends TextView { public AccessibleTextView(Context context, AttributeSet attrs) { diff --git a/src/com/android/datetimepicker/HapticFeedbackController.java b/src/com/android/datetimepicker/HapticFeedbackController.java index b9be63f..96d3a24 100644 --- a/src/com/android/datetimepicker/HapticFeedbackController.java +++ b/src/com/android/datetimepicker/HapticFeedbackController.java @@ -10,7 +10,10 @@ /** * A simple utility class to handle haptic feedback. + * + * @deprecated This module is deprecated. Do not use this class. */ +@Deprecated public class HapticFeedbackController { private static final int VIBRATE_DELAY_MS = 125; private static final int VIBRATE_LENGTH_MS = 5; diff --git a/src/com/android/datetimepicker/Utils.java b/src/com/android/datetimepicker/Utils.java index 4a3110c..6c0adbe 100644 --- a/src/com/android/datetimepicker/Utils.java +++ b/src/com/android/datetimepicker/Utils.java @@ -28,7 +28,10 @@ /** * Utility helper functions for time and date pickers. + * + * @deprecated This module is deprecated. Do not use this class. */ +@Deprecated public class Utils { public static final int MONDAY_BEFORE_JULIAN_EPOCH = Time.EPOCH_JULIAN_DAY - 3; diff --git a/src/com/android/datetimepicker/date/AccessibleDateAnimator.java b/src/com/android/datetimepicker/date/AccessibleDateAnimator.java index fc022cd..4e65aea 100644 --- a/src/com/android/datetimepicker/date/AccessibleDateAnimator.java +++ b/src/com/android/datetimepicker/date/AccessibleDateAnimator.java @@ -22,7 +22,7 @@ import android.view.accessibility.AccessibilityEvent; import android.widget.ViewAnimator; -public class AccessibleDateAnimator extends ViewAnimator { +class AccessibleDateAnimator extends ViewAnimator { private long mDateMillis; public AccessibleDateAnimator(Context context, AttributeSet attrs) { diff --git a/src/com/android/datetimepicker/date/DatePickerController.java b/src/com/android/datetimepicker/date/DatePickerController.java index 42989dd..b027d33 100644 --- a/src/com/android/datetimepicker/date/DatePickerController.java +++ b/src/com/android/datetimepicker/date/DatePickerController.java @@ -24,7 +24,7 @@ /** * Controller class to communicate among the various components of the date picker dialog. */ -public interface DatePickerController { +interface DatePickerController { void onYearSelected(int year); diff --git a/src/com/android/datetimepicker/date/DatePickerDialog.java b/src/com/android/datetimepicker/date/DatePickerDialog.java index 994fdf2..9b26b48 100644 --- a/src/com/android/datetimepicker/date/DatePickerDialog.java +++ b/src/com/android/datetimepicker/date/DatePickerDialog.java @@ -48,7 +48,10 @@ /** * Dialog allowing users to select a date. + * + * @deprecated Use {@link android.app.DatePickerDialog}. */ +@Deprecated public class DatePickerDialog extends DialogFragment implements OnClickListener, DatePickerController { diff --git a/src/com/android/datetimepicker/date/DayPickerView.java b/src/com/android/datetimepicker/date/DayPickerView.java index 47a2aa7..9f81537 100644 --- a/src/com/android/datetimepicker/date/DayPickerView.java +++ b/src/com/android/datetimepicker/date/DayPickerView.java @@ -42,7 +42,7 @@ /** * This displays a list of months in a calendar format with selectable days. */ -public abstract class DayPickerView extends ListView implements OnScrollListener, +abstract class DayPickerView extends ListView implements OnScrollListener, OnDateChangedListener { private static final String TAG = "MonthFragment"; diff --git a/src/com/android/datetimepicker/date/MonthAdapter.java b/src/com/android/datetimepicker/date/MonthAdapter.java index 3ed88b0..0f95e55 100644 --- a/src/com/android/datetimepicker/date/MonthAdapter.java +++ b/src/com/android/datetimepicker/date/MonthAdapter.java @@ -32,7 +32,7 @@ /** * An adapter for a list of {@link MonthView} items. */ -public abstract class MonthAdapter extends BaseAdapter implements OnDayClickListener { +abstract class MonthAdapter extends BaseAdapter implements OnDayClickListener { private static final String TAG = "SimpleMonthAdapter"; diff --git a/src/com/android/datetimepicker/date/MonthView.java b/src/com/android/datetimepicker/date/MonthView.java index 00711f3..63d073c 100644 --- a/src/com/android/datetimepicker/date/MonthView.java +++ b/src/com/android/datetimepicker/date/MonthView.java @@ -52,7 +52,7 @@ * A calendar-like view displaying a specified month and the appropriate selectable day numbers * within the specified month. */ -public abstract class MonthView extends View { +abstract class MonthView extends View { private static final String TAG = "MonthView"; /** diff --git a/src/com/android/datetimepicker/date/SimpleDayPickerView.java b/src/com/android/datetimepicker/date/SimpleDayPickerView.java index 658c8a2..c20c754 100644 --- a/src/com/android/datetimepicker/date/SimpleDayPickerView.java +++ b/src/com/android/datetimepicker/date/SimpleDayPickerView.java @@ -22,7 +22,7 @@ /** * A DayPickerView customized for {@link SimpleMonthAdapter} */ -public class SimpleDayPickerView extends DayPickerView { +class SimpleDayPickerView extends DayPickerView { public SimpleDayPickerView(Context context, AttributeSet attrs) { super(context, attrs); diff --git a/src/com/android/datetimepicker/date/SimpleMonthAdapter.java b/src/com/android/datetimepicker/date/SimpleMonthAdapter.java index 0c939fe..394abc2 100644 --- a/src/com/android/datetimepicker/date/SimpleMonthAdapter.java +++ b/src/com/android/datetimepicker/date/SimpleMonthAdapter.java @@ -21,7 +21,7 @@ /** * An adapter for a list of {@link SimpleMonthView} items. */ -public class SimpleMonthAdapter extends MonthAdapter { +class SimpleMonthAdapter extends MonthAdapter { public SimpleMonthAdapter(Context context, DatePickerController controller) { super(context, controller); diff --git a/src/com/android/datetimepicker/date/SimpleMonthView.java b/src/com/android/datetimepicker/date/SimpleMonthView.java index b416a45..bb392eb 100644 --- a/src/com/android/datetimepicker/date/SimpleMonthView.java +++ b/src/com/android/datetimepicker/date/SimpleMonthView.java @@ -21,7 +21,7 @@ import java.util.Calendar; -public class SimpleMonthView extends MonthView { +class SimpleMonthView extends MonthView { public SimpleMonthView(Context context) { super(context); diff --git a/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java b/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java index ad78746..e4d69e1 100644 --- a/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java +++ b/src/com/android/datetimepicker/date/TextViewWithCircularIndicator.java @@ -29,7 +29,10 @@ /** * A text view which, when pressed or activated, displays a blue circle around the text. + * + * @deprecated This module is deprecated. Do not use this class. */ +@Deprecated public class TextViewWithCircularIndicator extends TextView { private static final int SELECTED_CIRCLE_ALPHA = 60; diff --git a/src/com/android/datetimepicker/date/YearPickerView.java b/src/com/android/datetimepicker/date/YearPickerView.java index ae14eb5..d058b36 100644 --- a/src/com/android/datetimepicker/date/YearPickerView.java +++ b/src/com/android/datetimepicker/date/YearPickerView.java @@ -37,7 +37,7 @@ /** * Displays a selectable list of years. */ -public class YearPickerView extends ListView implements OnItemClickListener, OnDateChangedListener { +class YearPickerView extends ListView implements OnItemClickListener, OnDateChangedListener { private static final String TAG = "YearPickerView"; private final DatePickerController mController; diff --git a/src/com/android/datetimepicker/time/AmPmCirclesView.java b/src/com/android/datetimepicker/time/AmPmCirclesView.java index 902abd9..bafa51c 100644 --- a/src/com/android/datetimepicker/time/AmPmCirclesView.java +++ b/src/com/android/datetimepicker/time/AmPmCirclesView.java @@ -33,7 +33,7 @@ /** * Draw the two smaller AM and PM circles next to where the larger circle will be. */ -public class AmPmCirclesView extends View { +class AmPmCirclesView extends View { private static final String TAG = "AmPmCirclesView"; // Alpha level for selected circle. diff --git a/src/com/android/datetimepicker/time/CircleView.java b/src/com/android/datetimepicker/time/CircleView.java index 1dd4eea..0d6766f 100644 --- a/src/com/android/datetimepicker/time/CircleView.java +++ b/src/com/android/datetimepicker/time/CircleView.java @@ -28,7 +28,7 @@ /** * Draws a simple white circle on which the numbers will be drawn. */ -public class CircleView extends View { +class CircleView extends View { private static final String TAG = "CircleView"; private final Paint mPaint = new Paint(); diff --git a/src/com/android/datetimepicker/time/RadialPickerLayout.java b/src/com/android/datetimepicker/time/RadialPickerLayout.java index 1d44907..6a4adea 100644 --- a/src/com/android/datetimepicker/time/RadialPickerLayout.java +++ b/src/com/android/datetimepicker/time/RadialPickerLayout.java @@ -44,6 +44,8 @@ * The primary layout to hold the circular picker, and the am/pm buttons. This view well measure * itself to end up as a square. It also handles touches to be passed in to views that need to know * when they'd been touched. + * + * @deprecated This module is deprecated. Do not use this class. */ public class RadialPickerLayout extends FrameLayout implements OnTouchListener { private static final String TAG = "RadialPickerLayout"; diff --git a/src/com/android/datetimepicker/time/RadialSelectorView.java b/src/com/android/datetimepicker/time/RadialSelectorView.java index 0339dcd..4906991 100644 --- a/src/com/android/datetimepicker/time/RadialSelectorView.java +++ b/src/com/android/datetimepicker/time/RadialSelectorView.java @@ -35,7 +35,7 @@ * View to show what number is selected. This will draw a blue circle over the number, with a blue * line coming from the center of the main circle to the edge of the blue selection. */ -public class RadialSelectorView extends View { +class RadialSelectorView extends View { private static final String TAG = "RadialSelectorView"; // Alpha level for selected circle. diff --git a/src/com/android/datetimepicker/time/RadialTextsView.java b/src/com/android/datetimepicker/time/RadialTextsView.java index 684e8f5..0b69d06 100644 --- a/src/com/android/datetimepicker/time/RadialTextsView.java +++ b/src/com/android/datetimepicker/time/RadialTextsView.java @@ -35,7 +35,7 @@ /** * A view to show a series of numbers in a circular pattern. */ -public class RadialTextsView extends View { +class RadialTextsView extends View { private final static String TAG = "RadialTextsView"; private final Paint mPaint = new Paint(); diff --git a/src/com/android/datetimepicker/time/TimePickerDialog.java b/src/com/android/datetimepicker/time/TimePickerDialog.java index c7661ad..0dd13c9 100644 --- a/src/com/android/datetimepicker/time/TimePickerDialog.java +++ b/src/com/android/datetimepicker/time/TimePickerDialog.java @@ -46,7 +46,10 @@ /** * Dialog to set a time. + * + * @deprecated Use {@link android.app.TimePickerDialog}. */ +@Deprecated public class TimePickerDialog extends DialogFragment implements OnValueSelectedListener{ private static final String TAG = "TimePickerDialog";