Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7add7e04 authored by Alan Viverette's avatar Alan Viverette
Browse files

Only look for nearest child View in ViewGroup

NearestTouchDelegate may still be assigned to non-ViewGroup views, but
we won't attempt to find a target child View until the touch moves into
a ViewGroup.

Bug: 25813455
Change-Id: I570f88fee63623110e3463e8d4579cca8113fd5e
parent 3f72604b
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -880,8 +880,12 @@ class TimePickerClockDelegate extends TimePicker.AbstractTimePickerDelegate impl
            public boolean onTouch(View view, MotionEvent motionEvent) {
                final int actionMasked = motionEvent.getActionMasked();
                if (actionMasked == MotionEvent.ACTION_DOWN) {
                    if (view instanceof ViewGroup) {
                        mInitialTouchTarget = findNearestChild((ViewGroup) view,
                                (int) motionEvent.getX(), (int) motionEvent.getY());
                    } else {
                        mInitialTouchTarget = null;
                    }
                }

                final View child = mInitialTouchTarget;