Backed out changeset 085439248886 (bug 1460074) for lint build bustages on FocusableDatePicker.java. CLOSED TREE
authorBrindusan Cristian <cbrindusan@mozilla.com>
Mon, 16 Jul 2018 15:45:50 +0300
changeset 818990 465f6e311e6db2cfda4ca5400c43cbd7ced82619
parent 818989 5e1cb45e2ded70dd28882ab6c83735b6bc030965
child 818991 f52422f008ed88d270b9af0ba0379e07a7c2268c
push id116413
push userbgrinstead@mozilla.com
push dateMon, 16 Jul 2018 22:40:17 +0000
bugs1460074
milestone63.0a1
backs out085439248886587f2251cb950de08bbbf0b70f6d
Backed out changeset 085439248886 (bug 1460074) for lint build bustages on FocusableDatePicker.java. CLOSED TREE
mobile/android/base/java/org/mozilla/gecko/prompts/PromptInput.java
mobile/android/base/java/org/mozilla/gecko/widget/FocusableDatePicker.java
--- a/mobile/android/base/java/org/mozilla/gecko/prompts/PromptInput.java
+++ b/mobile/android/base/java/org/mozilla/gecko/prompts/PromptInput.java
@@ -7,17 +7,16 @@ package org.mozilla.gecko.prompts;
 
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.GregorianCalendar;
 
 import org.mozilla.gecko.AppConstants;
 import org.mozilla.gecko.util.GeckoBundle;
 import org.mozilla.gecko.widget.AllCapsTextView;
-import org.mozilla.gecko.widget.FocusableDatePicker;
 import org.mozilla.gecko.widget.DateTimePicker;
 
 import android.content.Context;
 import android.content.res.Configuration;
 import android.support.design.widget.TextInputLayout;
 import android.text.Html;
 import android.text.InputType;
 import android.text.TextUtils;
@@ -174,18 +173,17 @@ public abstract class PromptInput {
             super(obj);
         }
 
         // Will use platform's DatePicker and TimePicker to let users input date and time using the fancy widgets.
         // For the other input types our custom DateTimePicker will offer spinners.
         @Override
         public View getView(Context context) throws UnsupportedOperationException {
             if (mType.equals("date")) {
-                // FocusableDatePicker allow us to have priority in responding to scroll events.
-                DatePicker input = new FocusableDatePicker(context);
+                DatePicker input = new DatePicker(context);
                 try {
                     if (!TextUtils.isEmpty(mValue)) {
                         GregorianCalendar calendar = new GregorianCalendar();
                         calendar.setTime(new SimpleDateFormat("yyyy-MM-dd").parse(mValue));
                         input.updateDate(calendar.get(Calendar.YEAR),
                                          calendar.get(Calendar.MONTH),
                                          calendar.get(Calendar.DAY_OF_MONTH));
                     }
deleted file mode 100644
--- a/mobile/android/base/java/org/mozilla/gecko/widget/FocusableDatePicker.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package org.mozilla.gecko.widget;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.view.MotionEvent;
-import android.view.ViewParent;
-import android.widget.DatePicker;
-
-/**
- * This is based on the platform's {@link DatePicker}.<br>
- * The only difference is that it will prevent it's parent from receiving touch events.
- */
-public class FocusableDatePicker extends DatePicker {
-    public FocusableDatePicker(Context context) {
-        super(context);
-    }
-
-    public FocusableDatePicker(Context context, AttributeSet attrs) {
-        super(context, attrs);
-    }
-
-    public FocusableDatePicker(Context context, AttributeSet attrs, int defStyleAttr) {
-        super(context, attrs, defStyleAttr);
-    }
-
-    public FocusableDatePicker(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
-        super(context, attrs, defStyleAttr, defStyleRes);
-    }
-
-    @Override
-    public boolean onInterceptTouchEvent(MotionEvent ev) {
-        ViewParent parentView = getParent();
-
-        if (ev.getActionMasked() == MotionEvent.ACTION_DOWN) {
-            if (parentView != null) {
-                parentView.requestDisallowInterceptTouchEvent(true);
-            }
-        }
-
-        return false;
-    }
-}