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

Commit 7458ea38 authored by Alan Viverette's avatar Alan Viverette Committed by Android (Google) Code Review
Browse files

Merge "Automatic casts for more findViewById implementations" into oc-dev

parents 8d41ad08 db7423cd
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -3578,7 +3578,7 @@ package android.app {
    method public void dump(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]);
    method public void enterPictureInPictureMode();
    method public boolean enterPictureInPictureMode(android.app.PictureInPictureArgs);
    method public android.view.View findViewById(int);
    method public <T extends android.view.View> T findViewById(int);
    method public void finish();
    method public void finishActivity(int);
    method public void finishActivityFromChild(android.app.Activity, int);
@@ -4358,7 +4358,7 @@ package android.app {
    method public boolean dispatchPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
    method public boolean dispatchTouchEvent(android.view.MotionEvent);
    method public boolean dispatchTrackballEvent(android.view.MotionEvent);
    method public android.view.View findViewById(int);
    method public <T extends android.view.View> T findViewById(int);
    method public android.app.ActionBar getActionBar();
    method public final android.content.Context getContext();
    method public android.view.View getCurrentFocus();
@@ -46605,7 +46605,7 @@ package android.view {
    method public void clearFlags(int);
    method public abstract void closeAllPanels();
    method public abstract void closePanel(int);
    method public android.view.View findViewById(int);
    method public <T extends android.view.View> T findViewById(int);
    method public boolean getAllowEnterTransitionOverlap();
    method public boolean getAllowReturnTransitionOverlap();
    method public final android.view.WindowManager.LayoutParams getAttributes();
+3 −3
Original line number Diff line number Diff line
@@ -3703,7 +3703,7 @@ package android.app {
    method public void dump(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]);
    method public void enterPictureInPictureMode();
    method public boolean enterPictureInPictureMode(android.app.PictureInPictureArgs);
    method public android.view.View findViewById(int);
    method public <T extends android.view.View> T findViewById(int);
    method public void finish();
    method public void finishActivity(int);
    method public void finishActivityFromChild(android.app.Activity, int);
@@ -4510,7 +4510,7 @@ package android.app {
    method public boolean dispatchPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
    method public boolean dispatchTouchEvent(android.view.MotionEvent);
    method public boolean dispatchTrackballEvent(android.view.MotionEvent);
    method public android.view.View findViewById(int);
    method public <T extends android.view.View> T findViewById(int);
    method public android.app.ActionBar getActionBar();
    method public final android.content.Context getContext();
    method public android.view.View getCurrentFocus();
@@ -50129,7 +50129,7 @@ package android.view {
    method public void clearFlags(int);
    method public abstract void closeAllPanels();
    method public abstract void closePanel(int);
    method public android.view.View findViewById(int);
    method public <T extends android.view.View> T findViewById(int);
    method public boolean getAllowEnterTransitionOverlap();
    method public boolean getAllowReturnTransitionOverlap();
    method public final android.view.WindowManager.LayoutParams getAttributes();
+3 −3
Original line number Diff line number Diff line
@@ -3580,7 +3580,7 @@ package android.app {
    method public void dump(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]);
    method public void enterPictureInPictureMode();
    method public boolean enterPictureInPictureMode(android.app.PictureInPictureArgs);
    method public android.view.View findViewById(int);
    method public <T extends android.view.View> T findViewById(int);
    method public void finish();
    method public void finishActivity(int);
    method public void finishActivityFromChild(android.app.Activity, int);
@@ -4370,7 +4370,7 @@ package android.app {
    method public boolean dispatchPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
    method public boolean dispatchTouchEvent(android.view.MotionEvent);
    method public boolean dispatchTrackballEvent(android.view.MotionEvent);
    method public android.view.View findViewById(int);
    method public <T extends android.view.View> T findViewById(int);
    method public android.app.ActionBar getActionBar();
    method public final android.content.Context getContext();
    method public android.view.View getCurrentFocus();
@@ -46987,7 +46987,7 @@ package android.view {
    method public void clearFlags(int);
    method public abstract void closeAllPanels();
    method public abstract void closePanel(int);
    method public android.view.View findViewById(int);
    method public <T extends android.view.View> T findViewById(int);
    method public boolean getAllowEnterTransitionOverlap();
    method public boolean getAllowReturnTransitionOverlap();
    method public final android.view.WindowManager.LayoutParams getAttributes();
+11 −4
Original line number Diff line number Diff line
@@ -2443,13 +2443,20 @@ public class Activity extends ContextThemeWrapper
    }

    /**
     * Finds a view that was identified by the id attribute from the XML that
     * was processed in {@link #onCreate}.
     * Finds a view that was identified by the {@code android:id} XML attribute
     * that was processed in {@link #onCreate}.
     * <p>
     * <strong>Note:</strong> In most cases -- depending on compiler support --
     * the resulting view is automatically cast to the target class type. If
     * the target class type is unconstrained, an explicit cast may be
     * necessary.
     *
     * @return The view if found or null otherwise.
     * @param id the ID to search for
     * @return a view with given ID if found, or {@code null} otherwise
     * @see View#findViewById(int)
     */
    @Nullable
    public View findViewById(@IdRes int id) {
    public <T extends View> T findViewById(@IdRes int id) {
        return getWindow().findViewById(id);
    }

+14 −6
Original line number Diff line number Diff line
@@ -498,14 +498,22 @@ public class Dialog implements DialogInterface, Window.Callback,
    }

    /**
     * Finds a child view with the given identifier. Returns null if the
     * specified child view does not exist or the dialog has not yet been fully
     * created (for example, via {@link #show()} or {@link #create()}).
     * Finds the first descendant view with the given ID or {@code null} if the
     * ID is invalid (< 0), there is no matching view in the hierarchy, or the
     * dialog has not yet been fully created (for example, via {@link #show()}
     * or {@link #create()}).
     * <p>
     * <strong>Note:</strong> In most cases -- depending on compiler support --
     * the resulting view is automatically cast to the target class type. If
     * the target class type is unconstrained, an explicit cast may be
     * necessary.
     *
     * @param id the identifier of the view to find
     * @return The view with the given id or null.
     * @param id the ID to search for
     * @return a view with given ID if found, or {@code null} otherwise
     * @see View#findViewById(int)
     */
    public @Nullable View findViewById(@IdRes int id) {
    @Nullable
    public <T extends View> T findViewById(@IdRes int id) {
        return mWindow.findViewById(id);
    }

Loading