Loading core/api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -49645,6 +49645,7 @@ package android.view { method @CallSuper public void drawableHotspotChanged(float, float); method @CallSuper protected void drawableStateChanged(); method public android.view.View findFocus(); method @Nullable public final android.window.OnBackInvokedDispatcher findOnBackInvokedDispatcher(); method public final <T extends android.view.View> T findViewById(@IdRes int); method public final <T extends android.view.View> T findViewWithTag(Object); method public void findViewsWithText(java.util.ArrayList<android.view.View>, CharSequence, int); Loading Loading @@ -50822,6 +50823,7 @@ package android.view { method public void childHasTransientStateChanged(@NonNull android.view.View, boolean); method public void clearChildFocus(android.view.View); method public void createContextMenu(android.view.ContextMenu); method @Nullable public default android.window.OnBackInvokedDispatcher findOnBackInvokedDispatcherForChild(@NonNull android.view.View, @NonNull android.view.View); method public android.view.View focusSearch(android.view.View, int); method public void focusableViewAvailable(android.view.View); method public boolean getChildVisibleRect(android.view.View, android.graphics.Rect, android.graphics.Point); core/java/android/view/View.java +18 −0 Original line number Diff line number Diff line Loading @@ -162,6 +162,7 @@ import android.view.translation.ViewTranslationResponse; import android.widget.Checkable; import android.widget.FrameLayout; import android.widget.ScrollBarDrawable; import android.window.OnBackInvokedDispatcher; import com.android.internal.R; import com.android.internal.util.ArrayUtils; Loading Loading @@ -12098,6 +12099,23 @@ public class View implements Drawable.Callback, KeyEvent.Callback, return null; } /** * Walk up the View hierarchy to find the nearest {@link OnBackInvokedDispatcher}. * * @return The {@link OnBackInvokedDispatcher} from this or the nearest * ancestor, or null if this view is both not attached and have no ancestor providing an * {@link OnBackInvokedDispatcher}. */ @Nullable public final OnBackInvokedDispatcher findOnBackInvokedDispatcher() { ViewParent parent = getParent(); if (parent != null) { return parent.findOnBackInvokedDispatcherForChild(this, this); } return null; } /** * @hide Compute the insets that should be consumed by this view and the ones * that should propagate to those under it. core/java/android/view/ViewGroup.java +22 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ import android.view.inspector.InspectableProperty.EnumEntry; import android.view.translation.TranslationCapability; import android.view.translation.TranslationSpec.DataFormat; import android.view.translation.ViewTranslationRequest; import android.window.OnBackInvokedDispatcher; import com.android.internal.R; Loading Loading @@ -9296,4 +9297,25 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager requests); } } /** * Walk up the View hierarchy to find the nearest {@link OnBackInvokedDispatcher}. * * @return The {@link OnBackInvokedDispatcher} from this or the nearest * ancestor, or null if the view is both not attached and have no ancestor providing an * {@link OnBackInvokedDispatcher}. * * @param child The direct child of this view for which to find a dispatcher. * @param requester The requester that will use the dispatcher. Can be the same as child. */ @Nullable @Override public OnBackInvokedDispatcher findOnBackInvokedDispatcherForChild(@NonNull View child, @NonNull View requester) { ViewParent parent = getParent(); if (parent != null) { return parent.findOnBackInvokedDispatcherForChild(this, requester); } return null; } } core/java/android/view/ViewParent.java +17 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.graphics.Rect; import android.graphics.Region; import android.os.Bundle; import android.view.accessibility.AccessibilityEvent; import android.window.OnBackInvokedDispatcher; /** * Defines the responsibilities for a class that will be a parent of a View. Loading Loading @@ -697,4 +698,20 @@ public interface ViewParent { getParent().onDescendantUnbufferedRequested(); } } /** * Walk up the View hierarchy to find the nearest {@link OnBackInvokedDispatcher}. * * @return The {@link OnBackInvokedDispatcher} from this or the nearest * ancestor, or null if the view is both not attached and have no ancestor providing an * {@link OnBackInvokedDispatcher}. * * @param child The direct child of this view for which to find a dispatcher. * @param requester The requester that will use the dispatcher. Can be the same as child. */ @Nullable default OnBackInvokedDispatcher findOnBackInvokedDispatcherForChild(@NonNull View child, @NonNull View requester) { return null; } } core/java/android/view/ViewRootImpl.java +7 −0 Original line number Diff line number Diff line Loading @@ -10736,6 +10736,13 @@ public final class ViewRootImpl implements ViewParent, return mOnBackInvokedDispatcher; } @NonNull @Override public OnBackInvokedDispatcher findOnBackInvokedDispatcherForChild( @NonNull View child, @NonNull View requester) { return getOnBackInvokedDispatcher(); } /** * When this ViewRootImpl is added to the window manager, transfers the first * {@link OnBackInvokedCallback} to be called to the server. Loading Loading
core/api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -49645,6 +49645,7 @@ package android.view { method @CallSuper public void drawableHotspotChanged(float, float); method @CallSuper protected void drawableStateChanged(); method public android.view.View findFocus(); method @Nullable public final android.window.OnBackInvokedDispatcher findOnBackInvokedDispatcher(); method public final <T extends android.view.View> T findViewById(@IdRes int); method public final <T extends android.view.View> T findViewWithTag(Object); method public void findViewsWithText(java.util.ArrayList<android.view.View>, CharSequence, int); Loading Loading @@ -50822,6 +50823,7 @@ package android.view { method public void childHasTransientStateChanged(@NonNull android.view.View, boolean); method public void clearChildFocus(android.view.View); method public void createContextMenu(android.view.ContextMenu); method @Nullable public default android.window.OnBackInvokedDispatcher findOnBackInvokedDispatcherForChild(@NonNull android.view.View, @NonNull android.view.View); method public android.view.View focusSearch(android.view.View, int); method public void focusableViewAvailable(android.view.View); method public boolean getChildVisibleRect(android.view.View, android.graphics.Rect, android.graphics.Point);
core/java/android/view/View.java +18 −0 Original line number Diff line number Diff line Loading @@ -162,6 +162,7 @@ import android.view.translation.ViewTranslationResponse; import android.widget.Checkable; import android.widget.FrameLayout; import android.widget.ScrollBarDrawable; import android.window.OnBackInvokedDispatcher; import com.android.internal.R; import com.android.internal.util.ArrayUtils; Loading Loading @@ -12098,6 +12099,23 @@ public class View implements Drawable.Callback, KeyEvent.Callback, return null; } /** * Walk up the View hierarchy to find the nearest {@link OnBackInvokedDispatcher}. * * @return The {@link OnBackInvokedDispatcher} from this or the nearest * ancestor, or null if this view is both not attached and have no ancestor providing an * {@link OnBackInvokedDispatcher}. */ @Nullable public final OnBackInvokedDispatcher findOnBackInvokedDispatcher() { ViewParent parent = getParent(); if (parent != null) { return parent.findOnBackInvokedDispatcherForChild(this, this); } return null; } /** * @hide Compute the insets that should be consumed by this view and the ones * that should propagate to those under it.
core/java/android/view/ViewGroup.java +22 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ import android.view.inspector.InspectableProperty.EnumEntry; import android.view.translation.TranslationCapability; import android.view.translation.TranslationSpec.DataFormat; import android.view.translation.ViewTranslationRequest; import android.window.OnBackInvokedDispatcher; import com.android.internal.R; Loading Loading @@ -9296,4 +9297,25 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager requests); } } /** * Walk up the View hierarchy to find the nearest {@link OnBackInvokedDispatcher}. * * @return The {@link OnBackInvokedDispatcher} from this or the nearest * ancestor, or null if the view is both not attached and have no ancestor providing an * {@link OnBackInvokedDispatcher}. * * @param child The direct child of this view for which to find a dispatcher. * @param requester The requester that will use the dispatcher. Can be the same as child. */ @Nullable @Override public OnBackInvokedDispatcher findOnBackInvokedDispatcherForChild(@NonNull View child, @NonNull View requester) { ViewParent parent = getParent(); if (parent != null) { return parent.findOnBackInvokedDispatcherForChild(this, requester); } return null; } }
core/java/android/view/ViewParent.java +17 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.graphics.Rect; import android.graphics.Region; import android.os.Bundle; import android.view.accessibility.AccessibilityEvent; import android.window.OnBackInvokedDispatcher; /** * Defines the responsibilities for a class that will be a parent of a View. Loading Loading @@ -697,4 +698,20 @@ public interface ViewParent { getParent().onDescendantUnbufferedRequested(); } } /** * Walk up the View hierarchy to find the nearest {@link OnBackInvokedDispatcher}. * * @return The {@link OnBackInvokedDispatcher} from this or the nearest * ancestor, or null if the view is both not attached and have no ancestor providing an * {@link OnBackInvokedDispatcher}. * * @param child The direct child of this view for which to find a dispatcher. * @param requester The requester that will use the dispatcher. Can be the same as child. */ @Nullable default OnBackInvokedDispatcher findOnBackInvokedDispatcherForChild(@NonNull View child, @NonNull View requester) { return null; } }
core/java/android/view/ViewRootImpl.java +7 −0 Original line number Diff line number Diff line Loading @@ -10736,6 +10736,13 @@ public final class ViewRootImpl implements ViewParent, return mOnBackInvokedDispatcher; } @NonNull @Override public OnBackInvokedDispatcher findOnBackInvokedDispatcherForChild( @NonNull View child, @NonNull View requester) { return getOnBackInvokedDispatcher(); } /** * When this ViewRootImpl is added to the window manager, transfers the first * {@link OnBackInvokedCallback} to be called to the server. Loading