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

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

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

parents 5c549473 8e1a7296
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -44666,8 +44666,8 @@ package android.view {
    method public void drawableHotspotChanged(float, float);
    method protected void drawableStateChanged();
    method public android.view.View findFocus();
    method public final android.view.View findViewById(int);
    method public final android.view.View findViewWithTag(java.lang.Object);
    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 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
@@ -48011,8 +48011,8 @@ package android.view {
    method public void drawableHotspotChanged(float, float);
    method protected void drawableStateChanged();
    method public android.view.View findFocus();
    method public final android.view.View findViewById(int);
    method public final android.view.View findViewWithTag(java.lang.Object);
    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 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
@@ -45021,8 +45021,8 @@ package android.view {
    method public void drawableHotspotChanged(float, float);
    method protected void drawableStateChanged();
    method public android.view.View findFocus();
    method public final android.view.View findViewById(int);
    method public final android.view.View findViewWithTag(java.lang.Object);
    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 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);
+17 −16
Original line number Diff line number Diff line
@@ -20260,9 +20260,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @return the view of the specified id, null if cannot be found
     * @hide
     */
    protected View findViewTraversal(@IdRes int id) {
    protected <T extends View> T findViewTraversal(@IdRes int id) {
        if (id == mID) {
            return this;
            return (T) this;
        }
        return null;
    }
@@ -20272,9 +20272,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @return the view of specified tag, null if cannot be found
     * @hide
     */
    protected View findViewWithTagTraversal(Object tag) {
    protected <T extends View> T findViewWithTagTraversal(Object tag) {
        if (tag != null && tag.equals(mTag)) {
            return this;
            return (T) this;
        }
        return null;
    }
@@ -20285,9 +20285,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @return The first view that matches the predicate or null.
     * @hide
     */
    protected View findViewByPredicateTraversal(Predicate<View> predicate, View childToSkip) {
    protected <T extends View> T findViewByPredicateTraversal(Predicate<View> predicate,
            View childToSkip) {
        if (predicate.test(this)) {
            return this;
            return (T) this;
        }
        return null;
    }
@@ -20300,7 +20301,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 View findViewById(@IdRes int id) {
    public final <T extends View> T findViewById(@IdRes int id) {
        if (id < 0) {
            return null;
        }
@@ -20313,11 +20314,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @param accessibilityId The searched accessibility id.
     * @return The found view.
     */
    final View findViewByAccessibilityId(int accessibilityId) {
    final <T extends View> T  findViewByAccessibilityId(int accessibilityId) {
        if (accessibilityId < 0) {
            return null;
        }
        View view = findViewByAccessibilityIdTraversal(accessibilityId);
        T view = findViewByAccessibilityIdTraversal(accessibilityId);
        if (view != null) {
            return view.includeForAccessibility() ? view : null;
        }
@@ -20336,12 +20337,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     *
     * @param accessibilityId The accessibility id.
     * @return The found view.
     *
     * @hide
     */
    public View findViewByAccessibilityIdTraversal(int accessibilityId) {
    public <T extends View> T findViewByAccessibilityIdTraversal(int accessibilityId) {
        if (getAccessibilityViewId() == accessibilityId) {
            return this;
            return (T) this;
        }
        return null;
    }
@@ -20353,7 +20353,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 View findViewWithTag(Object tag) {
    public final <T extends View> T findViewWithTag(Object tag) {
        if (tag == null) {
            return null;
        }
@@ -20368,7 +20368,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @return The first view that matches the predicate or null.
     * @hide
     */
    public final View findViewByPredicate(Predicate<View> predicate) {
    public final <T extends View> T findViewByPredicate(Predicate<View> predicate) {
        return findViewByPredicateTraversal(predicate, null);
    }
@@ -20388,10 +20388,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @return The first view that matches the predicate or null.
     * @hide
     */
    public final View findViewByPredicateInsideOut(View start, Predicate<View> predicate) {
    public final <T extends View> T findViewByPredicateInsideOut(
            View start, Predicate<View> predicate) {
        View childToSkip = null;
        for (;;) {
            View view = start.findViewByPredicateTraversal(predicate, childToSkip);
            T view = start.findViewByPredicateTraversal(predicate, childToSkip);
            if (view != null || start == this) {
                return view;
            }
+10 −9
Original line number Diff line number Diff line
@@ -4324,9 +4324,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
     * {@hide}
     */
    @Override
    protected View findViewTraversal(@IdRes int id) {
    protected <T extends View> T findViewTraversal(@IdRes int id) {
        if (id == mID) {
            return this;
            return (T) this;
        }

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

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

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

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

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

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