зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 085439248886 (bug 1460074) for lint build bustages on FocusableDatePicker.java. CLOSED TREE
This commit is contained in:
Родитель
62fc67175b
Коммит
6ef44c90c6
|
@ -12,7 +12,6 @@ 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;
|
||||
|
@ -179,8 +178,7 @@ public abstract class PromptInput {
|
|||
@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();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче