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

Commit 40eb0ba4 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Revert "Implicitly cast views obtained via View.findView methods""

parents 3d6f51d1 177f3736
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -44363,8 +44363,8 @@ package android.view {
    method public void drawableHotspotChanged(float, float);
    method protected void drawableStateChanged();
    method public android.view.View findFocus();
    method public final <T extends android.view.View> T findViewById(int);
    method public final <T extends android.view.View> T findViewWithTag(java.lang.Object);
    method public final android.view.View findViewById(int);
    method public final android.view.View findViewWithTag(java.lang.Object);
    method public void findViewsWithText(java.util.ArrayList<android.view.View>, java.lang.CharSequence, int);
    method protected deprecated boolean fitSystemWindows(android.graphics.Rect);
    method public android.view.View focusSearch(int);
+2 −2
Original line number Diff line number Diff line
@@ -47770,8 +47770,8 @@ package android.view {
    method public void drawableHotspotChanged(float, float);
    method protected void drawableStateChanged();
    method public android.view.View findFocus();
    method public final <T extends android.view.View> T findViewById(int);
    method public final <T extends android.view.View> T findViewWithTag(java.lang.Object);
    method public final android.view.View findViewById(int);
    method public final android.view.View findViewWithTag(java.lang.Object);
    method public void findViewsWithText(java.util.ArrayList<android.view.View>, java.lang.CharSequence, int);
    method protected deprecated boolean fitSystemWindows(android.graphics.Rect);
    method public android.view.View focusSearch(int);
+2 −2
Original line number Diff line number Diff line
@@ -44669,8 +44669,8 @@ package android.view {
    method public void drawableHotspotChanged(float, float);
    method protected void drawableStateChanged();
    method public android.view.View findFocus();
    method public final <T extends android.view.View> T findViewById(int);
    method public final <T extends android.view.View> T findViewWithTag(java.lang.Object);
    method public final android.view.View findViewById(int);
    method public final android.view.View findViewWithTag(java.lang.Object);
    method public void findViewsWithText(java.util.ArrayList<android.view.View>, java.lang.CharSequence, int);
    method protected deprecated boolean fitSystemWindows(android.graphics.Rect);
    method public android.view.View focusSearch(int);
+16 −17
Original line number Diff line number Diff line
@@ -19942,9 +19942,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @return the view of the specified id, null if cannot be found
     * @hide
     */
    protected <T extends View> T findViewTraversal(@IdRes int id) {
    protected View findViewTraversal(@IdRes int id) {
        if (id == mID) {
            return (T) this;
            return this;
        }
        return null;
    }
@@ -19954,9 +19954,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @return the view of specified tag, null if cannot be found
     * @hide
     */
    protected <T extends View> T findViewWithTagTraversal(Object tag) {
    protected View findViewWithTagTraversal(Object tag) {
        if (tag != null && tag.equals(mTag)) {
            return (T) this;
            return this;
        }
        return null;
    }
@@ -19967,10 +19967,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @return The first view that matches the predicate or null.
     * @hide
     */
    protected <T extends View> T findViewByPredicateTraversal(Predicate<View> predicate,
            View childToSkip) {
    protected View findViewByPredicateTraversal(Predicate<View> predicate, View childToSkip) {
        if (predicate.apply(this)) {
            return (T) this;
            return this;
        }
        return null;
    }
@@ -19983,7 +19982,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @return The view that has the given id in the hierarchy or null
     */
    @Nullable
    public final <T extends View> T findViewById(@IdRes int id) {
    public final View findViewById(@IdRes int id) {
        if (id < 0) {
            return null;
        }
@@ -19996,11 +19995,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @param accessibilityId The searched accessibility id.
     * @return The found view.
     */
    final <T extends View> T  findViewByAccessibilityId(int accessibilityId) {
    final View findViewByAccessibilityId(int accessibilityId) {
        if (accessibilityId < 0) {
            return null;
        }
        T view = findViewByAccessibilityIdTraversal(accessibilityId);
        View view = findViewByAccessibilityIdTraversal(accessibilityId);
        if (view != null) {
            return view.includeForAccessibility() ? view : null;
        }
@@ -20019,11 +20018,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     *
     * @param accessibilityId The accessibility id.
     * @return The found view.
     *
     * @hide
     */
    public <T extends View> T findViewByAccessibilityIdTraversal(int accessibilityId) {
    public View findViewByAccessibilityIdTraversal(int accessibilityId) {
        if (getAccessibilityViewId() == accessibilityId) {
            return (T) this;
            return this;
        }
        return null;
    }
@@ -20035,7 +20035,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @param tag The tag to search for, using "tag.equals(getTag())".
     * @return The View that has the given tag in the hierarchy or null
     */
    public final <T extends View> T findViewWithTag(Object tag) {
    public final View findViewWithTag(Object tag) {
        if (tag == null) {
            return null;
        }
@@ -20050,7 +20050,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @return The first view that matches the predicate or null.
     * @hide
     */
    public final <T extends View> T findViewByPredicate(Predicate<View> predicate) {
    public final View findViewByPredicate(Predicate<View> predicate) {
        return findViewByPredicateTraversal(predicate, null);
    }
@@ -20070,11 +20070,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @return The first view that matches the predicate or null.
     * @hide
     */
    public final <T extends View> T findViewByPredicateInsideOut(
            View start, Predicate<View> predicate) {
    public final View findViewByPredicateInsideOut(View start, Predicate<View> predicate) {
        View childToSkip = null;
        for (;;) {
            T view = start.findViewByPredicateTraversal(predicate, childToSkip);
            View view = start.findViewByPredicateTraversal(predicate, childToSkip);
            if (view != null || start == this) {
                return view;
            }
+9 −10
Original line number Diff line number Diff line
@@ -4208,9 +4208,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
     * {@hide}
     */
    @Override
    protected <T extends View> T findViewTraversal(@IdRes int id) {
    protected View findViewTraversal(@IdRes int id) {
        if (id == mID) {
            return (T) this;
            return this;
        }

        final View[] where = mChildren;
@@ -4223,7 +4223,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                v = v.findViewById(id);

                if (v != null) {
                    return (T) v;
                    return v;
                }
            }
        }
@@ -4235,9 +4235,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
     * {@hide}
     */
    @Override
    protected <T extends View> T findViewWithTagTraversal(Object tag) {
    protected View findViewWithTagTraversal(Object tag) {
        if (tag != null && tag.equals(mTag)) {
            return (T) this;
            return this;
        }

        final View[] where = mChildren;
@@ -4250,7 +4250,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                v = v.findViewWithTag(tag);

                if (v != null) {
                    return (T) v;
                    return v;
                }
            }
        }
@@ -4262,10 +4262,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
     * {@hide}
     */
    @Override
    protected <T extends View> T findViewByPredicateTraversal(Predicate<View> predicate,
            View childToSkip) {
    protected View findViewByPredicateTraversal(Predicate<View> predicate, View childToSkip) {
        if (predicate.apply(this)) {
            return (T) this;
            return this;
        }

        final View[] where = mChildren;
@@ -4278,7 +4277,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                v = v.findViewByPredicate(predicate);

                if (v != null) {
                    return (T) v;
                    return v;
                }
            }
        }
Loading