Merge "Nullability annotations for view and widget"
This commit is contained in:
committed by
Android (Google) Code Review
commit
7c9b826042
@@ -47514,16 +47514,16 @@ package android.view {
|
||||
}
|
||||
|
||||
public abstract class ActionProvider {
|
||||
ctor public ActionProvider(android.content.Context);
|
||||
ctor public ActionProvider(@NonNull android.content.Context);
|
||||
method public boolean hasSubMenu();
|
||||
method public boolean isVisible();
|
||||
method @Deprecated public abstract android.view.View onCreateActionView();
|
||||
method public android.view.View onCreateActionView(android.view.MenuItem);
|
||||
method @Deprecated @NonNull public abstract android.view.View onCreateActionView();
|
||||
method @NonNull public android.view.View onCreateActionView(@NonNull android.view.MenuItem);
|
||||
method public boolean onPerformDefaultAction();
|
||||
method public void onPrepareSubMenu(android.view.SubMenu);
|
||||
method public void onPrepareSubMenu(@NonNull android.view.SubMenu);
|
||||
method public boolean overridesItemVisibility();
|
||||
method public void refreshVisibility();
|
||||
method public void setVisibilityListener(android.view.ActionProvider.VisibilityListener);
|
||||
method public void setVisibilityListener(@Nullable android.view.ActionProvider.VisibilityListener);
|
||||
}
|
||||
|
||||
public static interface ActionProvider.VisibilityListener {
|
||||
@@ -47793,60 +47793,60 @@ package android.view {
|
||||
}
|
||||
|
||||
public class GestureDetector {
|
||||
ctor @Deprecated public GestureDetector(android.view.GestureDetector.OnGestureListener, android.os.Handler);
|
||||
ctor @Deprecated public GestureDetector(android.view.GestureDetector.OnGestureListener);
|
||||
ctor public GestureDetector(@UiContext android.content.Context, android.view.GestureDetector.OnGestureListener);
|
||||
ctor public GestureDetector(@UiContext android.content.Context, android.view.GestureDetector.OnGestureListener, android.os.Handler);
|
||||
ctor public GestureDetector(@UiContext android.content.Context, android.view.GestureDetector.OnGestureListener, android.os.Handler, boolean);
|
||||
ctor @Deprecated public GestureDetector(@NonNull android.view.GestureDetector.OnGestureListener, @Nullable android.os.Handler);
|
||||
ctor @Deprecated public GestureDetector(@NonNull android.view.GestureDetector.OnGestureListener);
|
||||
ctor public GestureDetector(@Nullable @UiContext android.content.Context, @NonNull android.view.GestureDetector.OnGestureListener);
|
||||
ctor public GestureDetector(@Nullable @UiContext android.content.Context, @NonNull android.view.GestureDetector.OnGestureListener, @Nullable android.os.Handler);
|
||||
ctor public GestureDetector(@Nullable @UiContext android.content.Context, @NonNull android.view.GestureDetector.OnGestureListener, @Nullable android.os.Handler, boolean);
|
||||
method public boolean isLongpressEnabled();
|
||||
method public boolean onGenericMotionEvent(android.view.MotionEvent);
|
||||
method public boolean onTouchEvent(android.view.MotionEvent);
|
||||
method public void setContextClickListener(android.view.GestureDetector.OnContextClickListener);
|
||||
method public boolean onGenericMotionEvent(@NonNull android.view.MotionEvent);
|
||||
method public boolean onTouchEvent(@NonNull android.view.MotionEvent);
|
||||
method public void setContextClickListener(@Nullable android.view.GestureDetector.OnContextClickListener);
|
||||
method public void setIsLongpressEnabled(boolean);
|
||||
method public void setOnDoubleTapListener(android.view.GestureDetector.OnDoubleTapListener);
|
||||
method public void setOnDoubleTapListener(@Nullable android.view.GestureDetector.OnDoubleTapListener);
|
||||
}
|
||||
|
||||
public static interface GestureDetector.OnContextClickListener {
|
||||
method public boolean onContextClick(android.view.MotionEvent);
|
||||
method public boolean onContextClick(@NonNull android.view.MotionEvent);
|
||||
}
|
||||
|
||||
public static interface GestureDetector.OnDoubleTapListener {
|
||||
method public boolean onDoubleTap(android.view.MotionEvent);
|
||||
method public boolean onDoubleTapEvent(android.view.MotionEvent);
|
||||
method public boolean onSingleTapConfirmed(android.view.MotionEvent);
|
||||
method public boolean onDoubleTap(@NonNull android.view.MotionEvent);
|
||||
method public boolean onDoubleTapEvent(@NonNull android.view.MotionEvent);
|
||||
method public boolean onSingleTapConfirmed(@NonNull android.view.MotionEvent);
|
||||
}
|
||||
|
||||
public static interface GestureDetector.OnGestureListener {
|
||||
method public boolean onDown(android.view.MotionEvent);
|
||||
method public boolean onFling(android.view.MotionEvent, android.view.MotionEvent, float, float);
|
||||
method public void onLongPress(android.view.MotionEvent);
|
||||
method public boolean onScroll(android.view.MotionEvent, android.view.MotionEvent, float, float);
|
||||
method public void onShowPress(android.view.MotionEvent);
|
||||
method public boolean onSingleTapUp(android.view.MotionEvent);
|
||||
method public boolean onDown(@NonNull android.view.MotionEvent);
|
||||
method public boolean onFling(@NonNull android.view.MotionEvent, @NonNull android.view.MotionEvent, float, float);
|
||||
method public void onLongPress(@NonNull android.view.MotionEvent);
|
||||
method public boolean onScroll(@NonNull android.view.MotionEvent, @NonNull android.view.MotionEvent, float, float);
|
||||
method public void onShowPress(@NonNull android.view.MotionEvent);
|
||||
method public boolean onSingleTapUp(@NonNull android.view.MotionEvent);
|
||||
}
|
||||
|
||||
public static class GestureDetector.SimpleOnGestureListener implements android.view.GestureDetector.OnContextClickListener android.view.GestureDetector.OnDoubleTapListener android.view.GestureDetector.OnGestureListener {
|
||||
ctor public GestureDetector.SimpleOnGestureListener();
|
||||
method public boolean onContextClick(android.view.MotionEvent);
|
||||
method public boolean onDoubleTap(android.view.MotionEvent);
|
||||
method public boolean onDoubleTapEvent(android.view.MotionEvent);
|
||||
method public boolean onDown(android.view.MotionEvent);
|
||||
method public boolean onFling(android.view.MotionEvent, android.view.MotionEvent, float, float);
|
||||
method public void onLongPress(android.view.MotionEvent);
|
||||
method public boolean onScroll(android.view.MotionEvent, android.view.MotionEvent, float, float);
|
||||
method public void onShowPress(android.view.MotionEvent);
|
||||
method public boolean onSingleTapConfirmed(android.view.MotionEvent);
|
||||
method public boolean onSingleTapUp(android.view.MotionEvent);
|
||||
method public boolean onContextClick(@NonNull android.view.MotionEvent);
|
||||
method public boolean onDoubleTap(@NonNull android.view.MotionEvent);
|
||||
method public boolean onDoubleTapEvent(@NonNull android.view.MotionEvent);
|
||||
method public boolean onDown(@NonNull android.view.MotionEvent);
|
||||
method public boolean onFling(@NonNull android.view.MotionEvent, @NonNull android.view.MotionEvent, float, float);
|
||||
method public void onLongPress(@NonNull android.view.MotionEvent);
|
||||
method public boolean onScroll(@NonNull android.view.MotionEvent, @NonNull android.view.MotionEvent, float, float);
|
||||
method public void onShowPress(@NonNull android.view.MotionEvent);
|
||||
method public boolean onSingleTapConfirmed(@NonNull android.view.MotionEvent);
|
||||
method public boolean onSingleTapUp(@NonNull android.view.MotionEvent);
|
||||
}
|
||||
|
||||
public class Gravity {
|
||||
ctor public Gravity();
|
||||
method public static void apply(int, int, int, android.graphics.Rect, android.graphics.Rect);
|
||||
method public static void apply(int, int, int, android.graphics.Rect, android.graphics.Rect, int);
|
||||
method public static void apply(int, int, int, android.graphics.Rect, int, int, android.graphics.Rect);
|
||||
method public static void apply(int, int, int, android.graphics.Rect, int, int, android.graphics.Rect, int);
|
||||
method public static void applyDisplay(int, android.graphics.Rect, android.graphics.Rect);
|
||||
method public static void applyDisplay(int, android.graphics.Rect, android.graphics.Rect, int);
|
||||
method public static void apply(int, int, int, @NonNull android.graphics.Rect, @NonNull android.graphics.Rect, int);
|
||||
method public static void apply(int, int, int, @NonNull android.graphics.Rect, int, int, @NonNull android.graphics.Rect);
|
||||
method public static void apply(int, int, int, @NonNull android.graphics.Rect, int, int, @NonNull android.graphics.Rect, int);
|
||||
method public static void applyDisplay(int, @NonNull android.graphics.Rect, @NonNull android.graphics.Rect);
|
||||
method public static void applyDisplay(int, @NonNull android.graphics.Rect, @NonNull android.graphics.Rect, int);
|
||||
method public static int getAbsoluteGravity(int, int);
|
||||
method public static boolean isHorizontal(int);
|
||||
method public static boolean isVertical(int);
|
||||
@@ -48578,60 +48578,60 @@ package android.view {
|
||||
public interface MenuItem {
|
||||
method public boolean collapseActionView();
|
||||
method public boolean expandActionView();
|
||||
method public android.view.ActionProvider getActionProvider();
|
||||
method public android.view.View getActionView();
|
||||
method @Nullable public android.view.ActionProvider getActionProvider();
|
||||
method @Nullable public android.view.View getActionView();
|
||||
method public default int getAlphabeticModifiers();
|
||||
method public char getAlphabeticShortcut();
|
||||
method public default CharSequence getContentDescription();
|
||||
method @Nullable public default CharSequence getContentDescription();
|
||||
method public int getGroupId();
|
||||
method public android.graphics.drawable.Drawable getIcon();
|
||||
method @Nullable public android.graphics.drawable.Drawable getIcon();
|
||||
method @Nullable public default android.graphics.BlendMode getIconTintBlendMode();
|
||||
method @Nullable public default android.content.res.ColorStateList getIconTintList();
|
||||
method @Nullable public default android.graphics.PorterDuff.Mode getIconTintMode();
|
||||
method public android.content.Intent getIntent();
|
||||
method @Nullable public android.content.Intent getIntent();
|
||||
method public int getItemId();
|
||||
method public android.view.ContextMenu.ContextMenuInfo getMenuInfo();
|
||||
method @Nullable public android.view.ContextMenu.ContextMenuInfo getMenuInfo();
|
||||
method public default int getNumericModifiers();
|
||||
method public char getNumericShortcut();
|
||||
method public int getOrder();
|
||||
method public android.view.SubMenu getSubMenu();
|
||||
method public CharSequence getTitle();
|
||||
method public CharSequence getTitleCondensed();
|
||||
method public default CharSequence getTooltipText();
|
||||
method @Nullable public android.view.SubMenu getSubMenu();
|
||||
method @Nullable public CharSequence getTitle();
|
||||
method @Nullable public CharSequence getTitleCondensed();
|
||||
method @Nullable public default CharSequence getTooltipText();
|
||||
method public boolean hasSubMenu();
|
||||
method public boolean isActionViewExpanded();
|
||||
method public boolean isCheckable();
|
||||
method public boolean isChecked();
|
||||
method public boolean isEnabled();
|
||||
method public boolean isVisible();
|
||||
method public android.view.MenuItem setActionProvider(android.view.ActionProvider);
|
||||
method public android.view.MenuItem setActionView(android.view.View);
|
||||
method public android.view.MenuItem setActionView(@LayoutRes int);
|
||||
method public android.view.MenuItem setAlphabeticShortcut(char);
|
||||
method public default android.view.MenuItem setAlphabeticShortcut(char, int);
|
||||
method public android.view.MenuItem setCheckable(boolean);
|
||||
method public android.view.MenuItem setChecked(boolean);
|
||||
method public default android.view.MenuItem setContentDescription(CharSequence);
|
||||
method public android.view.MenuItem setEnabled(boolean);
|
||||
method public android.view.MenuItem setIcon(android.graphics.drawable.Drawable);
|
||||
method public android.view.MenuItem setIcon(@DrawableRes int);
|
||||
method @NonNull public android.view.MenuItem setActionProvider(@Nullable android.view.ActionProvider);
|
||||
method @NonNull public android.view.MenuItem setActionView(@Nullable android.view.View);
|
||||
method @NonNull public android.view.MenuItem setActionView(@LayoutRes int);
|
||||
method @NonNull public android.view.MenuItem setAlphabeticShortcut(char);
|
||||
method @NonNull public default android.view.MenuItem setAlphabeticShortcut(char, int);
|
||||
method @NonNull public android.view.MenuItem setCheckable(boolean);
|
||||
method @NonNull public android.view.MenuItem setChecked(boolean);
|
||||
method @NonNull public default android.view.MenuItem setContentDescription(@Nullable CharSequence);
|
||||
method @NonNull public android.view.MenuItem setEnabled(boolean);
|
||||
method @NonNull public android.view.MenuItem setIcon(@Nullable android.graphics.drawable.Drawable);
|
||||
method @NonNull public android.view.MenuItem setIcon(@DrawableRes int);
|
||||
method @NonNull public default android.view.MenuItem setIconTintBlendMode(@Nullable android.graphics.BlendMode);
|
||||
method public default android.view.MenuItem setIconTintList(@Nullable android.content.res.ColorStateList);
|
||||
method @NonNull public default android.view.MenuItem setIconTintList(@Nullable android.content.res.ColorStateList);
|
||||
method @NonNull public default android.view.MenuItem setIconTintMode(@Nullable android.graphics.PorterDuff.Mode);
|
||||
method public android.view.MenuItem setIntent(android.content.Intent);
|
||||
method public android.view.MenuItem setNumericShortcut(char);
|
||||
method public default android.view.MenuItem setNumericShortcut(char, int);
|
||||
method public android.view.MenuItem setOnActionExpandListener(android.view.MenuItem.OnActionExpandListener);
|
||||
method public android.view.MenuItem setOnMenuItemClickListener(android.view.MenuItem.OnMenuItemClickListener);
|
||||
method public android.view.MenuItem setShortcut(char, char);
|
||||
method public default android.view.MenuItem setShortcut(char, char, int, int);
|
||||
method @NonNull public android.view.MenuItem setIntent(@Nullable android.content.Intent);
|
||||
method @NonNull public android.view.MenuItem setNumericShortcut(char);
|
||||
method @NonNull public default android.view.MenuItem setNumericShortcut(char, int);
|
||||
method @NonNull public android.view.MenuItem setOnActionExpandListener(@Nullable android.view.MenuItem.OnActionExpandListener);
|
||||
method @NonNull public android.view.MenuItem setOnMenuItemClickListener(@Nullable android.view.MenuItem.OnMenuItemClickListener);
|
||||
method @NonNull public android.view.MenuItem setShortcut(char, char);
|
||||
method @NonNull public default android.view.MenuItem setShortcut(char, char, int, int);
|
||||
method public void setShowAsAction(int);
|
||||
method public android.view.MenuItem setShowAsActionFlags(int);
|
||||
method public android.view.MenuItem setTitle(CharSequence);
|
||||
method public android.view.MenuItem setTitle(@StringRes int);
|
||||
method public android.view.MenuItem setTitleCondensed(CharSequence);
|
||||
method public default android.view.MenuItem setTooltipText(CharSequence);
|
||||
method public android.view.MenuItem setVisible(boolean);
|
||||
method @NonNull public android.view.MenuItem setShowAsActionFlags(int);
|
||||
method @NonNull public android.view.MenuItem setTitle(@Nullable CharSequence);
|
||||
method @NonNull public android.view.MenuItem setTitle(@StringRes int);
|
||||
method @NonNull public android.view.MenuItem setTitleCondensed(@Nullable CharSequence);
|
||||
method @NonNull public default android.view.MenuItem setTooltipText(@Nullable CharSequence);
|
||||
method @NonNull public android.view.MenuItem setVisible(boolean);
|
||||
field public static final int SHOW_AS_ACTION_ALWAYS = 2; // 0x2
|
||||
field public static final int SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW = 8; // 0x8
|
||||
field public static final int SHOW_AS_ACTION_IF_ROOM = 1; // 0x1
|
||||
@@ -48640,12 +48640,12 @@ package android.view {
|
||||
}
|
||||
|
||||
public static interface MenuItem.OnActionExpandListener {
|
||||
method public boolean onMenuItemActionCollapse(android.view.MenuItem);
|
||||
method public boolean onMenuItemActionExpand(android.view.MenuItem);
|
||||
method public boolean onMenuItemActionCollapse(@NonNull android.view.MenuItem);
|
||||
method public boolean onMenuItemActionExpand(@NonNull android.view.MenuItem);
|
||||
}
|
||||
|
||||
public static interface MenuItem.OnMenuItemClickListener {
|
||||
method public boolean onMenuItemClick(android.view.MenuItem);
|
||||
method public boolean onMenuItemClick(@NonNull android.view.MenuItem);
|
||||
}
|
||||
|
||||
public final class MotionEvent extends android.view.InputEvent implements android.os.Parcelable {
|
||||
@@ -48920,10 +48920,10 @@ package android.view {
|
||||
}
|
||||
|
||||
public final class PointerIcon implements android.os.Parcelable {
|
||||
method public static android.view.PointerIcon create(@NonNull android.graphics.Bitmap, float, float);
|
||||
method @NonNull public static android.view.PointerIcon create(@NonNull android.graphics.Bitmap, float, float);
|
||||
method public int describeContents();
|
||||
method public static android.view.PointerIcon getSystemIcon(@NonNull android.content.Context, int);
|
||||
method public static android.view.PointerIcon load(@NonNull android.content.res.Resources, @XmlRes int);
|
||||
method @NonNull public static android.view.PointerIcon getSystemIcon(@NonNull android.content.Context, int);
|
||||
method @NonNull public static android.view.PointerIcon load(@NonNull android.content.res.Resources, @XmlRes int);
|
||||
method public void writeToParcel(android.os.Parcel, int);
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.view.PointerIcon> CREATOR;
|
||||
field public static final int TYPE_ALIAS = 1010; // 0x3f2
|
||||
@@ -48966,8 +48966,8 @@ package android.view {
|
||||
}
|
||||
|
||||
public class ScaleGestureDetector {
|
||||
ctor public ScaleGestureDetector(android.content.Context, android.view.ScaleGestureDetector.OnScaleGestureListener);
|
||||
ctor public ScaleGestureDetector(android.content.Context, android.view.ScaleGestureDetector.OnScaleGestureListener, android.os.Handler);
|
||||
ctor public ScaleGestureDetector(@NonNull android.content.Context, @NonNull android.view.ScaleGestureDetector.OnScaleGestureListener);
|
||||
ctor public ScaleGestureDetector(@NonNull android.content.Context, @NonNull android.view.ScaleGestureDetector.OnScaleGestureListener, @Nullable android.os.Handler);
|
||||
method public float getCurrentSpan();
|
||||
method public float getCurrentSpanX();
|
||||
method public float getCurrentSpanY();
|
||||
@@ -48982,22 +48982,22 @@ package android.view {
|
||||
method public boolean isInProgress();
|
||||
method public boolean isQuickScaleEnabled();
|
||||
method public boolean isStylusScaleEnabled();
|
||||
method public boolean onTouchEvent(android.view.MotionEvent);
|
||||
method public boolean onTouchEvent(@NonNull android.view.MotionEvent);
|
||||
method public void setQuickScaleEnabled(boolean);
|
||||
method public void setStylusScaleEnabled(boolean);
|
||||
}
|
||||
|
||||
public static interface ScaleGestureDetector.OnScaleGestureListener {
|
||||
method public boolean onScale(android.view.ScaleGestureDetector);
|
||||
method public boolean onScaleBegin(android.view.ScaleGestureDetector);
|
||||
method public void onScaleEnd(android.view.ScaleGestureDetector);
|
||||
method public boolean onScale(@NonNull android.view.ScaleGestureDetector);
|
||||
method public boolean onScaleBegin(@NonNull android.view.ScaleGestureDetector);
|
||||
method public void onScaleEnd(@NonNull android.view.ScaleGestureDetector);
|
||||
}
|
||||
|
||||
public static class ScaleGestureDetector.SimpleOnScaleGestureListener implements android.view.ScaleGestureDetector.OnScaleGestureListener {
|
||||
ctor public ScaleGestureDetector.SimpleOnScaleGestureListener();
|
||||
method public boolean onScale(android.view.ScaleGestureDetector);
|
||||
method public boolean onScaleBegin(android.view.ScaleGestureDetector);
|
||||
method public void onScaleEnd(android.view.ScaleGestureDetector);
|
||||
method public boolean onScale(@NonNull android.view.ScaleGestureDetector);
|
||||
method public boolean onScaleBegin(@NonNull android.view.ScaleGestureDetector);
|
||||
method public void onScaleEnd(@NonNull android.view.ScaleGestureDetector);
|
||||
}
|
||||
|
||||
@UiThread public interface ScrollCaptureCallback {
|
||||
@@ -49368,7 +49368,7 @@ package android.view {
|
||||
method public boolean dispatchKeyShortcutEvent(android.view.KeyEvent);
|
||||
method public boolean dispatchNestedFling(float, float, boolean);
|
||||
method public boolean dispatchNestedPreFling(float, float);
|
||||
method public boolean dispatchNestedPrePerformAccessibilityAction(int, android.os.Bundle);
|
||||
method public boolean dispatchNestedPrePerformAccessibilityAction(int, @Nullable android.os.Bundle);
|
||||
method public boolean dispatchNestedPreScroll(int, int, @Nullable @Size(2) int[], @Nullable @Size(2) int[]);
|
||||
method public boolean dispatchNestedScroll(int, int, int, int, @Nullable @Size(2) int[]);
|
||||
method public void dispatchPointerCaptureChanged(boolean);
|
||||
@@ -49729,7 +49729,7 @@ package android.view {
|
||||
method @Deprecated public void onWindowSystemUiVisibilityChanged(int);
|
||||
method protected void onWindowVisibilityChanged(int);
|
||||
method protected boolean overScrollBy(int, int, int, int, int, int, int, int, boolean);
|
||||
method public boolean performAccessibilityAction(int, android.os.Bundle);
|
||||
method public boolean performAccessibilityAction(int, @Nullable android.os.Bundle);
|
||||
method public boolean performClick();
|
||||
method public boolean performContextClick(float, float);
|
||||
method public boolean performContextClick();
|
||||
@@ -50140,15 +50140,15 @@ package android.view {
|
||||
public static class View.AccessibilityDelegate {
|
||||
ctor public View.AccessibilityDelegate();
|
||||
method public void addExtraDataToAccessibilityNodeInfo(@NonNull android.view.View, @NonNull android.view.accessibility.AccessibilityNodeInfo, @NonNull String, @Nullable android.os.Bundle);
|
||||
method public boolean dispatchPopulateAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent);
|
||||
method public android.view.accessibility.AccessibilityNodeProvider getAccessibilityNodeProvider(android.view.View);
|
||||
method public void onInitializeAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent);
|
||||
method public void onInitializeAccessibilityNodeInfo(android.view.View, android.view.accessibility.AccessibilityNodeInfo);
|
||||
method public void onPopulateAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent);
|
||||
method public boolean onRequestSendAccessibilityEvent(android.view.ViewGroup, android.view.View, android.view.accessibility.AccessibilityEvent);
|
||||
method public boolean performAccessibilityAction(android.view.View, int, android.os.Bundle);
|
||||
method public void sendAccessibilityEvent(android.view.View, int);
|
||||
method public void sendAccessibilityEventUnchecked(android.view.View, android.view.accessibility.AccessibilityEvent);
|
||||
method public boolean dispatchPopulateAccessibilityEvent(@NonNull android.view.View, @NonNull android.view.accessibility.AccessibilityEvent);
|
||||
method @Nullable public android.view.accessibility.AccessibilityNodeProvider getAccessibilityNodeProvider(@NonNull android.view.View);
|
||||
method public void onInitializeAccessibilityEvent(@NonNull android.view.View, @NonNull android.view.accessibility.AccessibilityEvent);
|
||||
method public void onInitializeAccessibilityNodeInfo(@NonNull android.view.View, @NonNull android.view.accessibility.AccessibilityNodeInfo);
|
||||
method public void onPopulateAccessibilityEvent(@NonNull android.view.View, @NonNull android.view.accessibility.AccessibilityEvent);
|
||||
method public boolean onRequestSendAccessibilityEvent(@NonNull android.view.ViewGroup, @NonNull android.view.View, @NonNull android.view.accessibility.AccessibilityEvent);
|
||||
method public boolean performAccessibilityAction(@NonNull android.view.View, int, @Nullable android.os.Bundle);
|
||||
method public void sendAccessibilityEvent(@NonNull android.view.View, int);
|
||||
method public void sendAccessibilityEventUnchecked(@NonNull android.view.View, @NonNull android.view.accessibility.AccessibilityEvent);
|
||||
}
|
||||
|
||||
public static class View.BaseSavedState extends android.view.AbsSavedState {
|
||||
@@ -50178,12 +50178,12 @@ package android.view {
|
||||
}
|
||||
|
||||
public static interface View.OnApplyWindowInsetsListener {
|
||||
method public android.view.WindowInsets onApplyWindowInsets(android.view.View, android.view.WindowInsets);
|
||||
method @NonNull public android.view.WindowInsets onApplyWindowInsets(@NonNull android.view.View, @NonNull android.view.WindowInsets);
|
||||
}
|
||||
|
||||
public static interface View.OnAttachStateChangeListener {
|
||||
method public void onViewAttachedToWindow(android.view.View);
|
||||
method public void onViewDetachedFromWindow(android.view.View);
|
||||
method public void onViewAttachedToWindow(@NonNull android.view.View);
|
||||
method public void onViewDetachedFromWindow(@NonNull android.view.View);
|
||||
}
|
||||
|
||||
public static interface View.OnCapturedPointerListener {
|
||||
@@ -50252,7 +50252,7 @@ package android.view {
|
||||
|
||||
public class ViewConfiguration {
|
||||
ctor @Deprecated public ViewConfiguration();
|
||||
method public static android.view.ViewConfiguration get(@UiContext android.content.Context);
|
||||
method public static android.view.ViewConfiguration get(@NonNull @UiContext android.content.Context);
|
||||
method @Deprecated @FloatRange(from=1.0) public static float getAmbiguousGestureMultiplier();
|
||||
method public static long getDefaultActionModeHideDuration();
|
||||
method public static int getDoubleTapTimeout();
|
||||
@@ -50571,8 +50571,8 @@ package android.view {
|
||||
method public boolean canResolveLayoutDirection();
|
||||
method public boolean canResolveTextAlignment();
|
||||
method public boolean canResolveTextDirection();
|
||||
method public void childDrawableStateChanged(android.view.View);
|
||||
method public void childHasTransientStateChanged(android.view.View, boolean);
|
||||
method public void childDrawableStateChanged(@NonNull android.view.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 public android.view.View focusSearch(android.view.View, int);
|
||||
@@ -50590,23 +50590,23 @@ package android.view {
|
||||
method public boolean isTextAlignmentResolved();
|
||||
method public boolean isTextDirectionResolved();
|
||||
method public android.view.View keyboardNavigationClusterSearch(android.view.View, int);
|
||||
method public void notifySubtreeAccessibilityStateChanged(android.view.View, @NonNull android.view.View, int);
|
||||
method public void notifySubtreeAccessibilityStateChanged(@NonNull android.view.View, @NonNull android.view.View, int);
|
||||
method public default void onDescendantInvalidated(@NonNull android.view.View, @NonNull android.view.View);
|
||||
method public boolean onNestedFling(android.view.View, float, float, boolean);
|
||||
method public boolean onNestedPreFling(android.view.View, float, float);
|
||||
method public boolean onNestedPrePerformAccessibilityAction(android.view.View, int, android.os.Bundle);
|
||||
method public void onNestedPreScroll(android.view.View, int, int, int[]);
|
||||
method public void onNestedScroll(android.view.View, int, int, int, int);
|
||||
method public void onNestedScrollAccepted(android.view.View, android.view.View, int);
|
||||
method public boolean onStartNestedScroll(android.view.View, android.view.View, int);
|
||||
method public void onStopNestedScroll(android.view.View);
|
||||
method public boolean onNestedFling(@NonNull android.view.View, float, float, boolean);
|
||||
method public boolean onNestedPreFling(@NonNull android.view.View, float, float);
|
||||
method public boolean onNestedPrePerformAccessibilityAction(@NonNull android.view.View, int, @Nullable android.os.Bundle);
|
||||
method public void onNestedPreScroll(@NonNull android.view.View, int, int, @NonNull int[]);
|
||||
method public void onNestedScroll(@NonNull android.view.View, int, int, int, int);
|
||||
method public void onNestedScrollAccepted(@NonNull android.view.View, @NonNull android.view.View, int);
|
||||
method public boolean onStartNestedScroll(@NonNull android.view.View, @NonNull android.view.View, int);
|
||||
method public void onStopNestedScroll(@NonNull android.view.View);
|
||||
method public void recomputeViewAttributes(android.view.View);
|
||||
method public void requestChildFocus(android.view.View, android.view.View);
|
||||
method public boolean requestChildRectangleOnScreen(android.view.View, android.graphics.Rect, boolean);
|
||||
method public boolean requestChildRectangleOnScreen(@NonNull android.view.View, android.graphics.Rect, boolean);
|
||||
method public void requestDisallowInterceptTouchEvent(boolean);
|
||||
method public void requestFitSystemWindows();
|
||||
method public void requestLayout();
|
||||
method public boolean requestSendAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent);
|
||||
method public boolean requestSendAccessibilityEvent(@NonNull android.view.View, android.view.accessibility.AccessibilityEvent);
|
||||
method public void requestTransparentRegion(android.view.View);
|
||||
method public boolean showContextMenuForChild(android.view.View);
|
||||
method public boolean showContextMenuForChild(android.view.View, float, float);
|
||||
@@ -50615,43 +50615,43 @@ package android.view {
|
||||
}
|
||||
|
||||
public class ViewPropertyAnimator {
|
||||
method public android.view.ViewPropertyAnimator alpha(@FloatRange(from=0.0f, to=1.0f) float);
|
||||
method public android.view.ViewPropertyAnimator alphaBy(float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator alpha(@FloatRange(from=0.0f, to=1.0f) float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator alphaBy(float);
|
||||
method public void cancel();
|
||||
method public long getDuration();
|
||||
method public android.animation.TimeInterpolator getInterpolator();
|
||||
method @Nullable public android.animation.TimeInterpolator getInterpolator();
|
||||
method public long getStartDelay();
|
||||
method public android.view.ViewPropertyAnimator rotation(float);
|
||||
method public android.view.ViewPropertyAnimator rotationBy(float);
|
||||
method public android.view.ViewPropertyAnimator rotationX(float);
|
||||
method public android.view.ViewPropertyAnimator rotationXBy(float);
|
||||
method public android.view.ViewPropertyAnimator rotationY(float);
|
||||
method public android.view.ViewPropertyAnimator rotationYBy(float);
|
||||
method public android.view.ViewPropertyAnimator scaleX(float);
|
||||
method public android.view.ViewPropertyAnimator scaleXBy(float);
|
||||
method public android.view.ViewPropertyAnimator scaleY(float);
|
||||
method public android.view.ViewPropertyAnimator scaleYBy(float);
|
||||
method public android.view.ViewPropertyAnimator setDuration(long);
|
||||
method public android.view.ViewPropertyAnimator setInterpolator(android.animation.TimeInterpolator);
|
||||
method public android.view.ViewPropertyAnimator setListener(android.animation.Animator.AnimatorListener);
|
||||
method public android.view.ViewPropertyAnimator setStartDelay(long);
|
||||
method public android.view.ViewPropertyAnimator setUpdateListener(android.animation.ValueAnimator.AnimatorUpdateListener);
|
||||
method @NonNull public android.view.ViewPropertyAnimator rotation(float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator rotationBy(float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator rotationX(float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator rotationXBy(float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator rotationY(float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator rotationYBy(float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator scaleX(float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator scaleXBy(float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator scaleY(float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator scaleYBy(float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator setDuration(long);
|
||||
method @NonNull public android.view.ViewPropertyAnimator setInterpolator(android.animation.TimeInterpolator);
|
||||
method @NonNull public android.view.ViewPropertyAnimator setListener(@Nullable android.animation.Animator.AnimatorListener);
|
||||
method @NonNull public android.view.ViewPropertyAnimator setStartDelay(long);
|
||||
method @NonNull public android.view.ViewPropertyAnimator setUpdateListener(@Nullable android.animation.ValueAnimator.AnimatorUpdateListener);
|
||||
method public void start();
|
||||
method public android.view.ViewPropertyAnimator translationX(float);
|
||||
method public android.view.ViewPropertyAnimator translationXBy(float);
|
||||
method public android.view.ViewPropertyAnimator translationY(float);
|
||||
method public android.view.ViewPropertyAnimator translationYBy(float);
|
||||
method public android.view.ViewPropertyAnimator translationZ(float);
|
||||
method public android.view.ViewPropertyAnimator translationZBy(float);
|
||||
method public android.view.ViewPropertyAnimator withEndAction(Runnable);
|
||||
method public android.view.ViewPropertyAnimator withLayer();
|
||||
method public android.view.ViewPropertyAnimator withStartAction(Runnable);
|
||||
method public android.view.ViewPropertyAnimator x(float);
|
||||
method public android.view.ViewPropertyAnimator xBy(float);
|
||||
method public android.view.ViewPropertyAnimator y(float);
|
||||
method public android.view.ViewPropertyAnimator yBy(float);
|
||||
method public android.view.ViewPropertyAnimator z(float);
|
||||
method public android.view.ViewPropertyAnimator zBy(float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator translationX(float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator translationXBy(float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator translationY(float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator translationYBy(float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator translationZ(float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator translationZBy(float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator withEndAction(Runnable);
|
||||
method @NonNull public android.view.ViewPropertyAnimator withLayer();
|
||||
method @NonNull public android.view.ViewPropertyAnimator withStartAction(Runnable);
|
||||
method @NonNull public android.view.ViewPropertyAnimator x(float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator xBy(float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator y(float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator yBy(float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator z(float);
|
||||
method @NonNull public android.view.ViewPropertyAnimator zBy(float);
|
||||
}
|
||||
|
||||
public abstract class ViewStructure {
|
||||
@@ -51849,10 +51849,10 @@ package android.view.accessibility {
|
||||
public abstract class AccessibilityNodeProvider {
|
||||
ctor public AccessibilityNodeProvider();
|
||||
method public void addExtraDataToAccessibilityNodeInfo(int, android.view.accessibility.AccessibilityNodeInfo, String, android.os.Bundle);
|
||||
method public android.view.accessibility.AccessibilityNodeInfo createAccessibilityNodeInfo(int);
|
||||
method public java.util.List<android.view.accessibility.AccessibilityNodeInfo> findAccessibilityNodeInfosByText(String, int);
|
||||
method public android.view.accessibility.AccessibilityNodeInfo findFocus(int);
|
||||
method public boolean performAction(int, int, android.os.Bundle);
|
||||
method @Nullable public android.view.accessibility.AccessibilityNodeInfo createAccessibilityNodeInfo(int);
|
||||
method @Nullable public java.util.List<android.view.accessibility.AccessibilityNodeInfo> findAccessibilityNodeInfosByText(String, int);
|
||||
method @Nullable public android.view.accessibility.AccessibilityNodeInfo findFocus(int);
|
||||
method public boolean performAction(int, int, @Nullable android.os.Bundle);
|
||||
field public static final int HOST_VIEW_ID = -1; // 0xffffffff
|
||||
}
|
||||
|
||||
@@ -51860,23 +51860,23 @@ package android.view.accessibility {
|
||||
ctor public AccessibilityRecord();
|
||||
ctor public AccessibilityRecord(@NonNull android.view.accessibility.AccessibilityRecord);
|
||||
method public int getAddedCount();
|
||||
method public CharSequence getBeforeText();
|
||||
method public CharSequence getClassName();
|
||||
method public CharSequence getContentDescription();
|
||||
method @Nullable public CharSequence getBeforeText();
|
||||
method @Nullable public CharSequence getClassName();
|
||||
method @Nullable public CharSequence getContentDescription();
|
||||
method public int getCurrentItemIndex();
|
||||
method public int getDisplayId();
|
||||
method public int getFromIndex();
|
||||
method public int getItemCount();
|
||||
method public int getMaxScrollX();
|
||||
method public int getMaxScrollY();
|
||||
method public android.os.Parcelable getParcelableData();
|
||||
method @Nullable public android.os.Parcelable getParcelableData();
|
||||
method public int getRemovedCount();
|
||||
method public int getScrollDeltaX();
|
||||
method public int getScrollDeltaY();
|
||||
method public int getScrollX();
|
||||
method public int getScrollY();
|
||||
method public android.view.accessibility.AccessibilityNodeInfo getSource();
|
||||
method public java.util.List<java.lang.CharSequence> getText();
|
||||
method @Nullable public android.view.accessibility.AccessibilityNodeInfo getSource();
|
||||
method @NonNull public java.util.List<java.lang.CharSequence> getText();
|
||||
method public int getToIndex();
|
||||
method public int getWindowId();
|
||||
method public boolean isChecked();
|
||||
@@ -51884,14 +51884,14 @@ package android.view.accessibility {
|
||||
method public boolean isFullScreen();
|
||||
method public boolean isPassword();
|
||||
method public boolean isScrollable();
|
||||
method @Deprecated public static android.view.accessibility.AccessibilityRecord obtain(android.view.accessibility.AccessibilityRecord);
|
||||
method @Deprecated public static android.view.accessibility.AccessibilityRecord obtain();
|
||||
method @Deprecated @NonNull public static android.view.accessibility.AccessibilityRecord obtain(@NonNull android.view.accessibility.AccessibilityRecord);
|
||||
method @Deprecated @NonNull public static android.view.accessibility.AccessibilityRecord obtain();
|
||||
method @Deprecated public void recycle();
|
||||
method public void setAddedCount(int);
|
||||
method public void setBeforeText(CharSequence);
|
||||
method public void setBeforeText(@Nullable CharSequence);
|
||||
method public void setChecked(boolean);
|
||||
method public void setClassName(CharSequence);
|
||||
method public void setContentDescription(CharSequence);
|
||||
method public void setClassName(@Nullable CharSequence);
|
||||
method public void setContentDescription(@Nullable CharSequence);
|
||||
method public void setCurrentItemIndex(int);
|
||||
method public void setEnabled(boolean);
|
||||
method public void setFromIndex(int);
|
||||
@@ -51899,7 +51899,7 @@ package android.view.accessibility {
|
||||
method public void setItemCount(int);
|
||||
method public void setMaxScrollX(int);
|
||||
method public void setMaxScrollY(int);
|
||||
method public void setParcelableData(android.os.Parcelable);
|
||||
method public void setParcelableData(@Nullable android.os.Parcelable);
|
||||
method public void setPassword(boolean);
|
||||
method public void setRemovedCount(int);
|
||||
method public void setScrollDeltaX(int);
|
||||
@@ -51907,7 +51907,7 @@ package android.view.accessibility {
|
||||
method public void setScrollX(int);
|
||||
method public void setScrollY(int);
|
||||
method public void setScrollable(boolean);
|
||||
method public void setSource(android.view.View);
|
||||
method public void setSource(@Nullable android.view.View);
|
||||
method public void setSource(@Nullable android.view.View, int);
|
||||
method public void setToIndex(int);
|
||||
}
|
||||
@@ -52230,7 +52230,7 @@ package android.view.animation {
|
||||
}
|
||||
|
||||
public class PathInterpolator extends android.view.animation.BaseInterpolator {
|
||||
ctor public PathInterpolator(android.graphics.Path);
|
||||
ctor public PathInterpolator(@NonNull android.graphics.Path);
|
||||
ctor public PathInterpolator(float, float);
|
||||
ctor public PathInterpolator(float, float, float, float);
|
||||
ctor public PathInterpolator(android.content.Context, android.util.AttributeSet);
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package android.view;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.compat.annotation.UnsupportedAppUsage;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
@@ -67,7 +69,7 @@ public abstract class ActionProvider {
|
||||
*
|
||||
* @param context Context for accessing resources.
|
||||
*/
|
||||
public ActionProvider(Context context) {
|
||||
public ActionProvider(@NonNull Context context) {
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,7 +84,7 @@ public abstract class ActionProvider {
|
||||
* @deprecated use {@link #onCreateActionView(MenuItem)}
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract View onCreateActionView();
|
||||
public abstract @NonNull View onCreateActionView();
|
||||
|
||||
/**
|
||||
* Factory method called by the Android framework to create new action views.
|
||||
@@ -96,7 +98,7 @@ public abstract class ActionProvider {
|
||||
* @param forItem MenuItem to create the action view for
|
||||
* @return the new action view
|
||||
*/
|
||||
public View onCreateActionView(MenuItem forItem) {
|
||||
public @NonNull View onCreateActionView(@NonNull MenuItem forItem) {
|
||||
return onCreateActionView();
|
||||
}
|
||||
|
||||
@@ -200,7 +202,7 @@ public abstract class ActionProvider {
|
||||
*
|
||||
* @param subMenu Submenu that will be displayed
|
||||
*/
|
||||
public void onPrepareSubMenu(SubMenu subMenu) {
|
||||
public void onPrepareSubMenu(@NonNull SubMenu subMenu) {
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -220,7 +222,7 @@ public abstract class ActionProvider {
|
||||
* @hide Internal use only
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public void setSubUiVisibilityListener(SubUiVisibilityListener listener) {
|
||||
public void setSubUiVisibilityListener(@Nullable SubUiVisibilityListener listener) {
|
||||
mSubUiVisibilityListener = listener;
|
||||
}
|
||||
|
||||
@@ -230,7 +232,7 @@ public abstract class ActionProvider {
|
||||
*
|
||||
* @param listener listener to set
|
||||
*/
|
||||
public void setVisibilityListener(VisibilityListener listener) {
|
||||
public void setVisibilityListener(@Nullable VisibilityListener listener) {
|
||||
if (mVisibilityListener != null) {
|
||||
Log.w(TAG, "setVisibilityListener: Setting a new ActionProvider.VisibilityListener " +
|
||||
"when one is already set. Are you reusing this " + getClass().getSimpleName() +
|
||||
|
||||
@@ -260,7 +260,7 @@ public final class DisplayCutout {
|
||||
private final float mScale;
|
||||
|
||||
public CutoutPathParserInfo(int displayWidth, int displayHeight, float density,
|
||||
String cutoutSpec, @Rotation int rotation, float scale) {
|
||||
@Nullable String cutoutSpec, @Rotation int rotation, float scale) {
|
||||
mDisplayWidth = displayWidth;
|
||||
mDisplayHeight = displayHeight;
|
||||
mDensity = density;
|
||||
@@ -269,7 +269,7 @@ public final class DisplayCutout {
|
||||
mScale = scale;
|
||||
}
|
||||
|
||||
public CutoutPathParserInfo(CutoutPathParserInfo cutoutPathParserInfo) {
|
||||
public CutoutPathParserInfo(@NonNull CutoutPathParserInfo cutoutPathParserInfo) {
|
||||
mDisplayWidth = cutoutPathParserInfo.mDisplayWidth;
|
||||
mDisplayHeight = cutoutPathParserInfo.mDisplayHeight;
|
||||
mDensity = cutoutPathParserInfo.mDensity;
|
||||
|
||||
@@ -23,6 +23,8 @@ import static com.android.internal.util.FrameworkStatsLog.TOUCH_GESTURE_CLASSIFI
|
||||
import static com.android.internal.util.FrameworkStatsLog.TOUCH_GESTURE_CLASSIFIED__CLASSIFICATION__SINGLE_TAP;
|
||||
import static com.android.internal.util.FrameworkStatsLog.TOUCH_GESTURE_CLASSIFIED__CLASSIFICATION__UNKNOWN_CLASSIFICATION;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.UiContext;
|
||||
import android.compat.annotation.UnsupportedAppUsage;
|
||||
import android.content.Context;
|
||||
@@ -68,7 +70,7 @@ public class GestureDetector {
|
||||
*
|
||||
* @param e The down motion event.
|
||||
*/
|
||||
boolean onDown(MotionEvent e);
|
||||
boolean onDown(@NonNull MotionEvent e);
|
||||
|
||||
/**
|
||||
* The user has performed a down {@link MotionEvent} and not performed
|
||||
@@ -78,7 +80,7 @@ public class GestureDetector {
|
||||
*
|
||||
* @param e The down motion event
|
||||
*/
|
||||
void onShowPress(MotionEvent e);
|
||||
void onShowPress(@NonNull MotionEvent e);
|
||||
|
||||
/**
|
||||
* Notified when a tap occurs with the up {@link MotionEvent}
|
||||
@@ -87,7 +89,7 @@ public class GestureDetector {
|
||||
* @param e The up motion event that completed the first tap
|
||||
* @return true if the event is consumed, else false
|
||||
*/
|
||||
boolean onSingleTapUp(MotionEvent e);
|
||||
boolean onSingleTapUp(@NonNull MotionEvent e);
|
||||
|
||||
/**
|
||||
* Notified when a scroll occurs with the initial on down {@link MotionEvent} and the
|
||||
@@ -104,7 +106,8 @@ public class GestureDetector {
|
||||
* and {@code e2}.
|
||||
* @return true if the event is consumed, else false
|
||||
*/
|
||||
boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY);
|
||||
boolean onScroll(@NonNull MotionEvent e1, @NonNull MotionEvent e2, float distanceX,
|
||||
float distanceY);
|
||||
|
||||
/**
|
||||
* Notified when a long press occurs with the initial on down {@link MotionEvent}
|
||||
@@ -112,7 +115,7 @@ public class GestureDetector {
|
||||
*
|
||||
* @param e The initial on down motion event that started the longpress.
|
||||
*/
|
||||
void onLongPress(MotionEvent e);
|
||||
void onLongPress(@NonNull MotionEvent e);
|
||||
|
||||
/**
|
||||
* Notified of a fling event when it occurs with the initial on down {@link MotionEvent}
|
||||
@@ -127,7 +130,8 @@ public class GestureDetector {
|
||||
* along the y axis.
|
||||
* @return true if the event is consumed, else false
|
||||
*/
|
||||
boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY);
|
||||
boolean onFling(@NonNull MotionEvent e1, @NonNull MotionEvent e2, float velocityX,
|
||||
float velocityY);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,7 +150,7 @@ public class GestureDetector {
|
||||
* @param e The down motion event of the single-tap.
|
||||
* @return true if the event is consumed, else false
|
||||
*/
|
||||
boolean onSingleTapConfirmed(MotionEvent e);
|
||||
boolean onSingleTapConfirmed(@NonNull MotionEvent e);
|
||||
|
||||
/**
|
||||
* Notified when a double-tap occurs. Triggered on the down event of second tap.
|
||||
@@ -154,7 +158,7 @@ public class GestureDetector {
|
||||
* @param e The down motion event of the first tap of the double-tap.
|
||||
* @return true if the event is consumed, else false
|
||||
*/
|
||||
boolean onDoubleTap(MotionEvent e);
|
||||
boolean onDoubleTap(@NonNull MotionEvent e);
|
||||
|
||||
/**
|
||||
* Notified when an event within a double-tap gesture occurs, including
|
||||
@@ -163,7 +167,7 @@ public class GestureDetector {
|
||||
* @param e The motion event that occurred during the double-tap gesture.
|
||||
* @return true if the event is consumed, else false
|
||||
*/
|
||||
boolean onDoubleTapEvent(MotionEvent e);
|
||||
boolean onDoubleTapEvent(@NonNull MotionEvent e);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -178,7 +182,7 @@ public class GestureDetector {
|
||||
* @param e The motion event that occurred during the context click.
|
||||
* @return true if the event is consumed, else false
|
||||
*/
|
||||
boolean onContextClick(MotionEvent e);
|
||||
boolean onContextClick(@NonNull MotionEvent e);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -190,43 +194,43 @@ public class GestureDetector {
|
||||
public static class SimpleOnGestureListener implements OnGestureListener, OnDoubleTapListener,
|
||||
OnContextClickListener {
|
||||
|
||||
public boolean onSingleTapUp(MotionEvent e) {
|
||||
public boolean onSingleTapUp(@NonNull MotionEvent e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onLongPress(MotionEvent e) {
|
||||
public void onLongPress(@NonNull MotionEvent e) {
|
||||
}
|
||||
|
||||
public boolean onScroll(MotionEvent e1, MotionEvent e2,
|
||||
public boolean onScroll(@NonNull MotionEvent e1, @NonNull MotionEvent e2,
|
||||
float distanceX, float distanceY) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
|
||||
public boolean onFling(@NonNull MotionEvent e1, @NonNull MotionEvent e2, float velocityX,
|
||||
float velocityY) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onShowPress(MotionEvent e) {
|
||||
public void onShowPress(@NonNull MotionEvent e) {
|
||||
}
|
||||
|
||||
public boolean onDown(MotionEvent e) {
|
||||
public boolean onDown(@NonNull MotionEvent e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean onDoubleTap(MotionEvent e) {
|
||||
public boolean onDoubleTap(@NonNull MotionEvent e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean onDoubleTapEvent(MotionEvent e) {
|
||||
public boolean onDoubleTapEvent(@NonNull MotionEvent e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean onSingleTapConfirmed(MotionEvent e) {
|
||||
public boolean onSingleTapConfirmed(@NonNull MotionEvent e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean onContextClick(MotionEvent e) {
|
||||
public boolean onContextClick(@NonNull MotionEvent e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -348,14 +352,13 @@ public class GestureDetector {
|
||||
* not be null.
|
||||
* @param handler the handler to use
|
||||
*
|
||||
* @throws NullPointerException if either {@code listener} or
|
||||
* {@code handler} is null.
|
||||
* @throws NullPointerException if {@code listener} is null.
|
||||
*
|
||||
* @deprecated Use {@link #GestureDetector(android.content.Context,
|
||||
* android.view.GestureDetector.OnGestureListener, android.os.Handler)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public GestureDetector(OnGestureListener listener, Handler handler) {
|
||||
public GestureDetector(@NonNull OnGestureListener listener, @Nullable Handler handler) {
|
||||
this(null, listener, handler);
|
||||
}
|
||||
|
||||
@@ -373,7 +376,7 @@ public class GestureDetector {
|
||||
* android.view.GestureDetector.OnGestureListener)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public GestureDetector(OnGestureListener listener) {
|
||||
public GestureDetector(@NonNull OnGestureListener listener) {
|
||||
this(null, listener, null);
|
||||
}
|
||||
|
||||
@@ -392,7 +395,8 @@ public class GestureDetector {
|
||||
* @throws NullPointerException if {@code listener} is null.
|
||||
*/
|
||||
// TODO(b/182007470): Use @ConfigurationContext instead
|
||||
public GestureDetector(@UiContext Context context, OnGestureListener listener) {
|
||||
public GestureDetector(@Nullable @UiContext Context context,
|
||||
@NonNull OnGestureListener listener) {
|
||||
this(context, listener, null);
|
||||
}
|
||||
|
||||
@@ -411,8 +415,8 @@ public class GestureDetector {
|
||||
*
|
||||
* @throws NullPointerException if {@code listener} is null.
|
||||
*/
|
||||
public GestureDetector(@UiContext Context context, OnGestureListener listener,
|
||||
Handler handler) {
|
||||
public GestureDetector(@Nullable @UiContext Context context,
|
||||
@NonNull OnGestureListener listener, @Nullable Handler handler) {
|
||||
if (handler != null) {
|
||||
mHandler = new GestureHandler(handler);
|
||||
} else {
|
||||
@@ -442,8 +446,8 @@ public class GestureDetector {
|
||||
*
|
||||
* @throws NullPointerException if {@code listener} is null.
|
||||
*/
|
||||
public GestureDetector(@UiContext Context context, OnGestureListener listener, Handler handler,
|
||||
boolean unused) {
|
||||
public GestureDetector(@Nullable @UiContext Context context,
|
||||
@NonNull OnGestureListener listener, @Nullable Handler handler, boolean unused) {
|
||||
this(context, listener, handler);
|
||||
}
|
||||
|
||||
@@ -486,7 +490,7 @@ public class GestureDetector {
|
||||
* @param onDoubleTapListener the listener invoked for all the callbacks, or
|
||||
* null to stop listening for double-tap gestures.
|
||||
*/
|
||||
public void setOnDoubleTapListener(OnDoubleTapListener onDoubleTapListener) {
|
||||
public void setOnDoubleTapListener(@Nullable OnDoubleTapListener onDoubleTapListener) {
|
||||
mDoubleTapListener = onDoubleTapListener;
|
||||
}
|
||||
|
||||
@@ -496,7 +500,7 @@ public class GestureDetector {
|
||||
* @param onContextClickListener the listener invoked for all the callbacks, or null to stop
|
||||
* listening for context clicks.
|
||||
*/
|
||||
public void setContextClickListener(OnContextClickListener onContextClickListener) {
|
||||
public void setContextClickListener(@Nullable OnContextClickListener onContextClickListener) {
|
||||
mContextClickListener = onContextClickListener;
|
||||
}
|
||||
|
||||
@@ -528,7 +532,7 @@ public class GestureDetector {
|
||||
* @return true if the {@link OnGestureListener} consumed the event,
|
||||
* else false.
|
||||
*/
|
||||
public boolean onTouchEvent(MotionEvent ev) {
|
||||
public boolean onTouchEvent(@NonNull MotionEvent ev) {
|
||||
if (mInputEventConsistencyVerifier != null) {
|
||||
mInputEventConsistencyVerifier.onTouchEvent(ev, 0);
|
||||
}
|
||||
@@ -800,7 +804,7 @@ public class GestureDetector {
|
||||
* @return true if the {@link OnGestureListener} consumed the event,
|
||||
* else false.
|
||||
*/
|
||||
public boolean onGenericMotionEvent(MotionEvent ev) {
|
||||
public boolean onGenericMotionEvent(@NonNull MotionEvent ev) {
|
||||
if (mInputEventConsistencyVerifier != null) {
|
||||
mInputEventConsistencyVerifier.onGenericMotionEvent(ev, 0);
|
||||
}
|
||||
@@ -860,8 +864,8 @@ public class GestureDetector {
|
||||
mIgnoreNextUpEvent = false;
|
||||
}
|
||||
|
||||
private boolean isConsideredDoubleTap(MotionEvent firstDown, MotionEvent firstUp,
|
||||
MotionEvent secondDown) {
|
||||
private boolean isConsideredDoubleTap(@NonNull MotionEvent firstDown,
|
||||
@NonNull MotionEvent firstUp, @NonNull MotionEvent secondDown) {
|
||||
if (!mAlwaysInBiggerTapRegion) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package android.view;
|
||||
|
||||
import android.annotation.IntDef;
|
||||
import android.annotation.NonNull;
|
||||
import android.graphics.Rect;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
@@ -187,8 +188,8 @@ public class Gravity
|
||||
* @see View#LAYOUT_DIRECTION_LTR
|
||||
* @see View#LAYOUT_DIRECTION_RTL
|
||||
*/
|
||||
public static void apply(int gravity, int w, int h, Rect container,
|
||||
Rect outRect, int layoutDirection) {
|
||||
public static void apply(int gravity, int w, int h, @NonNull Rect container,
|
||||
@NonNull Rect outRect, int layoutDirection) {
|
||||
int absGravity = getAbsoluteGravity(gravity, layoutDirection);
|
||||
apply(absGravity, w, h, container, 0, 0, outRect);
|
||||
}
|
||||
@@ -214,8 +215,8 @@ public class Gravity
|
||||
* @param outRect Receives the computed frame of the object in its
|
||||
* container.
|
||||
*/
|
||||
public static void apply(int gravity, int w, int h, Rect container,
|
||||
int xAdj, int yAdj, Rect outRect) {
|
||||
public static void apply(int gravity, int w, int h, @NonNull Rect container,
|
||||
int xAdj, int yAdj, @NonNull Rect outRect) {
|
||||
switch (gravity&((AXIS_PULL_BEFORE|AXIS_PULL_AFTER)<<AXIS_X_SHIFT)) {
|
||||
case 0:
|
||||
outRect.left = container.left
|
||||
@@ -324,8 +325,8 @@ public class Gravity
|
||||
* @see View#LAYOUT_DIRECTION_LTR
|
||||
* @see View#LAYOUT_DIRECTION_RTL
|
||||
*/
|
||||
public static void apply(int gravity, int w, int h, Rect container,
|
||||
int xAdj, int yAdj, Rect outRect, int layoutDirection) {
|
||||
public static void apply(int gravity, int w, int h, @NonNull Rect container,
|
||||
int xAdj, int yAdj, @NonNull Rect outRect, int layoutDirection) {
|
||||
int absGravity = getAbsoluteGravity(gravity, layoutDirection);
|
||||
apply(absGravity, w, h, container, xAdj, yAdj, outRect);
|
||||
}
|
||||
@@ -346,7 +347,7 @@ public class Gravity
|
||||
* @param inoutObj Supplies the current object position; returns with it
|
||||
* modified if needed to fit in the display.
|
||||
*/
|
||||
public static void applyDisplay(int gravity, Rect display, Rect inoutObj) {
|
||||
public static void applyDisplay(int gravity, @NonNull Rect display, @NonNull Rect inoutObj) {
|
||||
if ((gravity&DISPLAY_CLIP_VERTICAL) != 0) {
|
||||
if (inoutObj.top < display.top) inoutObj.top = display.top;
|
||||
if (inoutObj.bottom > display.bottom) inoutObj.bottom = display.bottom;
|
||||
@@ -404,7 +405,8 @@ public class Gravity
|
||||
* @see View#LAYOUT_DIRECTION_LTR
|
||||
* @see View#LAYOUT_DIRECTION_RTL
|
||||
*/
|
||||
public static void applyDisplay(int gravity, Rect display, Rect inoutObj, int layoutDirection) {
|
||||
public static void applyDisplay(int gravity, @NonNull Rect display, @NonNull Rect inoutObj,
|
||||
int layoutDirection) {
|
||||
int absGravity = getAbsoluteGravity(gravity, layoutDirection);
|
||||
applyDisplay(absGravity, display, inoutObj);
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ public interface MenuItem {
|
||||
* @return Return true to consume this click and prevent others from
|
||||
* executing.
|
||||
*/
|
||||
public boolean onMenuItemClick(MenuItem item);
|
||||
public boolean onMenuItemClick(@NonNull MenuItem item);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -110,7 +110,7 @@ public interface MenuItem {
|
||||
* @param item Item that was expanded
|
||||
* @return true if the item should expand, false if expansion should be suppressed.
|
||||
*/
|
||||
public boolean onMenuItemActionExpand(MenuItem item);
|
||||
public boolean onMenuItemActionExpand(@NonNull MenuItem item);
|
||||
|
||||
/**
|
||||
* Called when a menu item with {@link MenuItem#SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW}
|
||||
@@ -118,7 +118,7 @@ public interface MenuItem {
|
||||
* @param item Item that was collapsed
|
||||
* @return true if the item should collapse, false if collapsing should be suppressed.
|
||||
*/
|
||||
public boolean onMenuItemActionCollapse(MenuItem item);
|
||||
public boolean onMenuItemActionCollapse(@NonNull MenuItem item);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -159,7 +159,7 @@ public interface MenuItem {
|
||||
* @param title The new text to be displayed.
|
||||
* @return This Item so additional setters can be called.
|
||||
*/
|
||||
public MenuItem setTitle(CharSequence title);
|
||||
public @NonNull MenuItem setTitle(@Nullable CharSequence title);
|
||||
|
||||
/**
|
||||
* Change the title associated with this item.
|
||||
@@ -173,14 +173,14 @@ public interface MenuItem {
|
||||
* @see #setTitleCondensed(CharSequence)
|
||||
*/
|
||||
|
||||
public MenuItem setTitle(@StringRes int title);
|
||||
public @NonNull MenuItem setTitle(@StringRes int title);
|
||||
|
||||
/**
|
||||
* Retrieve the current title of the item.
|
||||
*
|
||||
* @return The title.
|
||||
*/
|
||||
public CharSequence getTitle();
|
||||
public @Nullable CharSequence getTitle();
|
||||
|
||||
/**
|
||||
* Change the condensed title associated with this item. The condensed
|
||||
@@ -190,7 +190,7 @@ public interface MenuItem {
|
||||
* @param title The new text to be displayed as the condensed title.
|
||||
* @return This Item so additional setters can be called.
|
||||
*/
|
||||
public MenuItem setTitleCondensed(CharSequence title);
|
||||
public @NonNull MenuItem setTitleCondensed(@Nullable CharSequence title);
|
||||
|
||||
/**
|
||||
* Retrieve the current condensed title of the item. If a condensed
|
||||
@@ -199,7 +199,7 @@ public interface MenuItem {
|
||||
* @return The condensed title, if it exists.
|
||||
* Otherwise the normal title.
|
||||
*/
|
||||
public CharSequence getTitleCondensed();
|
||||
public @Nullable CharSequence getTitleCondensed();
|
||||
|
||||
/**
|
||||
* Change the icon associated with this item. This icon will not always be
|
||||
@@ -209,7 +209,7 @@ public interface MenuItem {
|
||||
* @param icon The new icon (as a Drawable) to be displayed.
|
||||
* @return This Item so additional setters can be called.
|
||||
*/
|
||||
public MenuItem setIcon(Drawable icon);
|
||||
public @NonNull MenuItem setIcon(@Nullable Drawable icon);
|
||||
|
||||
/**
|
||||
* Change the icon associated with this item. This icon will not always be
|
||||
@@ -222,7 +222,7 @@ public interface MenuItem {
|
||||
* @param iconRes The new icon (as a resource ID) to be displayed.
|
||||
* @return This Item so additional setters can be called.
|
||||
*/
|
||||
public MenuItem setIcon(@DrawableRes int iconRes);
|
||||
public @NonNull MenuItem setIcon(@DrawableRes int iconRes);
|
||||
|
||||
/**
|
||||
* Returns the icon for this item as a Drawable (getting it from resources if it hasn't been
|
||||
@@ -233,7 +233,7 @@ public interface MenuItem {
|
||||
*
|
||||
* @return The icon as a Drawable.
|
||||
*/
|
||||
public Drawable getIcon();
|
||||
public @Nullable Drawable getIcon();
|
||||
|
||||
/**
|
||||
* Applies a tint to this item's icon. Does not modify the
|
||||
@@ -250,15 +250,14 @@ public interface MenuItem {
|
||||
* @see #getIconTintList()
|
||||
* @see Drawable#setTintList(ColorStateList)
|
||||
*/
|
||||
public default MenuItem setIconTintList(@Nullable ColorStateList tint) { return this; }
|
||||
public default @NonNull MenuItem setIconTintList(@Nullable ColorStateList tint) { return this; }
|
||||
|
||||
/**
|
||||
* @return the tint applied to this item's icon
|
||||
* @attr ref android.R.styleable#MenuItem_iconTint
|
||||
* @see #setIconTintList(ColorStateList)
|
||||
*/
|
||||
@Nullable
|
||||
public default ColorStateList getIconTintList() { return null; }
|
||||
public default @Nullable ColorStateList getIconTintList() { return null; }
|
||||
|
||||
/**
|
||||
* Specifies the blending mode used to apply the tint specified by
|
||||
@@ -304,8 +303,7 @@ public interface MenuItem {
|
||||
* @see #setIconTintBlendMode(BlendMode)
|
||||
*
|
||||
*/
|
||||
@Nullable
|
||||
public default PorterDuff.Mode getIconTintMode() { return null; }
|
||||
public default @Nullable PorterDuff.Mode getIconTintMode() { return null; }
|
||||
|
||||
/**
|
||||
* Returns the blending mode used to apply the tint to this item's icon, if specified.
|
||||
@@ -315,8 +313,7 @@ public interface MenuItem {
|
||||
* @see #setIconTintBlendMode(BlendMode)
|
||||
*
|
||||
*/
|
||||
@Nullable
|
||||
default BlendMode getIconTintBlendMode() {
|
||||
default @Nullable BlendMode getIconTintBlendMode() {
|
||||
PorterDuff.Mode mode = getIconTintMode();
|
||||
if (mode != null) {
|
||||
return BlendMode.fromValue(mode.nativeInt);
|
||||
@@ -343,7 +340,7 @@ public interface MenuItem {
|
||||
* modify it later.
|
||||
* @return This Item so additional setters can be called.
|
||||
*/
|
||||
public MenuItem setIntent(Intent intent);
|
||||
public @NonNull MenuItem setIntent(@Nullable Intent intent);
|
||||
|
||||
/**
|
||||
* Return the Intent associated with this item. This returns a
|
||||
@@ -354,7 +351,7 @@ public interface MenuItem {
|
||||
* @return Returns the last value supplied to {@link #setIntent}, or
|
||||
* null.
|
||||
*/
|
||||
public Intent getIntent();
|
||||
public @Nullable Intent getIntent();
|
||||
|
||||
/**
|
||||
* Change both the numeric and alphabetic shortcut associated with this
|
||||
@@ -372,7 +369,7 @@ public interface MenuItem {
|
||||
* using a keyboard with alphabetic keys.
|
||||
* @return This Item so additional setters can be called.
|
||||
*/
|
||||
public MenuItem setShortcut(char numericChar, char alphaChar);
|
||||
public @NonNull MenuItem setShortcut(char numericChar, char alphaChar);
|
||||
|
||||
/**
|
||||
* Change both the numeric and alphabetic shortcut associated with this
|
||||
@@ -397,8 +394,8 @@ public interface MenuItem {
|
||||
* {@link KeyEvent#META_SYM_ON}, {@link KeyEvent#META_FUNCTION_ON}.
|
||||
* @return This Item so additional setters can be called.
|
||||
*/
|
||||
default public MenuItem setShortcut(char numericChar, char alphaChar, int numericModifiers,
|
||||
int alphaModifiers) {
|
||||
default public @NonNull MenuItem setShortcut(char numericChar, char alphaChar,
|
||||
int numericModifiers, int alphaModifiers) {
|
||||
if ((alphaModifiers & Menu.SUPPORTED_MODIFIERS_MASK) == KeyEvent.META_CTRL_ON
|
||||
&& (numericModifiers & Menu.SUPPORTED_MODIFIERS_MASK) == KeyEvent.META_CTRL_ON) {
|
||||
return setShortcut(numericChar, alphaChar);
|
||||
@@ -416,7 +413,7 @@ public interface MenuItem {
|
||||
* using a 12-key (numeric) keyboard.
|
||||
* @return This Item so additional setters can be called.
|
||||
*/
|
||||
public MenuItem setNumericShortcut(char numericChar);
|
||||
public @NonNull MenuItem setNumericShortcut(char numericChar);
|
||||
|
||||
/**
|
||||
* Change the numeric shortcut and modifiers associated with this item.
|
||||
@@ -431,7 +428,7 @@ public interface MenuItem {
|
||||
* {@link KeyEvent#META_SYM_ON}, {@link KeyEvent#META_FUNCTION_ON}.
|
||||
* @return This Item so additional setters can be called.
|
||||
*/
|
||||
default public MenuItem setNumericShortcut(char numericChar, int numericModifiers) {
|
||||
default public @NonNull MenuItem setNumericShortcut(char numericChar, int numericModifiers) {
|
||||
if ((numericModifiers & Menu.SUPPORTED_MODIFIERS_MASK) == KeyEvent.META_CTRL_ON) {
|
||||
return setNumericShortcut(numericChar);
|
||||
} else {
|
||||
@@ -475,7 +472,7 @@ public interface MenuItem {
|
||||
* using a keyboard with alphabetic keys.
|
||||
* @return This Item so additional setters can be called.
|
||||
*/
|
||||
public MenuItem setAlphabeticShortcut(char alphaChar);
|
||||
public @NonNull MenuItem setAlphabeticShortcut(char alphaChar);
|
||||
|
||||
/**
|
||||
* Change the alphabetic shortcut associated with this item. The shortcut
|
||||
@@ -495,7 +492,7 @@ public interface MenuItem {
|
||||
* {@link KeyEvent#META_SYM_ON}, {@link KeyEvent#META_FUNCTION_ON}.
|
||||
* @return This Item so additional setters can be called.
|
||||
*/
|
||||
default public MenuItem setAlphabeticShortcut(char alphaChar, int alphaModifiers) {
|
||||
default public @NonNull MenuItem setAlphabeticShortcut(char alphaChar, int alphaModifiers) {
|
||||
if ((alphaModifiers & Menu.SUPPORTED_MODIFIERS_MASK) == KeyEvent.META_CTRL_ON) {
|
||||
return setAlphabeticShortcut(alphaChar);
|
||||
} else {
|
||||
@@ -539,7 +536,7 @@ public interface MenuItem {
|
||||
* @see Menu#setGroupCheckable
|
||||
* @return This Item so additional setters can be called.
|
||||
*/
|
||||
public MenuItem setCheckable(boolean checkable);
|
||||
public @NonNull MenuItem setCheckable(boolean checkable);
|
||||
|
||||
/**
|
||||
* Return whether the item can currently display a check mark.
|
||||
@@ -566,7 +563,7 @@ public interface MenuItem {
|
||||
* it. The default value is false.
|
||||
* @return This Item so additional setters can be called.
|
||||
*/
|
||||
public MenuItem setChecked(boolean checked);
|
||||
public @NonNull MenuItem setChecked(boolean checked);
|
||||
|
||||
/**
|
||||
* Return whether the item is currently displaying a check mark.
|
||||
@@ -586,7 +583,7 @@ public interface MenuItem {
|
||||
* hidden.
|
||||
* @return This Item so additional setters can be called.
|
||||
*/
|
||||
public MenuItem setVisible(boolean visible);
|
||||
public @NonNull MenuItem setVisible(boolean visible);
|
||||
|
||||
/**
|
||||
* Return the visibility of the menu item.
|
||||
@@ -604,7 +601,7 @@ public interface MenuItem {
|
||||
* won't be invokable.
|
||||
* @return This Item so additional setters can be called.
|
||||
*/
|
||||
public MenuItem setEnabled(boolean enabled);
|
||||
public @NonNull MenuItem setEnabled(boolean enabled);
|
||||
|
||||
/**
|
||||
* Return the enabled state of the menu item.
|
||||
@@ -628,7 +625,7 @@ public interface MenuItem {
|
||||
*
|
||||
* @return The associated menu if there is one, else null
|
||||
*/
|
||||
public SubMenu getSubMenu();
|
||||
public @Nullable SubMenu getSubMenu();
|
||||
|
||||
/**
|
||||
* Set a custom listener for invocation of this menu item. In most
|
||||
@@ -641,7 +638,8 @@ public interface MenuItem {
|
||||
* @see Activity#onOptionsItemSelected(MenuItem)
|
||||
* @see Activity#onContextItemSelected(MenuItem)
|
||||
*/
|
||||
public MenuItem setOnMenuItemClickListener(MenuItem.OnMenuItemClickListener menuItemClickListener);
|
||||
public @NonNull MenuItem setOnMenuItemClickListener(
|
||||
@Nullable MenuItem.OnMenuItemClickListener menuItemClickListener);
|
||||
|
||||
/**
|
||||
* Gets the extra information linked to this menu item. This extra
|
||||
@@ -652,7 +650,7 @@ public interface MenuItem {
|
||||
* @return The extra information linked to the View that added this
|
||||
* menu item to the menu. This can be null.
|
||||
*/
|
||||
public ContextMenuInfo getMenuInfo();
|
||||
public @Nullable ContextMenuInfo getMenuInfo();
|
||||
|
||||
/**
|
||||
* Sets how this item should display in the presence of an Action Bar.
|
||||
@@ -690,7 +688,7 @@ public interface MenuItem {
|
||||
* @see #setActionView(View)
|
||||
* @return This MenuItem instance for call chaining.
|
||||
*/
|
||||
public MenuItem setShowAsActionFlags(int actionEnum);
|
||||
public @NonNull MenuItem setShowAsActionFlags(int actionEnum);
|
||||
|
||||
/**
|
||||
* Set an action view for this menu item. An action view will be displayed in place
|
||||
@@ -706,7 +704,7 @@ public interface MenuItem {
|
||||
*
|
||||
* @see #setShowAsAction(int)
|
||||
*/
|
||||
public MenuItem setActionView(View view);
|
||||
public @NonNull MenuItem setActionView(@Nullable View view);
|
||||
|
||||
/**
|
||||
* Set an action view for this menu item. An action view will be displayed in place
|
||||
@@ -722,7 +720,7 @@ public interface MenuItem {
|
||||
*
|
||||
* @see #setShowAsAction(int)
|
||||
*/
|
||||
public MenuItem setActionView(@LayoutRes int resId);
|
||||
public @NonNull MenuItem setActionView(@LayoutRes int resId);
|
||||
|
||||
/**
|
||||
* Returns the currently set action view for this menu item.
|
||||
@@ -732,7 +730,7 @@ public interface MenuItem {
|
||||
* @see #setActionView(View)
|
||||
* @see #setShowAsAction(int)
|
||||
*/
|
||||
public View getActionView();
|
||||
public @Nullable View getActionView();
|
||||
|
||||
/**
|
||||
* Sets the {@link ActionProvider} responsible for creating an action view if
|
||||
@@ -748,7 +746,7 @@ public interface MenuItem {
|
||||
*
|
||||
* @see ActionProvider
|
||||
*/
|
||||
public MenuItem setActionProvider(ActionProvider actionProvider);
|
||||
public @NonNull MenuItem setActionProvider(@Nullable ActionProvider actionProvider);
|
||||
|
||||
/**
|
||||
* Gets the {@link ActionProvider}.
|
||||
@@ -758,7 +756,7 @@ public interface MenuItem {
|
||||
* @see ActionProvider
|
||||
* @see #setActionProvider(ActionProvider)
|
||||
*/
|
||||
public ActionProvider getActionProvider();
|
||||
public @Nullable ActionProvider getActionProvider();
|
||||
|
||||
/**
|
||||
* Expand the action view associated with this menu item.
|
||||
@@ -806,14 +804,14 @@ public interface MenuItem {
|
||||
* @param listener Listener that will respond to expand/collapse events
|
||||
* @return This menu item instance for call chaining
|
||||
*/
|
||||
public MenuItem setOnActionExpandListener(OnActionExpandListener listener);
|
||||
public @NonNull MenuItem setOnActionExpandListener(@Nullable OnActionExpandListener listener);
|
||||
|
||||
/**
|
||||
* Change the content description associated with this menu item.
|
||||
*
|
||||
* @param contentDescription The new content description.
|
||||
*/
|
||||
default MenuItem setContentDescription(CharSequence contentDescription) {
|
||||
default @NonNull MenuItem setContentDescription(@Nullable CharSequence contentDescription) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -822,7 +820,7 @@ public interface MenuItem {
|
||||
*
|
||||
* @return The content description.
|
||||
*/
|
||||
default CharSequence getContentDescription() {
|
||||
default @Nullable CharSequence getContentDescription() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -831,7 +829,7 @@ public interface MenuItem {
|
||||
*
|
||||
* @param tooltipText The new tooltip text.
|
||||
*/
|
||||
default MenuItem setTooltipText(CharSequence tooltipText) {
|
||||
default @NonNull MenuItem setTooltipText(@Nullable CharSequence tooltipText) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -840,7 +838,7 @@ public interface MenuItem {
|
||||
*
|
||||
* @return The tooltip text.
|
||||
*/
|
||||
default CharSequence getTooltipText() {
|
||||
default @Nullable CharSequence getTooltipText() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -184,7 +184,7 @@ public final class PointerIcon implements Parcelable {
|
||||
* @see #TYPE_NULL
|
||||
* @hide
|
||||
*/
|
||||
public static PointerIcon getNullIcon() {
|
||||
public static @NonNull PointerIcon getNullIcon() {
|
||||
return gNullIcon;
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ public final class PointerIcon implements Parcelable {
|
||||
* @throws IllegalArgumentException if context is null.
|
||||
* @hide
|
||||
*/
|
||||
public static PointerIcon getDefaultIcon(@NonNull Context context) {
|
||||
public static @NonNull PointerIcon getDefaultIcon(@NonNull Context context) {
|
||||
return getSystemIcon(context, TYPE_DEFAULT);
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ public final class PointerIcon implements Parcelable {
|
||||
*
|
||||
* @throws IllegalArgumentException if context is null.
|
||||
*/
|
||||
public static PointerIcon getSystemIcon(@NonNull Context context, int type) {
|
||||
public static @NonNull PointerIcon getSystemIcon(@NonNull Context context, int type) {
|
||||
if (context == null) {
|
||||
throw new IllegalArgumentException("context must not be null");
|
||||
}
|
||||
@@ -287,7 +287,8 @@ public final class PointerIcon implements Parcelable {
|
||||
* @throws IllegalArgumentException if bitmap is null, or if the x/y hotspot
|
||||
* parameters are invalid.
|
||||
*/
|
||||
public static PointerIcon create(@NonNull Bitmap bitmap, float hotSpotX, float hotSpotY) {
|
||||
public static @NonNull PointerIcon create(@NonNull Bitmap bitmap, float hotSpotX,
|
||||
float hotSpotY) {
|
||||
if (bitmap == null) {
|
||||
throw new IllegalArgumentException("bitmap must not be null");
|
||||
}
|
||||
@@ -321,7 +322,7 @@ public final class PointerIcon implements Parcelable {
|
||||
* @throws Resources.NotFoundException if the resource was not found or the drawable
|
||||
* linked in the resource was not found.
|
||||
*/
|
||||
public static PointerIcon load(@NonNull Resources resources, @XmlRes int resourceId) {
|
||||
public static @NonNull PointerIcon load(@NonNull Resources resources, @XmlRes int resourceId) {
|
||||
if (resources == null) {
|
||||
throw new IllegalArgumentException("resources must not be null");
|
||||
}
|
||||
@@ -342,7 +343,7 @@ public final class PointerIcon implements Parcelable {
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
|
||||
public PointerIcon load(@NonNull Context context) {
|
||||
public @NonNull PointerIcon load(@NonNull Context context) {
|
||||
if (context == null) {
|
||||
throw new IllegalArgumentException("context must not be null");
|
||||
}
|
||||
@@ -362,7 +363,7 @@ public final class PointerIcon implements Parcelable {
|
||||
return mType;
|
||||
}
|
||||
|
||||
public static final @android.annotation.NonNull Parcelable.Creator<PointerIcon> CREATOR
|
||||
public static final @NonNull Parcelable.Creator<PointerIcon> CREATOR
|
||||
= new Parcelable.Creator<PointerIcon>() {
|
||||
public PointerIcon createFromParcel(Parcel in) {
|
||||
int type = in.readInt();
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package android.view;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.compat.annotation.UnsupportedAppUsage;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
@@ -67,7 +69,7 @@ public class ScaleGestureDetector {
|
||||
* only wants to update scaling factors if the change is
|
||||
* greater than 0.01.
|
||||
*/
|
||||
public boolean onScale(ScaleGestureDetector detector);
|
||||
public boolean onScale(@NonNull ScaleGestureDetector detector);
|
||||
|
||||
/**
|
||||
* Responds to the beginning of a scaling gesture. Reported by
|
||||
@@ -81,7 +83,7 @@ public class ScaleGestureDetector {
|
||||
* sense, onScaleBegin() may return false to ignore the
|
||||
* rest of the gesture.
|
||||
*/
|
||||
public boolean onScaleBegin(ScaleGestureDetector detector);
|
||||
public boolean onScaleBegin(@NonNull ScaleGestureDetector detector);
|
||||
|
||||
/**
|
||||
* Responds to the end of a scale gesture. Reported by existing
|
||||
@@ -94,7 +96,7 @@ public class ScaleGestureDetector {
|
||||
* @param detector The detector reporting the event - use this to
|
||||
* retrieve extended info about event state.
|
||||
*/
|
||||
public void onScaleEnd(ScaleGestureDetector detector);
|
||||
public void onScaleEnd(@NonNull ScaleGestureDetector detector);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,15 +111,15 @@ public class ScaleGestureDetector {
|
||||
*/
|
||||
public static class SimpleOnScaleGestureListener implements OnScaleGestureListener {
|
||||
|
||||
public boolean onScale(ScaleGestureDetector detector) {
|
||||
public boolean onScale(@NonNull ScaleGestureDetector detector) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean onScaleBegin(ScaleGestureDetector detector) {
|
||||
public boolean onScaleBegin(@NonNull ScaleGestureDetector detector) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void onScaleEnd(ScaleGestureDetector detector) {
|
||||
public void onScaleEnd(@NonNull ScaleGestureDetector detector) {
|
||||
// Intentionally empty
|
||||
}
|
||||
}
|
||||
@@ -180,7 +182,8 @@ public class ScaleGestureDetector {
|
||||
*
|
||||
* @throws NullPointerException if {@code listener} is null.
|
||||
*/
|
||||
public ScaleGestureDetector(Context context, OnScaleGestureListener listener) {
|
||||
public ScaleGestureDetector(@NonNull Context context,
|
||||
@NonNull OnScaleGestureListener listener) {
|
||||
this(context, listener, null);
|
||||
}
|
||||
|
||||
@@ -195,8 +198,8 @@ public class ScaleGestureDetector {
|
||||
*
|
||||
* @throws NullPointerException if {@code listener} is null.
|
||||
*/
|
||||
public ScaleGestureDetector(Context context, OnScaleGestureListener listener,
|
||||
Handler handler) {
|
||||
public ScaleGestureDetector(@NonNull Context context, @NonNull OnScaleGestureListener listener,
|
||||
@Nullable Handler handler) {
|
||||
mContext = context;
|
||||
mListener = listener;
|
||||
final ViewConfiguration viewConfiguration = ViewConfiguration.get(context);
|
||||
@@ -226,7 +229,7 @@ public class ScaleGestureDetector {
|
||||
* @return true if the event was processed and the detector wants to receive the
|
||||
* rest of the MotionEvents in this event stream.
|
||||
*/
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
public boolean onTouchEvent(@NonNull MotionEvent event) {
|
||||
if (mInputEventConsistencyVerifier != null) {
|
||||
mInputEventConsistencyVerifier.onTouchEvent(event, 0);
|
||||
}
|
||||
|
||||
@@ -8608,7 +8608,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public AccessibilityNodeInfo createAccessibilityNodeInfoInternal() {
|
||||
public @Nullable AccessibilityNodeInfo createAccessibilityNodeInfoInternal() {
|
||||
AccessibilityNodeProvider provider = getAccessibilityNodeProvider();
|
||||
if (provider != null) {
|
||||
return provider.createAccessibilityNodeInfo(AccessibilityNodeProvider.HOST_VIEW_ID);
|
||||
@@ -14226,7 +14226,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
* @param arguments Optional action arguments
|
||||
* @return true if the action was consumed by a parent
|
||||
*/
|
||||
public boolean dispatchNestedPrePerformAccessibilityAction(int action, Bundle arguments) {
|
||||
public boolean dispatchNestedPrePerformAccessibilityAction(int action,
|
||||
@Nullable Bundle arguments) {
|
||||
for (ViewParent p = getParent(); p != null; p = p.getParent()) {
|
||||
if (p.onNestedPrePerformAccessibilityAction(this, action, arguments)) {
|
||||
return true;
|
||||
@@ -14254,7 +14255,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
* @param arguments Optional action arguments.
|
||||
* @return Whether the action was performed.
|
||||
*/
|
||||
public boolean performAccessibilityAction(int action, Bundle arguments) {
|
||||
public boolean performAccessibilityAction(int action, @Nullable Bundle arguments) {
|
||||
if (mAccessibilityDelegate != null) {
|
||||
return mAccessibilityDelegate.performAccessibilityAction(this, action, arguments);
|
||||
} else {
|
||||
@@ -14270,7 +14271,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public boolean performAccessibilityActionInternal(int action, Bundle arguments) {
|
||||
public boolean performAccessibilityActionInternal(int action, @Nullable Bundle arguments) {
|
||||
if (isNestedScrollingEnabled()
|
||||
&& (action == AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD
|
||||
|| action == AccessibilityNodeInfo.ACTION_SCROLL_FORWARD
|
||||
@@ -29268,12 +29269,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
* Called when the view is attached to a window.
|
||||
* @param v The view that was attached
|
||||
*/
|
||||
public void onViewAttachedToWindow(View v);
|
||||
public void onViewAttachedToWindow(@NonNull View v);
|
||||
/**
|
||||
* Called when the view is detached from a window.
|
||||
* @param v The view that was detached
|
||||
*/
|
||||
public void onViewDetachedFromWindow(View v);
|
||||
public void onViewDetachedFromWindow(@NonNull View v);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -29298,7 +29299,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
* @param insets The insets to apply
|
||||
* @return The insets supplied, minus any insets that were consumed
|
||||
*/
|
||||
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets);
|
||||
public @NonNull WindowInsets onApplyWindowInsets(@NonNull View v,
|
||||
@NonNull WindowInsets insets);
|
||||
}
|
||||
|
||||
private final class UnsetPressedState implements Runnable {
|
||||
@@ -30241,7 +30243,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
*
|
||||
* @see View#sendAccessibilityEvent(int) View#sendAccessibilityEvent(int)
|
||||
*/
|
||||
public void sendAccessibilityEvent(View host, int eventType) {
|
||||
public void sendAccessibilityEvent(@NonNull View host, int eventType) {
|
||||
host.sendAccessibilityEventInternal(eventType);
|
||||
}
|
||||
|
||||
@@ -30261,7 +30263,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
* @see View#performAccessibilityAction(int, Bundle)
|
||||
* View#performAccessibilityAction(int, Bundle)
|
||||
*/
|
||||
public boolean performAccessibilityAction(View host, int action, Bundle args) {
|
||||
public boolean performAccessibilityAction(@NonNull View host, int action,
|
||||
@Nullable Bundle args) {
|
||||
return host.performAccessibilityActionInternal(action, args);
|
||||
}
|
||||
|
||||
@@ -30283,7 +30286,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
* @see View#sendAccessibilityEventUnchecked(AccessibilityEvent)
|
||||
* View#sendAccessibilityEventUnchecked(AccessibilityEvent)
|
||||
*/
|
||||
public void sendAccessibilityEventUnchecked(View host, AccessibilityEvent event) {
|
||||
public void sendAccessibilityEventUnchecked(@NonNull View host,
|
||||
@NonNull AccessibilityEvent event) {
|
||||
host.sendAccessibilityEventUncheckedInternal(event);
|
||||
}
|
||||
|
||||
@@ -30304,7 +30308,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
* @see View#dispatchPopulateAccessibilityEvent(AccessibilityEvent)
|
||||
* View#dispatchPopulateAccessibilityEvent(AccessibilityEvent)
|
||||
*/
|
||||
public boolean dispatchPopulateAccessibilityEvent(View host, AccessibilityEvent event) {
|
||||
public boolean dispatchPopulateAccessibilityEvent(@NonNull View host,
|
||||
@NonNull AccessibilityEvent event) {
|
||||
return host.dispatchPopulateAccessibilityEventInternal(event);
|
||||
}
|
||||
|
||||
@@ -30324,7 +30329,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
* @see View#onPopulateAccessibilityEvent(AccessibilityEvent)
|
||||
* View#onPopulateAccessibilityEvent(AccessibilityEvent)
|
||||
*/
|
||||
public void onPopulateAccessibilityEvent(View host, AccessibilityEvent event) {
|
||||
public void onPopulateAccessibilityEvent(@NonNull View host,
|
||||
@NonNull AccessibilityEvent event) {
|
||||
host.onPopulateAccessibilityEventInternal(event);
|
||||
}
|
||||
|
||||
@@ -30344,7 +30350,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
* @see View#onInitializeAccessibilityEvent(AccessibilityEvent)
|
||||
* View#onInitializeAccessibilityEvent(AccessibilityEvent)
|
||||
*/
|
||||
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
|
||||
public void onInitializeAccessibilityEvent(@NonNull View host,
|
||||
@NonNull AccessibilityEvent event) {
|
||||
host.onInitializeAccessibilityEventInternal(event);
|
||||
}
|
||||
|
||||
@@ -30363,7 +30370,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
* @see View#onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo)
|
||||
* View#onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo)
|
||||
*/
|
||||
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
|
||||
public void onInitializeAccessibilityNodeInfo(@NonNull View host,
|
||||
@NonNull AccessibilityNodeInfo info) {
|
||||
host.onInitializeAccessibilityNodeInfoInternal(info);
|
||||
}
|
||||
|
||||
@@ -30415,8 +30423,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
* @see ViewGroup#onRequestSendAccessibilityEvent(View, AccessibilityEvent)
|
||||
* ViewGroup#onRequestSendAccessibilityEvent(View, AccessibilityEvent)
|
||||
*/
|
||||
public boolean onRequestSendAccessibilityEvent(ViewGroup host, View child,
|
||||
AccessibilityEvent event) {
|
||||
public boolean onRequestSendAccessibilityEvent(@NonNull ViewGroup host, @NonNull View child,
|
||||
@NonNull AccessibilityEvent event) {
|
||||
return host.onRequestSendAccessibilityEventInternal(child, event);
|
||||
}
|
||||
|
||||
@@ -30434,7 +30442,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
*
|
||||
* @see AccessibilityNodeProvider
|
||||
*/
|
||||
public AccessibilityNodeProvider getAccessibilityNodeProvider(View host) {
|
||||
public @Nullable AccessibilityNodeProvider getAccessibilityNodeProvider(
|
||||
@NonNull View host) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -30462,7 +30471,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||
public AccessibilityNodeInfo createAccessibilityNodeInfo(View host) {
|
||||
public AccessibilityNodeInfo createAccessibilityNodeInfo(@NonNull View host) {
|
||||
return host.createAccessibilityNodeInfoInternal();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package android.view;
|
||||
|
||||
import android.annotation.FloatRange;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.TestApi;
|
||||
import android.annotation.UiContext;
|
||||
import android.app.Activity;
|
||||
@@ -405,7 +406,7 @@ public class ViewConfiguration {
|
||||
* @see #get(android.content.Context)
|
||||
* @see android.util.DisplayMetrics
|
||||
*/
|
||||
private ViewConfiguration(@UiContext Context context) {
|
||||
private ViewConfiguration(@NonNull @UiContext Context context) {
|
||||
mConstructedWithContext = true;
|
||||
final Resources res = context.getResources();
|
||||
final DisplayMetrics metrics = res.getDisplayMetrics();
|
||||
@@ -517,7 +518,7 @@ public class ViewConfiguration {
|
||||
* {@link Context#createWindowContext(int, Bundle)}.
|
||||
*/
|
||||
// TODO(b/182007470): Use @ConfigurationContext instead
|
||||
public static ViewConfiguration get(@UiContext Context context) {
|
||||
public static ViewConfiguration get(@NonNull @UiContext Context context) {
|
||||
StrictMode.assertConfigurationContext(context, "ViewConfiguration");
|
||||
|
||||
final DisplayMetrics metrics = context.getResources().getDisplayMetrics();
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package android.view;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.Region;
|
||||
import android.os.Bundle;
|
||||
@@ -298,7 +299,7 @@ public interface ViewParent {
|
||||
*
|
||||
* @param child The child whose drawable state has changed.
|
||||
*/
|
||||
public void childDrawableStateChanged(View child);
|
||||
public void childDrawableStateChanged(@NonNull View child);
|
||||
|
||||
/**
|
||||
* Called when a child does not want this parent and its ancestors to
|
||||
@@ -337,7 +338,7 @@ public interface ViewParent {
|
||||
* false otherwise
|
||||
* @return Whether the group scrolled to handle the operation
|
||||
*/
|
||||
public boolean requestChildRectangleOnScreen(View child, Rect rectangle,
|
||||
public boolean requestChildRectangleOnScreen(@NonNull View child, Rect rectangle,
|
||||
boolean immediate);
|
||||
|
||||
/**
|
||||
@@ -356,7 +357,7 @@ public interface ViewParent {
|
||||
* @param event The event to be sent.
|
||||
* @return True if the event was sent.
|
||||
*/
|
||||
public boolean requestSendAccessibilityEvent(View child, AccessibilityEvent event);
|
||||
public boolean requestSendAccessibilityEvent(@NonNull View child, AccessibilityEvent event);
|
||||
|
||||
/**
|
||||
* Called when a child view now has or no longer is tracking transient state.
|
||||
@@ -381,7 +382,7 @@ public interface ViewParent {
|
||||
* @param child Child view whose state has changed
|
||||
* @param hasTransientState true if this child has transient state
|
||||
*/
|
||||
public void childHasTransientStateChanged(View child, boolean hasTransientState);
|
||||
public void childHasTransientStateChanged(@NonNull View child, boolean hasTransientState);
|
||||
|
||||
/**
|
||||
* Ask that a new dispatch of {@link View#fitSystemWindows(Rect)
|
||||
@@ -418,7 +419,7 @@ public interface ViewParent {
|
||||
* </ul>
|
||||
*/
|
||||
public void notifySubtreeAccessibilityStateChanged(
|
||||
View child, @NonNull View source, int changeType);
|
||||
@NonNull View child, @NonNull View source, int changeType);
|
||||
|
||||
/**
|
||||
* Tells if this view parent can resolve the layout direction.
|
||||
@@ -525,7 +526,8 @@ public interface ViewParent {
|
||||
* {@link View#SCROLL_AXIS_VERTICAL} or both
|
||||
* @return true if this ViewParent accepts the nested scroll operation
|
||||
*/
|
||||
public boolean onStartNestedScroll(View child, View target, int nestedScrollAxes);
|
||||
public boolean onStartNestedScroll(@NonNull View child, @NonNull View target,
|
||||
int nestedScrollAxes);
|
||||
|
||||
/**
|
||||
* React to the successful claiming of a nested scroll operation.
|
||||
@@ -543,7 +545,8 @@ public interface ViewParent {
|
||||
* @see #onStartNestedScroll(View, View, int)
|
||||
* @see #onStopNestedScroll(View)
|
||||
*/
|
||||
public void onNestedScrollAccepted(View child, View target, int nestedScrollAxes);
|
||||
public void onNestedScrollAccepted(@NonNull View child, @NonNull View target,
|
||||
int nestedScrollAxes);
|
||||
|
||||
/**
|
||||
* React to a nested scroll operation ending.
|
||||
@@ -556,7 +559,7 @@ public interface ViewParent {
|
||||
*
|
||||
* @param target View that initiated the nested scroll
|
||||
*/
|
||||
public void onStopNestedScroll(View target);
|
||||
public void onStopNestedScroll(@NonNull View target);
|
||||
|
||||
/**
|
||||
* React to a nested scroll in progress.
|
||||
@@ -579,7 +582,7 @@ public interface ViewParent {
|
||||
* @param dxUnconsumed Horizontal scroll distance in pixels not consumed by target
|
||||
* @param dyUnconsumed Vertical scroll distance in pixels not consumed by target
|
||||
*/
|
||||
public void onNestedScroll(View target, int dxConsumed, int dyConsumed,
|
||||
public void onNestedScroll(@NonNull View target, int dxConsumed, int dyConsumed,
|
||||
int dxUnconsumed, int dyUnconsumed);
|
||||
|
||||
/**
|
||||
@@ -602,7 +605,7 @@ public interface ViewParent {
|
||||
* @param dy Vertical scroll distance in pixels
|
||||
* @param consumed Output. The horizontal and vertical scroll distance consumed by this parent
|
||||
*/
|
||||
public void onNestedPreScroll(View target, int dx, int dy, int[] consumed);
|
||||
public void onNestedPreScroll(@NonNull View target, int dx, int dy, @NonNull int[] consumed);
|
||||
|
||||
/**
|
||||
* Request a fling from a nested scroll.
|
||||
@@ -623,7 +626,8 @@ public interface ViewParent {
|
||||
* @param consumed true if the child consumed the fling, false otherwise
|
||||
* @return true if this parent consumed or otherwise reacted to the fling
|
||||
*/
|
||||
public boolean onNestedFling(View target, float velocityX, float velocityY, boolean consumed);
|
||||
public boolean onNestedFling(@NonNull View target, float velocityX, float velocityY,
|
||||
boolean consumed);
|
||||
|
||||
/**
|
||||
* React to a nested fling before the target view consumes it.
|
||||
@@ -645,7 +649,7 @@ public interface ViewParent {
|
||||
* @param velocityY Vertical velocity in pixels per second
|
||||
* @return true if this parent consumed the fling ahead of the target view
|
||||
*/
|
||||
public boolean onNestedPreFling(View target, float velocityX, float velocityY);
|
||||
public boolean onNestedPreFling(@NonNull View target, float velocityX, float velocityY);
|
||||
|
||||
/**
|
||||
* React to an accessibility action delegated by a target descendant view before the target
|
||||
@@ -664,7 +668,8 @@ public interface ViewParent {
|
||||
* @param arguments Optional action arguments
|
||||
* @return true if the action was consumed by this ViewParent
|
||||
*/
|
||||
public boolean onNestedPrePerformAccessibilityAction(View target, int action, Bundle arguments);
|
||||
public boolean onNestedPrePerformAccessibilityAction(@NonNull View target, int action,
|
||||
@Nullable Bundle arguments);
|
||||
|
||||
/**
|
||||
* Given a touchable region of a child, this method reduces region by the bounds of all views on
|
||||
|
||||
@@ -20,6 +20,8 @@ import android.animation.Animator;
|
||||
import android.animation.TimeInterpolator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.annotation.FloatRange;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.graphics.RenderNode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -246,7 +248,7 @@ public class ViewPropertyAnimator {
|
||||
*
|
||||
* @param view The View associated with this ViewPropertyAnimator
|
||||
*/
|
||||
ViewPropertyAnimator(View view) {
|
||||
ViewPropertyAnimator(@NonNull View view) {
|
||||
mView = view;
|
||||
view.ensureTransformationInfo();
|
||||
}
|
||||
@@ -259,7 +261,7 @@ public class ViewPropertyAnimator {
|
||||
* cannot be negative.
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator setDuration(long duration) {
|
||||
public @NonNull ViewPropertyAnimator setDuration(long duration) {
|
||||
if (duration < 0) {
|
||||
throw new IllegalArgumentException("Animators cannot have negative duration: " +
|
||||
duration);
|
||||
@@ -316,7 +318,7 @@ public class ViewPropertyAnimator {
|
||||
* cannot be negative.
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator setStartDelay(long startDelay) {
|
||||
public @NonNull ViewPropertyAnimator setStartDelay(long startDelay) {
|
||||
if (startDelay < 0) {
|
||||
throw new IllegalArgumentException("Animators cannot have negative start " +
|
||||
"delay: " + startDelay);
|
||||
@@ -335,7 +337,7 @@ public class ViewPropertyAnimator {
|
||||
* of <code>null</code> will result in linear interpolation.
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator setInterpolator(TimeInterpolator interpolator) {
|
||||
public @NonNull ViewPropertyAnimator setInterpolator(TimeInterpolator interpolator) {
|
||||
mInterpolatorSet = true;
|
||||
mInterpolator = interpolator;
|
||||
return this;
|
||||
@@ -346,7 +348,7 @@ public class ViewPropertyAnimator {
|
||||
*
|
||||
* @return The timing interpolator for this animation.
|
||||
*/
|
||||
public TimeInterpolator getInterpolator() {
|
||||
public @Nullable TimeInterpolator getInterpolator() {
|
||||
if (mInterpolatorSet) {
|
||||
return mInterpolator;
|
||||
} else {
|
||||
@@ -369,12 +371,12 @@ public class ViewPropertyAnimator {
|
||||
* <code>null</code> removes any existing listener.
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator setListener(Animator.AnimatorListener listener) {
|
||||
public @NonNull ViewPropertyAnimator setListener(@Nullable Animator.AnimatorListener listener) {
|
||||
mListener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
Animator.AnimatorListener getListener() {
|
||||
@Nullable Animator.AnimatorListener getListener() {
|
||||
return mListener;
|
||||
}
|
||||
|
||||
@@ -392,12 +394,13 @@ public class ViewPropertyAnimator {
|
||||
* <code>null</code> removes any existing listener.
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator setUpdateListener(ValueAnimator.AnimatorUpdateListener listener) {
|
||||
public @NonNull ViewPropertyAnimator setUpdateListener(
|
||||
@Nullable ValueAnimator.AnimatorUpdateListener listener) {
|
||||
mUpdateListener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
ValueAnimator.AnimatorUpdateListener getUpdateListener() {
|
||||
@Nullable ValueAnimator.AnimatorUpdateListener getUpdateListener() {
|
||||
return mUpdateListener;
|
||||
}
|
||||
|
||||
@@ -441,7 +444,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setX(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator x(float value) {
|
||||
public @NonNull ViewPropertyAnimator x(float value) {
|
||||
animateProperty(X, value);
|
||||
return this;
|
||||
}
|
||||
@@ -454,7 +457,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setX(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator xBy(float value) {
|
||||
public @NonNull ViewPropertyAnimator xBy(float value) {
|
||||
animatePropertyBy(X, value);
|
||||
return this;
|
||||
}
|
||||
@@ -467,7 +470,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setY(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator y(float value) {
|
||||
public @NonNull ViewPropertyAnimator y(float value) {
|
||||
animateProperty(Y, value);
|
||||
return this;
|
||||
}
|
||||
@@ -480,7 +483,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setY(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator yBy(float value) {
|
||||
public @NonNull ViewPropertyAnimator yBy(float value) {
|
||||
animatePropertyBy(Y, value);
|
||||
return this;
|
||||
}
|
||||
@@ -493,7 +496,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setZ(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator z(float value) {
|
||||
public @NonNull ViewPropertyAnimator z(float value) {
|
||||
animateProperty(Z, value);
|
||||
return this;
|
||||
}
|
||||
@@ -506,7 +509,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setZ(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator zBy(float value) {
|
||||
public @NonNull ViewPropertyAnimator zBy(float value) {
|
||||
animatePropertyBy(Z, value);
|
||||
return this;
|
||||
}
|
||||
@@ -519,7 +522,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setRotation(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator rotation(float value) {
|
||||
public @NonNull ViewPropertyAnimator rotation(float value) {
|
||||
animateProperty(ROTATION, value);
|
||||
return this;
|
||||
}
|
||||
@@ -532,7 +535,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setRotation(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator rotationBy(float value) {
|
||||
public @NonNull ViewPropertyAnimator rotationBy(float value) {
|
||||
animatePropertyBy(ROTATION, value);
|
||||
return this;
|
||||
}
|
||||
@@ -545,7 +548,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setRotationX(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator rotationX(float value) {
|
||||
public @NonNull ViewPropertyAnimator rotationX(float value) {
|
||||
animateProperty(ROTATION_X, value);
|
||||
return this;
|
||||
}
|
||||
@@ -558,7 +561,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setRotationX(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator rotationXBy(float value) {
|
||||
public @NonNull ViewPropertyAnimator rotationXBy(float value) {
|
||||
animatePropertyBy(ROTATION_X, value);
|
||||
return this;
|
||||
}
|
||||
@@ -571,7 +574,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setRotationY(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator rotationY(float value) {
|
||||
public @NonNull ViewPropertyAnimator rotationY(float value) {
|
||||
animateProperty(ROTATION_Y, value);
|
||||
return this;
|
||||
}
|
||||
@@ -584,7 +587,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setRotationY(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator rotationYBy(float value) {
|
||||
public @NonNull ViewPropertyAnimator rotationYBy(float value) {
|
||||
animatePropertyBy(ROTATION_Y, value);
|
||||
return this;
|
||||
}
|
||||
@@ -597,7 +600,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setTranslationX(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator translationX(float value) {
|
||||
public @NonNull ViewPropertyAnimator translationX(float value) {
|
||||
animateProperty(TRANSLATION_X, value);
|
||||
return this;
|
||||
}
|
||||
@@ -610,7 +613,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setTranslationX(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator translationXBy(float value) {
|
||||
public @NonNull ViewPropertyAnimator translationXBy(float value) {
|
||||
animatePropertyBy(TRANSLATION_X, value);
|
||||
return this;
|
||||
}
|
||||
@@ -623,7 +626,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setTranslationY(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator translationY(float value) {
|
||||
public @NonNull ViewPropertyAnimator translationY(float value) {
|
||||
animateProperty(TRANSLATION_Y, value);
|
||||
return this;
|
||||
}
|
||||
@@ -636,7 +639,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setTranslationY(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator translationYBy(float value) {
|
||||
public @NonNull ViewPropertyAnimator translationYBy(float value) {
|
||||
animatePropertyBy(TRANSLATION_Y, value);
|
||||
return this;
|
||||
}
|
||||
@@ -649,7 +652,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setTranslationZ(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator translationZ(float value) {
|
||||
public @NonNull ViewPropertyAnimator translationZ(float value) {
|
||||
animateProperty(TRANSLATION_Z, value);
|
||||
return this;
|
||||
}
|
||||
@@ -662,7 +665,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setTranslationZ(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator translationZBy(float value) {
|
||||
public @NonNull ViewPropertyAnimator translationZBy(float value) {
|
||||
animatePropertyBy(TRANSLATION_Z, value);
|
||||
return this;
|
||||
}
|
||||
@@ -674,7 +677,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setScaleX(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator scaleX(float value) {
|
||||
public @NonNull ViewPropertyAnimator scaleX(float value) {
|
||||
animateProperty(SCALE_X, value);
|
||||
return this;
|
||||
}
|
||||
@@ -687,7 +690,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setScaleX(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator scaleXBy(float value) {
|
||||
public @NonNull ViewPropertyAnimator scaleXBy(float value) {
|
||||
animatePropertyBy(SCALE_X, value);
|
||||
return this;
|
||||
}
|
||||
@@ -700,7 +703,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setScaleY(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator scaleY(float value) {
|
||||
public @NonNull ViewPropertyAnimator scaleY(float value) {
|
||||
animateProperty(SCALE_Y, value);
|
||||
return this;
|
||||
}
|
||||
@@ -713,7 +716,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setScaleY(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator scaleYBy(float value) {
|
||||
public @NonNull ViewPropertyAnimator scaleYBy(float value) {
|
||||
animatePropertyBy(SCALE_Y, value);
|
||||
return this;
|
||||
}
|
||||
@@ -726,7 +729,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setAlpha(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator alpha(@FloatRange(from = 0.0f, to = 1.0f) float value) {
|
||||
public @NonNull ViewPropertyAnimator alpha(@FloatRange(from = 0.0f, to = 1.0f) float value) {
|
||||
animateProperty(ALPHA, value);
|
||||
return this;
|
||||
}
|
||||
@@ -739,7 +742,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setAlpha(float)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator alphaBy(float value) {
|
||||
public @NonNull ViewPropertyAnimator alphaBy(float value) {
|
||||
animatePropertyBy(ALPHA, value);
|
||||
return this;
|
||||
}
|
||||
@@ -765,7 +768,7 @@ public class ViewPropertyAnimator {
|
||||
* @see View#setLayerType(int, android.graphics.Paint)
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator withLayer() {
|
||||
public @NonNull ViewPropertyAnimator withLayer() {
|
||||
mPendingSetupAction= new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -803,7 +806,7 @@ public class ViewPropertyAnimator {
|
||||
* @param runnable The action to run when the next animation starts.
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator withStartAction(Runnable runnable) {
|
||||
public @NonNull ViewPropertyAnimator withStartAction(Runnable runnable) {
|
||||
mPendingOnStartAction = runnable;
|
||||
if (runnable != null && mAnimatorOnStartMap == null) {
|
||||
mAnimatorOnStartMap = new HashMap<Animator, Runnable>();
|
||||
@@ -832,7 +835,7 @@ public class ViewPropertyAnimator {
|
||||
* @param runnable The action to run when the next animation ends.
|
||||
* @return This object, allowing calls to methods in this class to be chained.
|
||||
*/
|
||||
public ViewPropertyAnimator withEndAction(Runnable runnable) {
|
||||
public @NonNull ViewPropertyAnimator withEndAction(Runnable runnable) {
|
||||
mPendingOnEndAction = runnable;
|
||||
if (runnable != null && mAnimatorOnEndMap == null) {
|
||||
mAnimatorOnEndMap = new HashMap<Animator, Runnable>();
|
||||
@@ -1061,7 +1064,7 @@ public class ViewPropertyAnimator {
|
||||
private class AnimatorEventListener
|
||||
implements Animator.AnimatorListener, ValueAnimator.AnimatorUpdateListener {
|
||||
@Override
|
||||
public void onAnimationStart(Animator animation) {
|
||||
public void onAnimationStart(@NonNull Animator animation) {
|
||||
if (mAnimatorSetupMap != null) {
|
||||
Runnable r = mAnimatorSetupMap.get(animation);
|
||||
if (r != null) {
|
||||
@@ -1082,7 +1085,7 @@ public class ViewPropertyAnimator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationCancel(Animator animation) {
|
||||
public void onAnimationCancel(@NonNull Animator animation) {
|
||||
if (mListener != null) {
|
||||
mListener.onAnimationCancel(animation);
|
||||
}
|
||||
@@ -1092,14 +1095,14 @@ public class ViewPropertyAnimator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationRepeat(Animator animation) {
|
||||
public void onAnimationRepeat(@NonNull Animator animation) {
|
||||
if (mListener != null) {
|
||||
mListener.onAnimationRepeat(animation);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
public void onAnimationEnd(@NonNull Animator animation) {
|
||||
mView.setHasTransientState(false);
|
||||
if (mAnimatorCleanupMap != null) {
|
||||
Runnable r = mAnimatorCleanupMap.get(animation);
|
||||
@@ -1130,7 +1133,7 @@ public class ViewPropertyAnimator {
|
||||
* the current value of each property.
|
||||
*/
|
||||
@Override
|
||||
public void onAnimationUpdate(ValueAnimator animation) {
|
||||
public void onAnimationUpdate(@NonNull ValueAnimator animation) {
|
||||
PropertyBundle propertyBundle = mAnimatorMap.get(animation);
|
||||
if (propertyBundle == null) {
|
||||
// Shouldn't happen, but just to play it safe
|
||||
|
||||
@@ -526,9 +526,9 @@ public final class AccessibilityInteractionClient
|
||||
* @param prefetchFlags flags to guide prefetching.
|
||||
* @return An {@link AccessibilityNodeInfo} if found, null otherwise.
|
||||
*/
|
||||
public AccessibilityNodeInfo findAccessibilityNodeInfoByAccessibilityId(int connectionId,
|
||||
int accessibilityWindowId, long accessibilityNodeId, boolean bypassCache,
|
||||
int prefetchFlags, Bundle arguments) {
|
||||
public @Nullable AccessibilityNodeInfo findAccessibilityNodeInfoByAccessibilityId(
|
||||
int connectionId, int accessibilityWindowId, long accessibilityNodeId,
|
||||
boolean bypassCache, int prefetchFlags, Bundle arguments) {
|
||||
if ((prefetchFlags & AccessibilityNodeInfo.FLAG_PREFETCH_SIBLINGS) != 0
|
||||
&& (prefetchFlags & AccessibilityNodeInfo.FLAG_PREFETCH_PREDECESSORS) == 0) {
|
||||
throw new IllegalArgumentException("FLAG_PREFETCH_SIBLINGS"
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package android.view.accessibility;
|
||||
|
||||
import android.accessibilityservice.AccessibilityService;
|
||||
import android.annotation.Nullable;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
@@ -195,7 +196,7 @@ public abstract class AccessibilityNodeProvider {
|
||||
* @see View#createAccessibilityNodeInfo()
|
||||
* @see AccessibilityNodeInfo
|
||||
*/
|
||||
public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) {
|
||||
public @Nullable AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -234,7 +235,7 @@ public abstract class AccessibilityNodeProvider {
|
||||
* @see #createAccessibilityNodeInfo(int)
|
||||
* @see AccessibilityNodeInfo
|
||||
*/
|
||||
public boolean performAction(int virtualViewId, int action, Bundle arguments) {
|
||||
public boolean performAction(int virtualViewId, int action, @Nullable Bundle arguments) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -252,7 +253,7 @@ public abstract class AccessibilityNodeProvider {
|
||||
* @see #createAccessibilityNodeInfo(int)
|
||||
* @see AccessibilityNodeInfo
|
||||
*/
|
||||
public List<AccessibilityNodeInfo> findAccessibilityNodeInfosByText(String text,
|
||||
public @Nullable List<AccessibilityNodeInfo> findAccessibilityNodeInfosByText(String text,
|
||||
int virtualViewId) {
|
||||
return null;
|
||||
}
|
||||
@@ -268,7 +269,7 @@ public abstract class AccessibilityNodeProvider {
|
||||
* @see AccessibilityNodeInfo#FOCUS_INPUT
|
||||
* @see AccessibilityNodeInfo#FOCUS_ACCESSIBILITY
|
||||
*/
|
||||
public AccessibilityNodeInfo findFocus(int focus) {
|
||||
public @Nullable AccessibilityNodeInfo findFocus(int focus) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ public class AccessibilityRecord {
|
||||
*
|
||||
* @throws IllegalStateException If called from an AccessibilityService.
|
||||
*/
|
||||
public void setSource(View source) {
|
||||
public void setSource(@Nullable View source) {
|
||||
setSource(source, AccessibilityNodeProvider.HOST_VIEW_ID);
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ public class AccessibilityRecord {
|
||||
* </p>
|
||||
* @return The info of the source.
|
||||
*/
|
||||
public AccessibilityNodeInfo getSource() {
|
||||
public @Nullable AccessibilityNodeInfo getSource() {
|
||||
enforceSealed();
|
||||
if ((mConnectionId == UNDEFINED)
|
||||
|| (mSourceWindowId == AccessibilityWindowInfo.UNDEFINED_WINDOW_ID)
|
||||
@@ -629,7 +629,7 @@ public class AccessibilityRecord {
|
||||
*
|
||||
* @return The class name.
|
||||
*/
|
||||
public CharSequence getClassName() {
|
||||
public @Nullable CharSequence getClassName() {
|
||||
return mClassName;
|
||||
}
|
||||
|
||||
@@ -640,7 +640,7 @@ public class AccessibilityRecord {
|
||||
*
|
||||
* @throws IllegalStateException If called from an AccessibilityService.
|
||||
*/
|
||||
public void setClassName(CharSequence className) {
|
||||
public void setClassName(@Nullable CharSequence className) {
|
||||
enforceNotSealed();
|
||||
mClassName = className;
|
||||
}
|
||||
@@ -651,7 +651,7 @@ public class AccessibilityRecord {
|
||||
*
|
||||
* @return The text.
|
||||
*/
|
||||
public List<CharSequence> getText() {
|
||||
public @NonNull List<CharSequence> getText() {
|
||||
return mText;
|
||||
}
|
||||
|
||||
@@ -660,7 +660,7 @@ public class AccessibilityRecord {
|
||||
*
|
||||
* @return The text before the change.
|
||||
*/
|
||||
public CharSequence getBeforeText() {
|
||||
public @Nullable CharSequence getBeforeText() {
|
||||
return mBeforeText;
|
||||
}
|
||||
|
||||
@@ -671,7 +671,7 @@ public class AccessibilityRecord {
|
||||
*
|
||||
* @throws IllegalStateException If called from an AccessibilityService.
|
||||
*/
|
||||
public void setBeforeText(CharSequence beforeText) {
|
||||
public void setBeforeText(@Nullable CharSequence beforeText) {
|
||||
enforceNotSealed();
|
||||
mBeforeText = (beforeText == null) ? null
|
||||
: beforeText.subSequence(0, beforeText.length());
|
||||
@@ -682,7 +682,7 @@ public class AccessibilityRecord {
|
||||
*
|
||||
* @return The description.
|
||||
*/
|
||||
public CharSequence getContentDescription() {
|
||||
public @Nullable CharSequence getContentDescription() {
|
||||
return mContentDescription;
|
||||
}
|
||||
|
||||
@@ -693,7 +693,7 @@ public class AccessibilityRecord {
|
||||
*
|
||||
* @throws IllegalStateException If called from an AccessibilityService.
|
||||
*/
|
||||
public void setContentDescription(CharSequence contentDescription) {
|
||||
public void setContentDescription(@Nullable CharSequence contentDescription) {
|
||||
enforceNotSealed();
|
||||
mContentDescription = (contentDescription == null) ? null
|
||||
: contentDescription.subSequence(0, contentDescription.length());
|
||||
@@ -704,7 +704,7 @@ public class AccessibilityRecord {
|
||||
*
|
||||
* @return The parcelable data.
|
||||
*/
|
||||
public Parcelable getParcelableData() {
|
||||
public @Nullable Parcelable getParcelableData() {
|
||||
return mParcelableData;
|
||||
}
|
||||
|
||||
@@ -715,7 +715,7 @@ public class AccessibilityRecord {
|
||||
*
|
||||
* @throws IllegalStateException If called from an AccessibilityService.
|
||||
*/
|
||||
public void setParcelableData(Parcelable parcelableData) {
|
||||
public void setParcelableData(@Nullable Parcelable parcelableData) {
|
||||
enforceNotSealed();
|
||||
mParcelableData = parcelableData;
|
||||
}
|
||||
@@ -822,7 +822,7 @@ public class AccessibilityRecord {
|
||||
* @return An instance.
|
||||
*/
|
||||
@Deprecated
|
||||
public static AccessibilityRecord obtain(AccessibilityRecord record) {
|
||||
public static @NonNull AccessibilityRecord obtain(@NonNull AccessibilityRecord record) {
|
||||
AccessibilityRecord clone = AccessibilityRecord.obtain();
|
||||
clone.init(record);
|
||||
return clone;
|
||||
@@ -836,7 +836,7 @@ public class AccessibilityRecord {
|
||||
* @return An instance.
|
||||
*/
|
||||
@Deprecated
|
||||
public static AccessibilityRecord obtain() {
|
||||
public static @NonNull AccessibilityRecord obtain() {
|
||||
return new AccessibilityRecord();
|
||||
}
|
||||
|
||||
@@ -854,7 +854,7 @@ public class AccessibilityRecord {
|
||||
*
|
||||
* @param record The to initialize from.
|
||||
*/
|
||||
void init(AccessibilityRecord record) {
|
||||
void init(@NonNull AccessibilityRecord record) {
|
||||
mSealed = record.mSealed;
|
||||
mBooleanProperties = record.mBooleanProperties;
|
||||
mCurrentItemIndex = record.mCurrentItemIndex;
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package android.view.animation;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.Resources.Theme;
|
||||
@@ -61,7 +63,7 @@ public class PathInterpolator extends BaseInterpolator implements NativeInterpol
|
||||
*
|
||||
* @param path The <code>Path</code> to use to make the line representing the interpolator.
|
||||
*/
|
||||
public PathInterpolator(Path path) {
|
||||
public PathInterpolator(@NonNull Path path) {
|
||||
initPath(path);
|
||||
}
|
||||
|
||||
@@ -94,7 +96,7 @@ public class PathInterpolator extends BaseInterpolator implements NativeInterpol
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public PathInterpolator(Resources res, Theme theme, AttributeSet attrs) {
|
||||
public PathInterpolator(Resources res, @Nullable Theme theme, @NonNull AttributeSet attrs) {
|
||||
TypedArray a;
|
||||
if (theme != null) {
|
||||
a = theme.obtainStyledAttributes(attrs, R.styleable.PathInterpolator, 0, 0);
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.android.internal.view;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.view.View;
|
||||
import android.view.ViewTreeObserver;
|
||||
|
||||
@@ -36,7 +37,8 @@ public class OneShotPreDrawListener implements ViewTreeObserver.OnPreDrawListene
|
||||
private final Runnable mRunnable;
|
||||
private final boolean mReturnValue;
|
||||
|
||||
private OneShotPreDrawListener(View view, boolean returnValue, Runnable runnable) {
|
||||
private OneShotPreDrawListener(@NonNull View view, boolean returnValue,
|
||||
@NonNull Runnable runnable) {
|
||||
mView = view;
|
||||
mViewTreeObserver = view.getViewTreeObserver();
|
||||
mRunnable = runnable;
|
||||
@@ -52,7 +54,7 @@ public class OneShotPreDrawListener implements ViewTreeObserver.OnPreDrawListene
|
||||
* @return The added OneShotPreDrawListener. It can be removed prior to
|
||||
* the onPreDraw by calling {@link #removeListener()}.
|
||||
*/
|
||||
public static OneShotPreDrawListener add(View view, Runnable runnable) {
|
||||
public static OneShotPreDrawListener add(@NonNull View view, @NonNull Runnable runnable) {
|
||||
return add(view, true, runnable);
|
||||
}
|
||||
|
||||
@@ -65,7 +67,8 @@ public class OneShotPreDrawListener implements ViewTreeObserver.OnPreDrawListene
|
||||
* @return The added OneShotPreDrawListener. It can be removed prior to
|
||||
* the onPreDraw by calling {@link #removeListener()}.
|
||||
*/
|
||||
public static OneShotPreDrawListener add(View view, boolean returnValue, Runnable runnable) {
|
||||
public static OneShotPreDrawListener add(@NonNull View view, boolean returnValue,
|
||||
@NonNull Runnable runnable) {
|
||||
OneShotPreDrawListener listener = new OneShotPreDrawListener(view, returnValue, runnable);
|
||||
view.getViewTreeObserver().addOnPreDrawListener(listener);
|
||||
view.addOnAttachStateChangeListener(listener);
|
||||
@@ -93,12 +96,12 @@ public class OneShotPreDrawListener implements ViewTreeObserver.OnPreDrawListene
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewAttachedToWindow(View v) {
|
||||
public void onViewAttachedToWindow(@NonNull View v) {
|
||||
mViewTreeObserver = v.getViewTreeObserver();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewDetachedFromWindow(View v) {
|
||||
public void onViewDetachedFromWindow(@NonNull View v) {
|
||||
removeListener();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.internal.widget;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.VelocityTracker;
|
||||
import android.view.View;
|
||||
@@ -149,7 +150,7 @@ public interface NestedScrollingChild {
|
||||
* @see #dispatchNestedPreScroll(int, int, int[], int[])
|
||||
*/
|
||||
boolean dispatchNestedScroll(int dxConsumed, int dyConsumed,
|
||||
int dxUnconsumed, int dyUnconsumed, int[] offsetInWindow);
|
||||
int dxUnconsumed, int dyUnconsumed, @Nullable int[] offsetInWindow);
|
||||
|
||||
/**
|
||||
* Dispatch one step of a nested scroll in progress before this view consumes any portion of it.
|
||||
@@ -170,7 +171,8 @@ public interface NestedScrollingChild {
|
||||
* @return true if the parent consumed some or all of the scroll delta
|
||||
* @see #dispatchNestedScroll(int, int, int, int, int[])
|
||||
*/
|
||||
boolean dispatchNestedPreScroll(int dx, int dy, int[] consumed, int[] offsetInWindow);
|
||||
boolean dispatchNestedPreScroll(int dx, int dy, @Nullable int[] consumed,
|
||||
@Nullable int[] offsetInWindow);
|
||||
|
||||
/**
|
||||
* Dispatch a fling to a nested scrolling parent.
|
||||
|
||||
Reference in New Issue
Block a user