> Documentation index: https://developer.android.com/reference/llms.txt

# LocationButton

Artifact: [androidx.core.locationbutton:locationbutton](https://developer.android.com/jetpack/androidx/releases/core-locationbutton.md.txt) [View Source](https://cs.android.com/search?q=file:androidx/core/locationbutton/LocationButton.kt+class:androidx.core.locationbutton.LocationButton) Added in [1.0.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core-locationbutton.md.txt#1.0.0-alpha01)

*** ** * ** ***


```
public final class LocationButton extends ViewGroup
```

<br />

|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.md.txt) ||||
| ↳ | [android.view.View](https://developer.android.com/reference/android/view/View.md.txt) |||
|   | ↳ | [android.view.ViewGroup](https://developer.android.com/reference/android/view/ViewGroup.md.txt) ||
|   |   | ↳ | [androidx.core.locationbutton.LocationButton](https://developer.android.com/reference/androidx/core/locationbutton/LocationButton.md.txt) |

*** ** * ** ***

A widget that provides a session-based precise location permission button. It either draws the button remotely rendered by the system on `Build.VERSION_CODES.CINNAMON_BUN` and above platforms, or falls back to a locally rendered button on platforms before `Build.VERSION_CODES.CINNAMON_BUN`.

On platforms before `Build.VERSION_CODES.CINNAMON_BUN`, the button click delegates to `OnRequestPermissionsListener` if provided, allowing the app to handle the click manually (e.g., by requesting permissions or displaying rationale). If no custom listener is provided, the library automatically requests location permissions.

## Summary

| ### Constants |
|---|---|
| `static final int` | `TEXT_TYPE_NEAR_MY_PRECISE_LOCATION` |
| `static final int` | `TEXT_TYPE_NEAR_YOUR_PRECISE_LOCATION` |
| `static final int` | `TEXT_TYPE_NONE` |
| `static final int` | `TEXT_TYPE_PRECISE_LOCATION` |
| `static final int` | `TEXT_TYPE_SHARE_PRECISE_LOCATION` |
| `static final int` | `TEXT_TYPE_USE_PRECISE_LOCATION` |

| ### Public constructors |
|---|
| `LocationButton( @NonNull Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes )` |

| ### Public methods |
|---|---|
| `void` | `addView(View child)` |
| `void` | `addView(View child, int index)` |
| `void` | `addView(View child, ViewGroup.LayoutParams params)` |
| `void` | `addView(View child, int index, ViewGroup.LayoutParams params)` |
| `void` | `addView(View child, int width, int height)` |
| `final int` | `getCompositionOrder()` Gets the composition order of the underlying SurfaceView. |
| `final Activity` | `getParentActivity()` The `Activity` that hosts this button. |
| `void` | `setBackgroundColor(int color)` |
| `final void` | `setCompositionOrder(int order)` Controls the composition order of the underlying SurfaceView. |
| `final void` | `setCornerRadius(float radius)` Sets the corner radius of the button background. |
| `final void` | `setIconTint(int color)` Sets the color tint applied to the location icon. |
| `final void` | `setOnErrorListener(OnErrorListener listener)` Sets the listener to receive remote session errors on `Build.VERSION_CODES.CINNAMON_BUN` and above platforms. |
| `final void` | `setOnPermissionResultListener(OnPermissionResultListener listener)` Sets the listener to receive permission results. |
| `final void` | `setOnRequestPermissionsListener(OnRequestPermissionsListener listener)` Sets the listener to handle permission requests on platforms before `Build.VERSION_CODES.CINNAMON_BUN`. |
| `void` | `setPadding(int left, int top, int right, int bottom)` |
| `void` | `setPaddingRelative(int start, int top, int end, int bottom)` |
| `final void` | `setParentActivity(Activity value)` The `Activity` that hosts this button. |
| `final void` | `setPressedCornerRadius(float radius)` Sets the corner radius of the button background when the user presses it. |
| `final void` | `setStrokeColor(int color)` Sets the width of the button's outer stroke border. |
| `final void` | `setStrokeWidth(int strokeWidth)` Sets the width of the button's outer stroke border. |
| `final void` | `setTextColor(int color)` Sets the color of the text displayed inside the button. |
| `final void` | `setTextType(int textType)` Sets the text content displayed inside the button. |

| ### Protected methods |
|---|---|
| `boolean` | `addViewInLayout(View child, int index, ViewGroup.LayoutParams params)` |
| `void` | `onAttachedToWindow()` |
| `void` | `onConfigurationChanged(Configuration newConfig)` |
| `void` | `onDetachedFromWindow()` |
| `void` | `onLayout(boolean changed, int left, int top, int right, int bottom)` |
| `void` | `onMeasure(int widthMeasureSpec, int heightMeasureSpec)` |
| `void` | `onSizeChanged(int w, int h, int oldw, int oldh)` |

| ### Extension functions |
|---|---|
| `final void` | `@RequiresApi(value = 37) LocationButtonCompat.setLocationButtonProvider( @NonNull LocationButton receiver, LocationButtonProvider provider )` Sets the `LocationButtonProvider` to provide a location button. |

### Inherited methods

From [android.view.View](https://developer.android.com/reference/android/view/View.md.txt) `void` `addFocusables(@NonNull ArrayList<@NonNull View> views, int direction)` `void` `addOnAttachStateChangeListener(
@NonNull View.OnAttachStateChangeListener listener
)` `void` `addOnLayoutChangeListener(@NonNull View.OnLayoutChangeListener listener)` `void` `addOnUnhandledKeyEventListener(
@NonNull View.OnUnhandledKeyEventListener listener
)` `@NonNull ViewPropertyAnimator` `animate()` `void` `announceForAccessibility(@NonNull CharSequence text)` `void` `autofill(@NonNull AutofillValue value)` `void` `autofill(@NonNull SparseArray<@NonNull AutofillValue> values)` `boolean` `awakenScrollBars()` `boolean` `awakenScrollBars(int startDelay)` `boolean` `awakenScrollBars(int startDelay, boolean invalidate)` `void` `bringToFront()` `void` `buildDrawingCache()` `void` `buildDrawingCache(boolean autoScale)` `void` `buildLayer()` `boolean` `callOnClick()` `boolean` `canResolveLayoutDirection()` `boolean` `canResolveTextAlignment()` `boolean` `canResolveTextDirection()` `boolean` `canScrollHorizontally(int direction)` `boolean` `canScrollVertically(int direction)` `final void` `cancelDragAndDrop()` `void` `cancelLongPress()` `final void` `cancelPendingInputEvents()` `boolean` `checkInputConnectionProxy(@NonNull View view)` `void` `clearAnimation()` `void` `clearPendingCredentialRequest()` `void` `clearViewTranslationCallback()` `int` `computeHorizontalScrollExtent()` `int` `computeHorizontalScrollOffset()` `int` `computeHorizontalScrollRange()` `void` `computeScroll()` `@NonNull WindowInsets` `computeSystemWindowInsets(
@NonNull WindowInsets in,
@NonNull Rect outLocalInsets
)` `int` `computeVerticalScrollExtent()` `int` `computeVerticalScrollOffset()` `int` `computeVerticalScrollRange()` `@NonNull AccessibilityNodeInfo` `createAccessibilityNodeInfo()` `void` `createContextMenu(@NonNull ContextMenu menu)` `void` `destroyDrawingCache()` `boolean` `dispatchGenericMotionEvent(@NonNull MotionEvent event)` `boolean` `dispatchNestedFling(float velocityX, float velocityY, boolean consumed)` `boolean` `dispatchNestedPreFling(float velocityX, float velocityY)` `boolean` `dispatchNestedPrePerformAccessibilityAction(
int action,
Bundle arguments
)` `boolean` `dispatchNestedPreScroll(
int dx,
int dy,
int[] consumed,
int[] offsetInWindow
)` `boolean` `dispatchNestedScroll(
int dxConsumed,
int dyConsumed,
int dxUnconsumed,
int dyUnconsumed,
int[] offsetInWindow
)` `boolean` `dispatchPopulateAccessibilityEvent(@NonNull AccessibilityEvent event)` `void` `draw(@NonNull Canvas canvas)` `void` `drawableHotspotChanged(float x, float y)` `final OnBackInvokedDispatcher` `findOnBackInvokedDispatcher()` `final @NonNull T` `<T extends View> findViewById(int id)` `final @NonNull T` `<T extends View> findViewWithTag(@NonNull Object tag)` `boolean` `fitSystemWindows(@NonNull Rect insets)` `@NonNull View` `focusSearch(int direction)` `void` `forceHasOverlappingRendering(boolean hasOverlappingRendering)` `void` `forceLayout()` `void` `generateDisplayHash(
@NonNull String hashAlgorithm,
Rect bounds,
@NonNull Executor executor,
@NonNull DisplayHashResultCallback callback
)` `@NonNull View.AccessibilityDelegate` `getAccessibilityDelegate()` `int` `getAccessibilityLiveRegion()` `@NonNull AccessibilityNodeProvider` `getAccessibilityNodeProvider()` `@Nullable CharSequence` `getAccessibilityPaneTitle()` `int` `getAccessibilityTraversalAfter()` `int` `getAccessibilityTraversalBefore()` `@Nullable String` `getAllowedHandwritingDelegatePackageName()` `@Nullable String` `getAllowedHandwritingDelegatorPackageName()` `float` `@ViewDebug.ExportedProperty(category = "drawing")
getAlpha()` `@NonNull Animation` `getAnimation()` `@Nullable Matrix` `getAnimationMatrix()` `@NonNull IBinder` `getApplicationWindowToken()` `@NonNull int[]` `getAttributeResolutionStack(int attribute)` `@NonNull Map<@NonNull Integer, @NonNull Integer>` `getAttributeSourceResourceMap()` `@Nullable String[]` `@ViewDebug.ExportedProperty
getAutofillHints()` `final @NonNull AutofillId` `getAutofillId()` `int` `getAutofillType()` `@Nullable AutofillValue` `getAutofillValue()` `@NonNull Drawable` `getBackground()` `@Nullable BlendMode` `getBackgroundTintBlendMode()` `@Nullable ColorStateList` `getBackgroundTintList()` `@Nullable PorterDuff.Mode` `getBackgroundTintMode()` `int` `@ViewDebug.ExportedProperty(category = "layout")
getBaseline()` `final int` `@ViewDebug.CapturedViewProperty
getBottom()` `float` `getBottomFadingEdgeStrength()` `int` `getBottomPaddingOffset()` `float` `getCameraDistance()` `@NonNull Rect` `getClipBounds()` `boolean` `getClipBounds(@NonNull Rect outRect)` `final boolean` `getClipToOutline()` `final @Nullable ContentCaptureSession` `getContentCaptureSession()` `@NonNull CharSequence` `@ViewDebug.ExportedProperty(category = "accessibility")
getContentDescription()` `final int` `getContentSensitivity()` `final @NonNull Context` `@ViewDebug.CapturedViewProperty
getContext()` `@NonNull ContextMenu.ContextMenuInfo` `getContextMenuInfo()` `final boolean` `@ViewDebug.ExportedProperty(category = "focus")
getDefaultFocusHighlightEnabled()` `@NonNull Display` `getDisplay()` `final @NonNull int[]` `getDrawableState()` `@NonNull Bitmap` `[getDrawingCache](https://developer.android.com/reference/android/view/View.md.txt#getDrawingCache())()`

**This method is deprecated.** Deprecated in Java
`@NonNull Bitmap` `getDrawingCache(boolean autoScale)` `int` `[getDrawingCacheBackgroundColor](https://developer.android.com/reference/android/view/View.html#getDrawingCacheBackgroundColor())()`

**This method is deprecated.** Deprecated in Java
`int` `[getDrawingCacheQuality](https://developer.android.com/reference/android/view/View.html#getDrawingCacheQuality())()`

**This method is deprecated.** Deprecated in Java
`void` `getDrawingRect(@NonNull Rect outRect)` `long` `getDrawingTime()` `float` `@ViewDebug.ExportedProperty(category = "drawing")
getElevation()` `int` `getExplicitStyle()` `boolean` `@ViewDebug.ExportedProperty
getFilterTouchesWhenObscured()` `boolean` `@ViewDebug.ExportedProperty
getFitsSystemWindows()` `int` `@ViewDebug.ExportedProperty(category = "focus", mapping = [@ViewDebug.IntToString(from = 0, to = "NOT_FOCUSABLE"), @ViewDebug.IntToString(from = 1, to = "FOCUSABLE"), @ViewDebug.IntToString(from = 16, to = "FOCUSABLE_AUTO")])
getFocusable()` `@NonNull ArrayList<@NonNull View>` `getFocusables(int direction)` `void` `getFocusedRect(@NonNull Rect r)` `@NonNull Drawable` `getForeground()` `int` `getForegroundGravity()` `@Nullable BlendMode` `getForegroundTintBlendMode()` `@Nullable ColorStateList` `getForegroundTintList()` `@Nullable PorterDuff.Mode` `getForegroundTintMode()` `float` `getFrameContentVelocity()` `final boolean` `getGlobalVisibleRect(@NonNull Rect r)` `boolean` `getGlobalVisibleRect(@NonNull Rect r, @NonNull Point globalOffset)` `@NonNull Handler` `getHandler()` `float` `getHandwritingBoundsOffsetBottom()` `float` `getHandwritingBoundsOffsetLeft()` `float` `getHandwritingBoundsOffsetRight()` `float` `getHandwritingBoundsOffsetTop()` `int` `getHandwritingDelegateFlags()` `@Nullable Runnable` `getHandwritingDelegatorCallback()` `final boolean` `getHasOverlappingRendering()` `final int` `@ViewDebug.ExportedProperty(category = "layout")
getHeight()` `void` `getHitRect(@NonNull Rect outRect)` `int` `getHorizontalFadingEdgeLength()` `int` `getHorizontalScrollbarHeight()` `@Nullable Drawable` `getHorizontalScrollbarThumbDrawable()` `@Nullable Drawable` `getHorizontalScrollbarTrackDrawable()` `int` `@ViewDebug.CapturedViewProperty
getId()` `int` `@ViewDebug.ExportedProperty(category = "accessibility", mapping = [@ViewDebug.IntToString(from = 0, to = "auto"), @ViewDebug.IntToString(from = 1, to = "yes"), @ViewDebug.IntToString(from = 2, to = "no"), @ViewDebug.IntToString(from = 4, to = "noHideDescendants")])
getImportantForAccessibility()` `int` `@ViewDebug.ExportedProperty(mapping = [@ViewDebug.IntToString(from = 0, to = "auto"), @ViewDebug.IntToString(from = 1, to = "yes"), @ViewDebug.IntToString(from = 2, to = "no"), @ViewDebug.IntToString(from = 4, to = "yesExcludeDescendants"), @ViewDebug.IntToString(from = 8, to = "noExcludeDescendants")])
getImportantForAutofill()` `int` `@ViewDebug.ExportedProperty(mapping = [@ViewDebug.IntToString(from = 0, to = "auto"), @ViewDebug.IntToString(from = 1, to = "yes"), @ViewDebug.IntToString(from = 2, to = "no"), @ViewDebug.IntToString(from = 4, to = "yesExcludeDescendants"), @ViewDebug.IntToString(from = 8, to = "noExcludeDescendants")])
getImportantForContentCapture()` `boolean` `getKeepScreenOn()` `@NonNull KeyEvent.DispatcherState` `getKeyDispatcherState()` `int` `@ViewDebug.ExportedProperty(category = "accessibility")
getLabelFor()` `int` `@ViewDebug.ExportedProperty(category = "drawing", mapping = [@ViewDebug.IntToString(from = 0, to = "NONE"), @ViewDebug.IntToString(from = 1, to = "SOFTWARE"), @ViewDebug.IntToString(from = 2, to = "HARDWARE")])
getLayerType()` `int` `@ViewDebug.ExportedProperty(category = "layout", mapping = [@ViewDebug.IntToString(from = 0, to = "RESOLVED_DIRECTION_LTR"), @ViewDebug.IntToString(from = 1, to = "RESOLVED_DIRECTION_RTL")])
getLayoutDirection()` `@NonNull ViewGroup.LayoutParams` `@ViewDebug.ExportedProperty(deepExport = true, prefix = "layout_")
getLayoutParams()` `final int` `@ViewDebug.CapturedViewProperty
getLeft()` `float` `getLeftFadingEdgeStrength()` `int` `getLeftPaddingOffset()` `final boolean` `getLocalVisibleRect(@NonNull Rect r)` `void` `getLocationInSurface(@NonNull int[] location)` `void` `getLocationInWindow(@NonNull int[] outLocation)` `void` `getLocationOnScreen(@NonNull int[] outLocation)` `@NonNull Matrix` `getMatrix()` `final int` `getMeasuredHeight()` `final int` `@ViewDebug.ExportedProperty(category = "measurement", flagMapping = [@ViewDebug.FlagToString(equals = 16777216, mask = -16777216, name = "MEASURED_STATE_TOO_SMALL")])
getMeasuredHeightAndState()` `final int` `getMeasuredState()` `final int` `getMeasuredWidth()` `final int` `@ViewDebug.ExportedProperty(category = "measurement", flagMapping = [@ViewDebug.FlagToString(equals = 16777216, mask = -16777216, name = "MEASURED_STATE_TOO_SMALL")])
getMeasuredWidthAndState()` `int` `getMinimumHeight()` `int` `getMinimumWidth()` `int` `getNextClusterForwardId()` `int` `getNextFocusDownId()` `int` `getNextFocusForwardId()` `int` `getNextFocusLeftId()` `int` `getNextFocusRightId()` `int` `getNextFocusUpId()` `@NonNull View.OnFocusChangeListener` `getOnFocusChangeListener()` `int` `getOutlineAmbientShadowColor()` `@NonNull ViewOutlineProvider` `getOutlineProvider()` `int` `getOutlineSpotShadowColor()` `int` `getOverScrollMode()` `int` `getPaddingBottom()` `int` `getPaddingEnd()` `int` `getPaddingLeft()` `int` `getPaddingRight()` `int` `getPaddingStart()` `int` `getPaddingTop()` `final @NonNull ViewParent` `getParent()` `@NonNull ViewParent` `getParentForAccessibility()` `final @Nullable OutcomeReceiver<@NonNull GetCredentialResponse, @NonNull GetCredentialException>` `getPendingCredentialCallback()` `final @Nullable GetCredentialRequest` `getPendingCredentialRequest()` `float` `@ViewDebug.ExportedProperty(category = "drawing")
getPivotX()` `float` `@ViewDebug.ExportedProperty(category = "drawing")
getPivotY()` `@NonNull PointerIcon` `getPointerIcon()` `final @NonNull List<@NonNull Rect>` `getPreferKeepClearRects()` `@Nullable String[]` `getReceiveContentMimeTypes()` `float` `getRequestedFrameRate()` `@NonNull Resources` `getResources()` `final boolean` `getRevealOnFocusHint()` `final int` `@ViewDebug.CapturedViewProperty
getRight()` `float` `getRightFadingEdgeStrength()` `int` `getRightPaddingOffset()` `@Nullable AttachedSurfaceControl` `getRootSurfaceControl()` `@NonNull View` `getRootView()` `@NonNull WindowInsets` `getRootWindowInsets()` `float` `@ViewDebug.ExportedProperty(category = "drawing")
getRotation()` `float` `@ViewDebug.ExportedProperty(category = "drawing")
getRotationX()` `float` `@ViewDebug.ExportedProperty(category = "drawing")
getRotationY()` `float` `@ViewDebug.ExportedProperty(category = "drawing")
getScaleX()` `float` `@ViewDebug.ExportedProperty(category = "drawing")
getScaleY()` `int` `getScrollBarDefaultDelayBeforeFade()` `int` `getScrollBarFadeDuration()` `int` `getScrollBarSize()` `int` `@ViewDebug.ExportedProperty(mapping = [@ViewDebug.IntToString(from = 0, to = "INSIDE_OVERLAY"), @ViewDebug.IntToString(from = 16777216, to = "INSIDE_INSET"), @ViewDebug.IntToString(from = 33554432, to = "OUTSIDE_OVERLAY"), @ViewDebug.IntToString(from = 50331648, to = "OUTSIDE_INSET")])
getScrollBarStyle()` `int` `getScrollCaptureHint()` `int` `getScrollIndicators()` `final int` `getScrollX()` `final int` `getScrollY()` `int` `@ViewDebug.ExportedProperty(category = "drawing")
getSolidColor()` `int` `getSourceLayoutResId()` `final @Nullable CharSequence` `@ViewDebug.ExportedProperty(category = "accessibility")
getStateDescription()` `@NonNull StateListAnimator` `getStateListAnimator()` `int` `getSuggestedMinimumHeight()` `int` `getSuggestedMinimumWidth()` `@Nullable CharSequence` `@ViewDebug.ExportedProperty(category = "accessibility")
getSupplementalDescription()` `@NonNull List<@NonNull Rect>` `getSystemGestureExclusionRects()` `int` `[getSystemUiVisibility](https://developer.android.com/reference/android/view/View.md.txt#getSystemUiVisibility())()`

**This method is deprecated.** Deprecated in Java
`@NonNull Object` `@ViewDebug.ExportedProperty
getTag()` `@NonNull Object` `getTag(int key)` `int` `@ViewDebug.ExportedProperty(category = "text", mapping = [@ViewDebug.IntToString(from = 0, to = "INHERIT"), @ViewDebug.IntToString(from = 1, to = "GRAVITY"), @ViewDebug.IntToString(from = 2, to = "TEXT_START"), @ViewDebug.IntToString(from = 3, to = "TEXT_END"), @ViewDebug.IntToString(from = 4, to = "CENTER"), @ViewDebug.IntToString(from = 5, to = "VIEW_START"), @ViewDebug.IntToString(from = 6, to = "VIEW_END")])
getTextAlignment()` `int` `@ViewDebug.ExportedProperty(category = "text", mapping = [@ViewDebug.IntToString(from = 0, to = "INHERIT"), @ViewDebug.IntToString(from = 1, to = "FIRST_STRONG"), @ViewDebug.IntToString(from = 2, to = "ANY_RTL"), @ViewDebug.IntToString(from = 3, to = "LTR"), @ViewDebug.IntToString(from = 4, to = "RTL"), @ViewDebug.IntToString(from = 5, to = "LOCALE"), @ViewDebug.IntToString(from = 6, to = "FIRST_STRONG_LTR"), @ViewDebug.IntToString(from = 7, to = "FIRST_STRONG_RTL")])
getTextDirection()` `@Nullable CharSequence` `getTooltipText()` `final int` `@ViewDebug.CapturedViewProperty
getTop()` `float` `getTopFadingEdgeStrength()` `int` `getTopPaddingOffset()` `@NonNull TouchDelegate` `getTouchDelegate()` `@NonNull ArrayList<@NonNull View>` `getTouchables()` `float` `@ViewDebug.ExportedProperty(category = "drawing")
getTransitionAlpha()` `@NonNull String` `@ViewDebug.ExportedProperty
getTransitionName()` `float` `@ViewDebug.ExportedProperty(category = "drawing")
getTranslationX()` `float` `@ViewDebug.ExportedProperty(category = "drawing")
getTranslationY()` `float` `@ViewDebug.ExportedProperty(category = "drawing")
getTranslationZ()` `long` `getUniqueDrawingId()` `int` `getVerticalFadingEdgeLength()` `int` `getVerticalScrollbarPosition()` `@Nullable Drawable` `getVerticalScrollbarThumbDrawable()` `@Nullable Drawable` `getVerticalScrollbarTrackDrawable()` `int` `getVerticalScrollbarWidth()` `@Nullable ViewTranslationResponse` `getViewTranslationResponse()` `@NonNull ViewTreeObserver` `getViewTreeObserver()` `int` `@ViewDebug.ExportedProperty(mapping = [@ViewDebug.IntToString(from = 0, to = "VISIBLE"), @ViewDebug.IntToString(from = 4, to = "INVISIBLE"), @ViewDebug.IntToString(from = 8, to = "GONE")])
getVisibility()` `final int` `@ViewDebug.ExportedProperty(category = "layout")
getWidth()` `int` `getWindowAttachCount()` `@NonNull WindowId` `getWindowId()` `@Nullable WindowInsetsController` `getWindowInsetsController()` `int` `[getWindowSystemUiVisibility](https://developer.android.com/reference/android/view/View.md.txt#getWindowSystemUiVisibility())()`

**This method is deprecated.** Deprecated in Java
`@NonNull IBinder` `getWindowToken()` `int` `getWindowVisibility()` `void` `getWindowVisibleDisplayFrame(@NonNull Rect outRect)` `float` `@ViewDebug.ExportedProperty(category = "drawing")
getX()` `float` `@ViewDebug.ExportedProperty(category = "drawing")
getY()` `float` `@ViewDebug.ExportedProperty(category = "drawing")
getZ()` `boolean` `hasExplicitFocusable()` `boolean` `hasFocusable()` `boolean` `hasNestedScrollingParent()` `boolean` `hasOnClickListeners()` `boolean` `hasOnLongClickListeners()` `boolean` `hasOverlappingRendering()` `boolean` `hasPointerCapture()` `boolean` `hasWindowFocus()` `void` `invalidate()` `void` `invalidate(@NonNull Rect dirty)` `void` `invalidate(int l, int t, int r, int b)` `void` `invalidateDrawable(@NonNull Drawable drawable)` `void` `invalidateOutline()` `boolean` `@ViewDebug.ExportedProperty(category = "accessibility")
isAccessibilityDataSensitive()` `boolean` `isAccessibilityFocused()` `boolean` `isAccessibilityHeading()` `boolean` `@ViewDebug.ExportedProperty
isActivated()` `boolean` `isAttachedToWindow()` `boolean` `isAutoHandwritingEnabled()` `boolean` `@ViewDebug.ExportedProperty
isClickable()` `boolean` `isContentCaptureSelfReportingEnabled()` `final boolean` `isContentSensitive()` `boolean` `isContextClickable()` `boolean` `[isCredential](https://developer.android.com/reference/android/view/View.md.txt#isCredential())()`

**This method is deprecated.** Deprecated in Java
`boolean` `isDirty()` `boolean` `@ViewDebug.ExportedProperty(category = "drawing")
[isDrawingCacheEnabled](https://developer.android.com/reference/android/view/View.md.txt#isDrawingCacheEnabled())()`

**This method is deprecated.** Deprecated in Java
`boolean` `isDuplicateParentStateEnabled()` `boolean` `@ViewDebug.ExportedProperty
isEnabled()` `final boolean` `@ViewDebug.ExportedProperty(category = "focus")
isFocusable()` `final boolean` `@ViewDebug.ExportedProperty(category = "focus")
isFocusableInTouchMode()` `boolean` `@ViewDebug.ExportedProperty(category = "focus")
isFocused()` `final boolean` `@ViewDebug.ExportedProperty(category = "focus")
isFocusedByDefault()` `boolean` `@ViewDebug.ExportedProperty(category = "drawing")
isForceDarkAllowed()` `boolean` `isHandwritingDelegate()` `boolean` `@ViewDebug.ExportedProperty
isHapticFeedbackEnabled()` `boolean` `@ViewDebug.ExportedProperty(category = "drawing")
isHardwareAccelerated()` `boolean` `isHorizontalFadingEdgeEnabled()` `boolean` `isHorizontalScrollBarEnabled()` `boolean` `@ViewDebug.ExportedProperty
isHovered()` `boolean` `isImportantForAccessibility()` `final boolean` `isImportantForAutofill()` `final boolean` `isImportantForContentCapture()` `boolean` `isInEditMode()` `boolean` `isInLayout()` `boolean` `@ViewDebug.ExportedProperty
isInTouchMode()` `final boolean` `@ViewDebug.ExportedProperty(category = "focus")
isKeyboardNavigationCluster()` `boolean` `isLaidOut()` `boolean` `isLayoutDirectionResolved()` `boolean` `isLayoutRequested()` `boolean` `isLongClickable()` `boolean` `isNestedScrollingEnabled()` `boolean` `@ViewDebug.ExportedProperty(category = "drawing")
isOpaque()` `boolean` `isPaddingOffsetRequired()` `boolean` `isPaddingRelative()` `boolean` `isPivotSet()` `final boolean` `isPreferKeepClear()` `boolean` `@ViewDebug.ExportedProperty
isPressed()` `boolean` `isSaveEnabled()` `boolean` `isSaveFromParentEnabled()` `boolean` `isScreenReaderFocusable()` `boolean` `isScrollContainer()` `boolean` `isScrollbarFadingEnabled()` `boolean` `@ViewDebug.ExportedProperty
isSelected()` `final boolean` `isShowingLayoutBounds()` `boolean` `isShown()` `boolean` `@ViewDebug.ExportedProperty
isSoundEffectsEnabled()` `final boolean` `isTemporarilyDetached()` `boolean` `isTextAlignmentResolved()` `boolean` `isTextDirectionResolved()` `boolean` `isVerticalFadingEdgeEnabled()` `boolean` `isVerticalScrollBarEnabled()` `boolean` `isVisibleToUserForAutofill(int virtualId)` `@NonNull View` `keyboardNavigationClusterSearch(
@NonNull View currentCluster,
int direction
)` `final void` `measure(int widthMeasureSpec, int heightMeasureSpec)` `void` `offsetLeftAndRight(int offset)` `void` `offsetTopAndBottom(int offset)` `void` `onAnimationEnd()` `void` `onAnimationStart()` `@NonNull WindowInsets` `onApplyWindowInsets(@NonNull WindowInsets insets)` `void` `onCancelPendingInputEvents()` `boolean` `onCapturedPointerEvent(@NonNull MotionEvent event)` `boolean` `onCheckIsTextEditor()` `void` `onCreateContextMenu(@NonNull ContextMenu menu)` `@NonNull InputConnection` `onCreateInputConnection(@NonNull EditorInfo outAttrs)` `void` `onCreateViewTranslationRequest(
@NonNull int[] supportedFormats,
@NonNull Consumer<@NonNull ViewTranslationRequest> requestsCollector
)` `void` `onCreateVirtualViewTranslationRequests(
@NonNull long[] virtualIds,
@NonNull int[] supportedFormats,
@NonNull Consumer<@NonNull ViewTranslationRequest> requestsCollector
)` `void` `onDisplayHint(int hint)` `boolean` `onDragEvent(@NonNull DragEvent event)` `void` `onDraw(@NonNull Canvas canvas)` `void` `onDrawForeground(@NonNull Canvas canvas)` `final void` `onDrawScrollBars(@NonNull Canvas canvas)` `boolean` `onFilterTouchEventForSecurity(@NonNull MotionEvent event)` `void` `onFinishInflate()` `void` `onFinishTemporaryDetach()` `void` `onFocusChanged(
boolean gainFocus,
int direction,
Rect previouslyFocusedRect
)` `boolean` `onGenericMotionEvent(@NonNull MotionEvent event)` `void` `onHoverChanged(boolean hovered)` `boolean` `onHoverEvent(@NonNull MotionEvent event)` `void` `onInitializeAccessibilityEvent(@NonNull AccessibilityEvent event)` `void` `onInitializeAccessibilityNodeInfo(@NonNull AccessibilityNodeInfo info)` `boolean` `onKeyDown(int keyCode, @NonNull KeyEvent event)` `boolean` `onKeyLongPress(int keyCode, @NonNull KeyEvent event)` `boolean` `onKeyMultiple(int keyCode, int repeatCount, @NonNull KeyEvent event)` `boolean` `onKeyPreIme(int keyCode, @NonNull KeyEvent event)` `boolean` `onKeyShortcut(int keyCode, @NonNull KeyEvent event)` `boolean` `onKeyUp(int keyCode, @NonNull KeyEvent event)` `void` `onOverScrolled(
int scrollX,
int scrollY,
boolean clampedX,
boolean clampedY
)` `void` `onPointerCaptureChange(boolean hasCapture)` `void` `onPopulateAccessibilityEvent(@NonNull AccessibilityEvent event)` `void` `onProvideAutofillStructure(@NonNull ViewStructure structure, int flags)` `void` `onProvideAutofillVirtualStructure(
@NonNull ViewStructure structure,
int flags
)` `void` `onProvideContentCaptureNodeProperties(
@NonNull ContentCaptureNodeProperties properties
)` `void` `onProvideContentCaptureStructure(
@NonNull ViewStructure structure,
int flags
)` `void` `onProvideStructure(@NonNull ViewStructure structure)` `void` `onProvideVirtualStructure(@NonNull ViewStructure structure)` `ContentInfo` `onReceiveContent(@NonNull ContentInfo payload)` `void` `onRestoreInstanceState(@NonNull Parcelable state)` `void` `onRtlPropertiesChanged(int layoutDirection)` `Parcelable` `onSaveInstanceState()` `void` `onScreenStateChanged(int screenState)` `void` `onScrollCaptureSearch(
@NonNull Rect localVisibleRect,
@NonNull Point windowOffset,
@NonNull Consumer<@NonNull ScrollCaptureTarget> targets
)` `void` `onScrollChanged(int l, int t, int oldl, int oldt)` `boolean` `onSetAlpha(int alpha)` `void` `onStartTemporaryDetach()` `boolean` `onTouchEvent(@NonNull MotionEvent event)` `boolean` `onTrackballEvent(@NonNull MotionEvent event)` `void` `onViewTranslationResponse(@NonNull ViewTranslationResponse response)` `void` `onVirtualViewTranslationResponses(
@NonNull LongSparseArray<@NonNull ViewTranslationResponse> response
)` `void` `onVisibilityAggregated(boolean isVisible)` `void` `onVisibilityChanged(@NonNull View changedView, int visibility)` `void` `onWindowFocusChanged(boolean hasWindowFocus)` `void` `onWindowSystemUiVisibilityChanged(int visible)` `void` `onWindowVisibilityChanged(int visibility)` `boolean` `overScrollBy(
int deltaX,
int deltaY,
int scrollX,
int scrollY,
int scrollRangeX,
int scrollRangeY,
int maxOverScrollX,
int maxOverScrollY,
boolean isTouchEvent
)` `boolean` `performAccessibilityAction(int action, Bundle arguments)` `boolean` `performClick()` `boolean` `performContextClick()` `boolean` `performContextClick(float x, float y)` `boolean` `performHapticFeedback(int feedbackConstant)` `boolean` `performHapticFeedback(@NonNull HapticFeedbackRequest request)` `boolean` `performHapticFeedback(int feedbackConstant, int flags)` `boolean` `performLongClick()` `boolean` `performLongClick(float x, float y)` `ContentInfo` `performReceiveContent(@NonNull ContentInfo payload)` `void` `playSoundEffect(int soundConstant)` `boolean` `post(@NonNull Runnable action)` `boolean` `postDelayed(@NonNull Runnable action, long delayMillis)` `void` `postInvalidate()` `void` `postInvalidate(int left, int top, int right, int bottom)` `void` `postInvalidateDelayed(long delayMilliseconds)` `void` `postInvalidateDelayed(
long delayMilliseconds,
int left,
int top,
int right,
int bottom
)` `void` `postInvalidateOnAnimation()` `void` `postInvalidateOnAnimation(int left, int top, int right, int bottom)` `void` `postOnAnimation(@NonNull Runnable action)` `void` `postOnAnimationDelayed(@NonNull Runnable action, long delayMillis)` `void` `refreshDrawableState()` `void` `releasePointerCapture()` `boolean` `removeCallbacks(@NonNull Runnable action)` `void` `removeOnAttachStateChangeListener(
@NonNull View.OnAttachStateChangeListener listener
)` `void` `removeOnLayoutChangeListener(
@NonNull View.OnLayoutChangeListener listener
)` `void` `removeOnUnhandledKeyEventListener(
@NonNull View.OnUnhandledKeyEventListener listener
)` `void` `reportAppJankStats(@NonNull AppJankStats appJankStats)` `void` `requestApplyInsets()` `void` `[requestFitSystemWindows](https://developer.android.com/reference/android/view/View.md.txt#requestFitSystemWindows())()`

**This method is deprecated.** Deprecated in Java
`final boolean` `requestFocus()` `final boolean` `requestFocus(int direction)` `final boolean` `requestFocusFromTouch()` `void` `requestLayout()` `void` `requestPointerCapture()` `void` `requestPointerCapture(int mode)` `boolean` `requestRectangleOnScreen(@NonNull Rect rectangle)` `boolean` `requestRectangleOnScreen(@NonNull Rect rectangle, boolean immediate)` `boolean` `requestRectangleOnScreen(
@NonNull Rect rectangle,
boolean immediate,
int source
)` `final void` `requestUnbufferedDispatch(@NonNull MotionEvent event)` `final void` `requestUnbufferedDispatch(int source)` `final @NonNull T` `<T extends View> requireViewById(int id)` `void` `resetPivot()` `void` `restoreHierarchyState(@NonNull SparseArray<@NonNull Parcelable> container)` `final void` `saveAttributeDataForStyleable(
@NonNull Context context,
@NonNull int[] styleable,
AttributeSet attrs,
@NonNull TypedArray t,
int defStyleAttr,
int defStyleRes
)` `void` `saveHierarchyState(@NonNull SparseArray<@NonNull Parcelable> container)` `void` `scheduleDrawable(@NonNull Drawable who, @NonNull Runnable what, long when)` `void` `scrollBy(int x, int y)` `void` `scrollTo(int x, int y)` `void` `sendAccessibilityEvent(int eventType)` `void` `sendAccessibilityEventUnchecked(@NonNull AccessibilityEvent event)` `void` `setAccessibilityDataSensitive(int accessibilityDataSensitive)` `void` `setAccessibilityDelegate(View.AccessibilityDelegate delegate)` `void` `setAccessibilityHeading(boolean isHeading)` `void` `setAccessibilityLiveRegion(int mode)` `void` `setAccessibilityPaneTitle(CharSequence accessibilityPaneTitle)` `void` `setAccessibilityTraversalAfter(int afterId)` `void` `setAccessibilityTraversalBefore(int beforeId)` `void` `setActivated(boolean activated)` `void` `setAllowClickWhenDisabled(boolean clickableWhenDisabled)` `void` `setAllowedHandwritingDelegatePackage(String allowedPackageName)` `void` `setAllowedHandwritingDelegatorPackage(String allowedPackageName)` `void` `setAlpha(float alpha)` `void` `setAnimation(@NonNull Animation animation)` `void` `setAnimationMatrix(Matrix matrix)` `void` `setAutoHandwritingEnabled(boolean enabled)` `void` `setAutofillHints(@NonNull String... autofillHints)` `void` `setAutofillId(AutofillId id)` `void` `setBackdropRenderEffect(RenderEffect renderEffect)` `void` `setBackground(@NonNull Drawable background)` `void` `setBackgroundDrawable(@NonNull Drawable background)` `void` `setBackgroundResource(int resid)` `void` `setBackgroundTintBlendMode(BlendMode blendMode)` `void` `setBackgroundTintList(ColorStateList tint)` `void` `setBackgroundTintMode(PorterDuff.Mode tintMode)` `final void` `setBottom(int bottom)` `void` `setCameraDistance(float distance)` `void` `setClickable(boolean clickable)` `void` `setClipBounds(@NonNull Rect clipBounds)` `void` `setClipToOutline(boolean clipToOutline)` `void` `setContentCaptureSession(ContentCaptureSession contentCaptureSession)` `void` `setContentDescription(@NonNull CharSequence contentDescription)` `final void` `setContentSensitivity(int mode)` `void` `setContextClickable(boolean contextClickable)` `void` `setDefaultFocusHighlightEnabled(boolean defaultFocusHighlightEnabled)` `void` `[setDrawingCacheBackgroundColor](https://developer.android.com/reference/android/view/View.md.txt#setDrawingCacheBackgroundColor(int))(int color)`

**This method is deprecated.** Deprecated in Java
`void` `[setDrawingCacheEnabled](https://developer.android.com/reference/android/view/View.html#setDrawingCacheEnabled(boolean))(boolean enabled)`

**This method is deprecated.** Deprecated in Java
`void` `[setDrawingCacheQuality](https://developer.android.com/reference/android/view/View.html#setDrawingCacheQuality(int))(int quality)`

**This method is deprecated.** Deprecated in Java
`void` `setDuplicateParentStateEnabled(boolean enabled)` `void` `setElevation(float elevation)` `void` `setEnabled(boolean enabled)` `void` `setFadingEdgeLength(int length)` `void` `setFilterTouchesWhenObscured(boolean enabled)` `void` `setFitsSystemWindows(boolean fitSystemWindows)` `void` `setFocusable(boolean focusable)` `void` `setFocusable(int focusable)` `void` `setFocusableInTouchMode(boolean focusableInTouchMode)` `void` `setFocusedByDefault(boolean isFocusedByDefault)` `void` `setForceDarkAllowed(boolean allow)` `void` `setForeground(@NonNull Drawable foreground)` `void` `setForegroundGravity(int gravity)` `void` `setForegroundTintBlendMode(BlendMode blendMode)` `void` `setForegroundTintList(ColorStateList tint)` `void` `setForegroundTintMode(PorterDuff.Mode tintMode)` `void` `setFrameContentVelocity(float pixelsPerSecond)` `void` `setHandwritingBoundsOffsets(
float offsetLeft,
float offsetTop,
float offsetRight,
float offsetBottom
)` `void` `setHandwritingDelegateFlags(int flags)` `void` `setHandwritingDelegatorCallback(Runnable callback)` `void` `setHapticFeedbackEnabled(boolean hapticFeedbackEnabled)` `void` `setHasTransientState(boolean hasTransientState)` `void` `setHorizontalFadingEdgeEnabled(boolean horizontalFadingEdgeEnabled)` `void` `setHorizontalScrollBarEnabled(boolean horizontalScrollBarEnabled)` `void` `setHorizontalScrollbarThumbDrawable(Drawable drawable)` `void` `setHorizontalScrollbarTrackDrawable(Drawable drawable)` `void` `setHovered(boolean hovered)` `void` `setId(int id)` `void` `setImportantForAccessibility(int mode)` `void` `setImportantForAutofill(int mode)` `void` `setImportantForContentCapture(int mode)` `void` `setIsCredential(boolean isCredential)` `void` `setIsHandwritingDelegate(boolean isHandwritingDelegate)` `void` `setKeepScreenOn(boolean keepScreenOn)` `void` `setKeyboardNavigationCluster(boolean isCluster)` `void` `setLabelFor(int id)` `void` `setLayerPaint(Paint paint)` `void` `setLayerType(int layerType, Paint paint)` `void` `setLayoutDirection(int layoutDirection)` `void` `setLayoutParams(@NonNull ViewGroup.LayoutParams params)` `final void` `setLeft(int left)` `final void` `setLeftTopRightBottom(int left, int top, int right, int bottom)` `void` `setLongClickable(boolean longClickable)` `final void` `setMeasuredDimension(int measuredWidth, int measuredHeight)` `void` `setMinimumHeight(int minHeight)` `void` `setMinimumWidth(int minWidth)` `void` `setNestedScrollingEnabled(boolean enabled)` `void` `setNextClusterForwardId(int nextClusterForwardId)` `void` `setNextFocusDownId(int nextFocusDownId)` `void` `setNextFocusForwardId(int nextFocusForwardId)` `void` `setNextFocusLeftId(int nextFocusLeftId)` `void` `setNextFocusRightId(int nextFocusRightId)` `void` `setNextFocusUpId(int nextFocusUpId)` `void` `setOnApplyWindowInsetsListener(
@NonNull View.OnApplyWindowInsetsListener listener
)` `void` `setOnCapturedPointerListener(@NonNull View.OnCapturedPointerListener l)` `void` `setOnClickListener(View.OnClickListener l)` `void` `setOnContextClickListener(View.OnContextClickListener l)` `void` `setOnCreateContextMenuListener(
@NonNull View.OnCreateContextMenuListener l
)` `void` `setOnDragListener(@NonNull View.OnDragListener l)` `void` `setOnFocusChangeListener(@NonNull View.OnFocusChangeListener l)` `void` `setOnGenericMotionListener(@NonNull View.OnGenericMotionListener l)` `void` `setOnHoverListener(@NonNull View.OnHoverListener l)` `void` `setOnKeyListener(@NonNull View.OnKeyListener l)` `void` `setOnLongClickListener(View.OnLongClickListener l)` `void` `setOnReceiveContentListener(
String[] mimeTypes,
OnReceiveContentListener listener
)` `void` `setOnScrollChangeListener(@NonNull View.OnScrollChangeListener l)` `void` `setOnSystemUiVisibilityChangeListener(
@NonNull View.OnSystemUiVisibilityChangeListener l
)` `void` `setOnTouchListener(@NonNull View.OnTouchListener l)` `void` `setOutlineAmbientShadowColor(int color)` `void` `setOutlineProvider(@NonNull ViewOutlineProvider provider)` `void` `setOutlineSpotShadowColor(int color)` `void` `setOverScrollMode(int overScrollMode)` `void` `setPendingCredentialRequest(
@NonNull GetCredentialRequest request,
@NonNull OutcomeReceiver<@NonNull GetCredentialResponse, @NonNull GetCredentialException> callback
)` `void` `setPivotX(float pivotX)` `void` `setPivotY(float pivotY)` `void` `setPointerIcon(@NonNull PointerIcon pointerIcon)` `final void` `setPreferKeepClear(boolean preferKeepClear)` `final void` `setPreferKeepClearRects(@NonNull List<@NonNull Rect> rects)` `void` `setPressed(boolean pressed)` `void` `setRenderEffect(RenderEffect renderEffect)` `final void` `setRevealOnFocusHint(boolean revealOnFocus)` `final void` `setRight(int right)` `void` `setRotation(float rotation)` `void` `setRotationX(float rotationX)` `void` `setRotationY(float rotationY)` `void` `setSaveEnabled(boolean enabled)` `void` `setSaveFromParentEnabled(boolean enabled)` `void` `setScaleX(float scaleX)` `void` `setScaleY(float scaleY)` `void` `setScreenReaderFocusable(boolean screenReaderFocusable)` `void` `setScrollBarDefaultDelayBeforeFade(
int scrollBarDefaultDelayBeforeFade
)` `void` `setScrollBarFadeDuration(int scrollBarFadeDuration)` `void` `setScrollBarSize(int scrollBarSize)` `void` `setScrollBarStyle(int style)` `final void` `setScrollCaptureCallback(ScrollCaptureCallback callback)` `void` `setScrollCaptureHint(int hint)` `void` `setScrollContainer(boolean isScrollContainer)` `void` `setScrollIndicators(int indicators)` `void` `setScrollIndicators(int indicators, int mask)` `void` `setScrollX(int value)` `void` `setScrollY(int value)` `void` `setScrollbarFadingEnabled(boolean fadeScrollbars)` `void` `setSelected(boolean selected)` `void` `setSoundEffectsEnabled(boolean soundEffectsEnabled)` `void` `setStateDescription(CharSequence stateDescription)` `void` `setStateListAnimator(@NonNull StateListAnimator stateListAnimator)` `void` `setSupplementalDescription(CharSequence supplementalDescription)` `void` `setSystemGestureExclusionRects(@NonNull List<@NonNull Rect> rects)` `void` `[setSystemUiVisibility](https://developer.android.com/reference/android/view/View.md.txt#setSystemUiVisibility(int))(int visibility)`

**This method is deprecated.** Deprecated in Java
`void` `setTag(@NonNull Object tag)` `void` `setTag(int key, @NonNull Object tag)` `void` `setTextAlignment(int textAlignment)` `void` `setTextDirection(int textDirection)` `void` `setTooltipText(CharSequence tooltipText)` `final void` `setTop(int top)` `void` `setTouchDelegate(@NonNull TouchDelegate delegate)` `void` `setTransitionAlpha(float alpha)` `final void` `setTransitionName(@NonNull String transitionName)` `void` `setTransitionVisibility(int visibility)` `void` `setTranslationX(float translationX)` `void` `setTranslationY(float translationY)` `void` `setTranslationZ(float translationZ)` `void` `setVerticalFadingEdgeEnabled(boolean verticalFadingEdgeEnabled)` `void` `setVerticalScrollBarEnabled(boolean verticalScrollBarEnabled)` `void` `setVerticalScrollbarPosition(int position)` `void` `setVerticalScrollbarThumbDrawable(Drawable drawable)` `void` `setVerticalScrollbarTrackDrawable(Drawable drawable)` `void` `setViewTranslationCallback(@NonNull ViewTranslationCallback callback)` `void` `setVisibility(int visibility)` `void` `setWillNotCacheDrawing(boolean willNotCacheDrawing)` `void` `setWillNotDraw(boolean willNotDraw)` `void` `setX(float x)` `void` `setY(float y)` `void` `setZ(float z)` `boolean` `showContextMenu()` `boolean` `showContextMenu(float x, float y)` `@NonNull ActionMode` `startActionMode(@NonNull ActionMode.Callback callback)` `@NonNull ActionMode` `startActionMode(@NonNull ActionMode.Callback callback, int type)` `void` `startAnimation(@NonNull Animation animation)` `final boolean` `startDrag(
@NonNull ClipData data,
@NonNull View.DragShadowBuilder shadowBuilder,
@NonNull Object myLocalState,
int flags
)` `final boolean` `startDragAndDrop(
@NonNull ClipData data,
@NonNull View.DragShadowBuilder shadowBuilder,
@NonNull Object myLocalState,
int flags
)` `boolean` `startNestedScroll(int axes)` `void` `stopNestedScroll()` `@NonNull String` `toString()` `void` `transformMatrixToGlobal(@NonNull Matrix matrix)` `void` `transformMatrixToLocal(@NonNull Matrix matrix)` `void` `unscheduleDrawable(@NonNull Drawable who)` `void` `unscheduleDrawable(@NonNull Drawable who, @NonNull Runnable what)` `final void` `updateDragShadow(@NonNull View.DragShadowBuilder shadowBuilder)` `boolean` `verifyDrawable(@NonNull Drawable who)` `boolean` `willNotCacheDrawing()` `boolean` `willNotDraw()` From [android.view.ViewGroup](https://developer.android.com/reference/android/view/ViewGroup.html) `void` `addChildrenForAccessibility(@NonNull ArrayList<@NonNull View> outChildren)` `void` `addExtraDataToAccessibilityNodeInfo(
@NonNull AccessibilityNodeInfo info,
@NonNull String extraDataKey,
Bundle arguments
)` `void` `addFocusables(
@NonNull ArrayList<@NonNull View> views,
int direction,
int focusableMode
)` `void` `addKeyboardNavigationClusters(
@NonNull Collection<@NonNull View> views,
int direction
)` `boolean` `addStatesFromChildren()` `void` `addTouchables(@NonNull ArrayList<@NonNull View> views)` `boolean` `addViewInLayout(
@NonNull View child,
int index,
@NonNull ViewGroup.LayoutParams params,
boolean preventRequestLayout
)` `void` `attachLayoutAnimationParameters(
@NonNull View child,
@NonNull ViewGroup.LayoutParams params,
int index,
int count
)` `void` `attachViewToParent(
@NonNull View child,
int index,
@NonNull ViewGroup.LayoutParams params
)` `void` `bringChildToFront(@NonNull View child)` `boolean` `canAnimate()` `boolean` `checkLayoutParams(@NonNull ViewGroup.LayoutParams p)` `void` `childDrawableStateChanged(@NonNull View child)` `void` `childHasTransientStateChanged(
@NonNull View child,
boolean childHasTransientState
)` `void` `cleanupLayoutState(@NonNull View child)` `void` `clearChildFocus(@NonNull View child)` `void` `clearDisappearingChildren()` `void` `clearFocus()` `void` `debug(int depth)` `void` `detachAllViewsFromParent()` `void` `detachViewFromParent(@NonNull View child)` `void` `detachViewFromParent(int index)` `void` `detachViewsFromParent(int start, int count)` `@NonNull WindowInsets` `dispatchApplyWindowInsets(@NonNull WindowInsets insets)` `boolean` `dispatchCapturedPointerEvent(@NonNull MotionEvent event)` `void` `dispatchConfigurationChanged(@NonNull Configuration newConfig)` `void` `dispatchCreateViewTranslationRequest(
@NonNull Map<@NonNull AutofillId, @NonNull long[]> viewIds,
@NonNull int[] supportedFormats,
@NonNull TranslationCapability capability,
@NonNull List<@NonNull ViewTranslationRequest> requests
)` `void` `dispatchDisplayHint(int hint)` `boolean` `dispatchDragEvent(@NonNull DragEvent event)` `void` `dispatchDraw(@NonNull Canvas canvas)` `void` `dispatchDrawableHotspotChanged(float x, float y)` `void` `dispatchFinishTemporaryDetach()` `void` `dispatchFreezeSelfOnly(
@NonNull SparseArray<@NonNull Parcelable> container
)` `boolean` `dispatchGenericFocusedEvent(@NonNull MotionEvent event)` `boolean` `dispatchGenericPointerEvent(@NonNull MotionEvent event)` `boolean` `dispatchHoverEvent(@NonNull MotionEvent event)` `boolean` `dispatchKeyEvent(@NonNull KeyEvent event)` `boolean` `dispatchKeyEventPreIme(@NonNull KeyEvent event)` `boolean` `dispatchKeyShortcutEvent(@NonNull KeyEvent event)` `void` `dispatchPointerCaptureChanged(boolean hasCapture)` `void` `dispatchProvideAutofillStructure(
@NonNull ViewStructure structure,
int flags
)` `void` `dispatchProvideStructure(@NonNull ViewStructure structure)` `void` `dispatchRestoreInstanceState(
@NonNull SparseArray<@NonNull Parcelable> container
)` `void` `dispatchSaveInstanceState(
@NonNull SparseArray<@NonNull Parcelable> container
)` `void` `dispatchScrollCaptureSearch(
@NonNull Rect localVisibleRect,
@NonNull Point windowOffset,
@NonNull Consumer<@NonNull ScrollCaptureTarget> targets
)` `void` `dispatchSetActivated(boolean activated)` `void` `dispatchSetPressed(boolean pressed)` `void` `dispatchSetSelected(boolean selected)` `void` `dispatchStartTemporaryDetach()` `void` `dispatchSystemUiVisibilityChanged(int visible)` `void` `dispatchThawSelfOnly(@NonNull SparseArray<@NonNull Parcelable> container)` `boolean` `dispatchTouchEvent(@NonNull MotionEvent ev)` `boolean` `dispatchTrackballEvent(@NonNull MotionEvent event)` `boolean` `dispatchUnhandledMove(@NonNull View focused, int direction)` `void` `dispatchVisibilityChanged(@NonNull View changedView, int visibility)` `void` `dispatchWindowFocusChanged(boolean hasFocus)` `void` `dispatchWindowInsetsAnimationEnd(
@NonNull WindowInsetsAnimation animation
)` `void` `dispatchWindowInsetsAnimationPrepare(
@NonNull WindowInsetsAnimation animation
)` `@NonNull WindowInsets` `dispatchWindowInsetsAnimationProgress(
@NonNull WindowInsets insets,
@NonNull List<@NonNull WindowInsetsAnimation> runningAnimations
)` `@NonNull WindowInsetsAnimation.Bounds` `dispatchWindowInsetsAnimationStart(
@NonNull WindowInsetsAnimation animation,
@NonNull WindowInsetsAnimation.Bounds bounds
)` `void` `dispatchWindowSystemUiVisiblityChanged(int visible)` `void` `dispatchWindowVisibilityChanged(int visibility)` `boolean` `drawChild(@NonNull Canvas canvas, @NonNull View child, long drawingTime)` `void` `drawableStateChanged()` `void` `endViewTransition(@NonNull View view)` `@NonNull View` `findFocus()` `OnBackInvokedDispatcher` `findOnBackInvokedDispatcherForChild(
@NonNull View child,
@NonNull View requester
)` `void` `findViewsWithText(
@NonNull ArrayList<@NonNull View> outViews,
@NonNull CharSequence text,
int flags
)` `@NonNull View` `focusSearch(@NonNull View focused, int direction)` `void` `focusableViewAvailable(@NonNull View v)` `boolean` `gatherTransparentRegion(Region region)` `@NonNull ViewGroup.LayoutParams` `generateDefaultLayoutParams()` `@NonNull ViewGroup.LayoutParams` `generateLayoutParams(@NonNull AttributeSet attrs)` `@NonNull ViewGroup.LayoutParams` `generateLayoutParams(@NonNull ViewGroup.LayoutParams p)` `@NonNull CharSequence` `getAccessibilityClassName()` `@NonNull View` `getChildAt(int index)` `int` `getChildCount()` `final int` `getChildDrawingOrder(int drawingPosition)` `int` `getChildDrawingOrder(int childCount, int drawingPosition)` `boolean` `getChildStaticTransformation(
@NonNull View child,
@NonNull Transformation t
)` `boolean` `getChildVisibleRect(
@NonNull View child,
@NonNull Rect r,
@NonNull Point offset
)` `boolean` `@ViewDebug.ExportedProperty(category = "drawing")
getClipChildren()` `boolean` `@ViewDebug.ExportedProperty(category = "drawing")
getClipToPadding()` `int` `@ViewDebug.ExportedProperty(category = "focus", mapping = [@ViewDebug.IntToString(from = 131072, to = "FOCUS_BEFORE_DESCENDANTS"), @ViewDebug.IntToString(from = 262144, to = "FOCUS_AFTER_DESCENDANTS"), @ViewDebug.IntToString(from = 393216, to = "FOCUS_BLOCK_DESCENDANTS")])
getDescendantFocusability()` `@NonNull View` `getFocusedChild()` `@NonNull LayoutAnimationController` `getLayoutAnimation()` `@NonNull Animation.AnimationListener` `getLayoutAnimationListener()` `int` `@ViewDebug.ExportedProperty(category = "layout", mapping = [@ViewDebug.IntToString(from = 0, to = "RESOLVED_DIRECTION_LTR"), @ViewDebug.IntToString(from = 1, to = "RESOLVED_DIRECTION_RTL")])
getLayoutDirection()` `int` `getLayoutMode()` `@NonNull LayoutTransition` `getLayoutTransition()` `int` `getNestedScrollAxes()` `@NonNull ViewGroupOverlay` `getOverlay()` `final @NonNull ViewParent` `getParent()` `@NonNull ViewParent` `getParentForAccessibility()` `int` `@ViewDebug.ExportedProperty(category = "drawing", mapping = [@ViewDebug.IntToString(from = 0, to = "NONE"), @ViewDebug.IntToString(from = 1, to = "ANIMATION"), @ViewDebug.IntToString(from = 2, to = "SCROLLING"), @ViewDebug.IntToString(from = 3, to = "ALL")])
[getPersistentDrawingCache](https://developer.android.com/reference/android/view/ViewGroup.md.txt#getPersistentDrawingCache())()`

**This method is deprecated.** Deprecated in Java
`int` `@ViewDebug.ExportedProperty(category = "text", mapping = [@ViewDebug.IntToString(from = 0, to = "INHERIT"), @ViewDebug.IntToString(from = 1, to = "GRAVITY"), @ViewDebug.IntToString(from = 2, to = "TEXT_START"), @ViewDebug.IntToString(from = 3, to = "TEXT_END"), @ViewDebug.IntToString(from = 4, to = "CENTER"), @ViewDebug.IntToString(from = 5, to = "VIEW_START"), @ViewDebug.IntToString(from = 6, to = "VIEW_END")])
getTextAlignment()` `int` `@ViewDebug.ExportedProperty(category = "text", mapping = [@ViewDebug.IntToString(from = 0, to = "INHERIT"), @ViewDebug.IntToString(from = 1, to = "FIRST_STRONG"), @ViewDebug.IntToString(from = 2, to = "ANY_RTL"), @ViewDebug.IntToString(from = 3, to = "LTR"), @ViewDebug.IntToString(from = 4, to = "RTL"), @ViewDebug.IntToString(from = 5, to = "LOCALE"), @ViewDebug.IntToString(from = 6, to = "FIRST_STRONG_LTR"), @ViewDebug.IntToString(from = 7, to = "FIRST_STRONG_RTL")])
getTextDirection()` `boolean` `@ViewDebug.ExportedProperty(category = "focus")
getTouchscreenBlocksFocus()` `boolean` `hasFocus()` `boolean` `hasTransientState()` `int` `indexOfChild(@NonNull View child)` `final void` `invalidateChild(@NonNull View child, @NonNull Rect dirty)` `@NonNull ViewParent` `invalidateChildInParent(@NonNull int[] location, @NonNull Rect dirty)` `boolean` `[isAlwaysDrawnWithCacheEnabled](https://developer.android.com/reference/android/view/ViewGroup.md.txt#isAlwaysDrawnWithCacheEnabled())()`

**This method is deprecated.** Deprecated in Java
`boolean` `[isAnimationCacheEnabled](https://developer.android.com/reference/android/view/ViewGroup.html#isAnimationCacheEnabled())()`

**This method is deprecated.** Deprecated in Java
`boolean` `@ViewDebug.ExportedProperty(category = "drawing")
isChildrenDrawingOrderEnabled()` `boolean` `[isChildrenDrawnWithCacheEnabled](https://developer.android.com/reference/android/view/ViewGroup.md.txt#isChildrenDrawnWithCacheEnabled())()`

**This method is deprecated.** Deprecated in Java
`boolean` `isLayoutDirectionResolved()` `boolean` `isLayoutRequested()` `boolean` `isLayoutSuppressed()` `boolean` `isMotionEventSplittingEnabled()` `boolean` `isTextAlignmentResolved()` `boolean` `isTextDirectionResolved()` `boolean` `isTransitionGroup()` `void` `jumpDrawablesToCurrentState()` `final void` `layout(int l, int t, int r, int b)` `void` `measureChild(
@NonNull View child,
int parentWidthMeasureSpec,
int parentHeightMeasureSpec
)` `void` `measureChildWithMargins(
@NonNull View child,
int parentWidthMeasureSpec,
int widthUsed,
int parentHeightMeasureSpec,
int heightUsed
)` `void` `measureChildren(int widthMeasureSpec, int heightMeasureSpec)` `void` `notifySubtreeAccessibilityStateChanged(
@NonNull View child,
@NonNull View source,
int changeType
)` `final void` `offsetDescendantRectToMyCoords(
@NonNull View descendant,
@NonNull Rect rect
)` `final void` `offsetRectIntoDescendantCoords(
@NonNull View descendant,
@NonNull Rect rect
)` `@NonNull int[]` `onCreateDrawableState(int extraSpace)` `void` `onDescendantInvalidated(@NonNull View child, @NonNull View target)` `boolean` `onInterceptHoverEvent(@NonNull MotionEvent event)` `boolean` `onInterceptTouchEvent(@NonNull MotionEvent ev)` `boolean` `onNestedFling(
@NonNull View target,
float velocityX,
float velocityY,
boolean consumed
)` `boolean` `onNestedPreFling(@NonNull View target, float velocityX, float velocityY)` `boolean` `onNestedPrePerformAccessibilityAction(
@NonNull View target,
int action,
Bundle args
)` `void` `onNestedPreScroll(
@NonNull View target,
int dx,
int dy,
@NonNull int[] consumed
)` `void` `onNestedScroll(
@NonNull View target,
int dxConsumed,
int dyConsumed,
int dxUnconsumed,
int dyUnconsumed
)` `void` `onNestedScrollAccepted(@NonNull View child, @NonNull View target, int axes)` `boolean` `onRequestFocusInDescendants(
int direction,
@NonNull Rect previouslyFocusedRect
)` `boolean` `onRequestSendAccessibilityEvent(
@NonNull View child,
@NonNull AccessibilityEvent event
)` `@NonNull PointerIcon` `onResolvePointerIcon(@NonNull MotionEvent event, int pointerIndex)` `boolean` `onStartNestedScroll(
@NonNull View child,
@NonNull View target,
int nestedScrollAxes
)` `void` `onStopNestedScroll(@NonNull View child)` `void` `onViewAdded(@NonNull View child)` `void` `onViewRemoved(@NonNull View child)` `void` `propagateRequestedFrameRate(float frameRate, boolean forceOverride)` `void` `recomputeViewAttributes(@NonNull View child)` `void` `removeAllViews()` `void` `removeAllViewsInLayout()` `void` `removeDetachedView(@NonNull View child, boolean animate)` `void` `removeView(@NonNull View view)` `void` `removeViewAt(int index)` `void` `removeViewInLayout(@NonNull View view)` `void` `removeViews(int start, int count)` `void` `removeViewsInLayout(int start, int count)` `void` `requestChildFocus(@NonNull View child, @NonNull View focused)` `boolean` `requestChildRectangleOnScreen(
@NonNull View child,
@NonNull Rect rectangle,
boolean immediate
)` `void` `requestDisallowInterceptTouchEvent(boolean disallowIntercept)` `boolean` `requestFocus(int direction, @NonNull Rect previouslyFocusedRect)` `boolean` `requestSendAccessibilityEvent(
@NonNull View child,
@NonNull AccessibilityEvent event
)` `void` `requestTransparentRegion(@NonNull View child)` `boolean` `restoreDefaultFocus()` `void` `scheduleLayoutAnimation()` `void` `setAddStatesFromChildren(boolean addsStates)` `void` `[setAlwaysDrawnWithCacheEnabled](https://developer.android.com/reference/android/view/ViewGroup.md.txt#setAlwaysDrawnWithCacheEnabled(boolean))(boolean always)`

**This method is deprecated.** Deprecated in Java
`void` `[setAnimationCacheEnabled](https://developer.android.com/reference/android/view/ViewGroup.html#setAnimationCacheEnabled(boolean))(boolean enabled)`

**This method is deprecated.** Deprecated in Java
`void` `setChildrenDrawingCacheEnabled(boolean enabled)` `void` `setChildrenDrawingOrderEnabled(boolean enabled)` `void` `[setChildrenDrawnWithCacheEnabled](https://developer.android.com/reference/android/view/ViewGroup.html#setChildrenDrawnWithCacheEnabled(boolean))(boolean enabled)`

**This method is deprecated.** Deprecated in Java
`void` `setClipChildren(boolean clipChildren)` `void` `setClipToPadding(boolean clipToPadding)` `void` `setDescendantFocusability(int focusability)` `void` `setLayoutAnimation(@NonNull LayoutAnimationController controller)` `void` `setLayoutAnimationListener(
@NonNull Animation.AnimationListener animationListener
)` `void` `setLayoutMode(int layoutMode)` `void` `setLayoutTransition(@NonNull LayoutTransition transition)` `void` `setMotionEventSplittingEnabled(boolean split)` `void` `setOnHierarchyChangeListener(
@NonNull ViewGroup.OnHierarchyChangeListener listener
)` `void` `[setPersistentDrawingCache](https://developer.android.com/reference/android/view/ViewGroup.md.txt#setPersistentDrawingCache(int))(int drawingCacheToKeep)`

**This method is deprecated.** Deprecated in Java
`void` `setRequestedFrameRate(float frameRate)` `void` `setStaticTransformationsEnabled(boolean enabled)` `void` `setTouchscreenBlocksFocus(boolean touchscreenBlocksFocus)` `void` `setTransitionGroup(boolean isTransitionGroup)` `void` `setWindowInsetsAnimationCallback(
WindowInsetsAnimation.Callback callback
)` `boolean` `shouldDelayChildPressedState()` `boolean` `showContextMenuForChild(@NonNull View originalView)` `boolean` `showContextMenuForChild(@NonNull View originalView, float x, float y)` `@NonNull ActionMode` `startActionModeForChild(
@NonNull View originalView,
@NonNull ActionMode.Callback callback
)` `@NonNull ActionMode` `startActionModeForChild(
@NonNull View originalView,
@NonNull ActionMode.Callback callback,
int type
)` `void` `startLayoutAnimation()` `void` `startViewTransition(@NonNull View view)` `void` `suppressLayout(boolean suppress)` `void` `updateViewLayout(
@NonNull View view,
@NonNull ViewGroup.LayoutParams params
)` From [android.view.ViewParent](https://developer.android.com/reference/android/view/ViewParent.html) `boolean` `requestChildRectangleOnScreen(
@NonNull View child,
@NonNull Rect rectangle,
boolean immediate,
int source
)`

## Constants

### TEXT_TYPE_NEAR_MY_PRECISE_LOCATION

```
public static final int TEXT_TYPE_NEAR_MY_PRECISE_LOCATION
```

### TEXT_TYPE_NEAR_YOUR_PRECISE_LOCATION

```
public static final int TEXT_TYPE_NEAR_YOUR_PRECISE_LOCATION
```

### TEXT_TYPE_NONE

```
public static final int TEXT_TYPE_NONE
```

### TEXT_TYPE_PRECISE_LOCATION

```
public static final int TEXT_TYPE_PRECISE_LOCATION
```

### TEXT_TYPE_SHARE_PRECISE_LOCATION

```
public static final int TEXT_TYPE_SHARE_PRECISE_LOCATION
```

### TEXT_TYPE_USE_PRECISE_LOCATION

```
public static final int TEXT_TYPE_USE_PRECISE_LOCATION
```

## Public constructors

### LocationButton

Added in [1.0.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core-locationbutton.md.txt#1.0.0-alpha01)

```
public LocationButton(
    @NonNull Context context,
    AttributeSet attrs,
    int defStyleAttr,
    int defStyleRes
)
```

## Public methods

### addView

```
public void addView(View child)
```

### addView

```
public void addView(View child, int index)
```

### addView

```
public void addView(View child, ViewGroup.LayoutParams params)
```

### addView

```
public void addView(View child, int index, ViewGroup.LayoutParams params)
```

### addView

```
public void addView(View child, int width, int height)
```

### getCompositionOrder

Added in [1.0.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core-locationbutton.md.txt#1.0.0-alpha01)

```
public final int getCompositionOrder()
```

Gets the composition order of the underlying SurfaceView.

| Returns |
|---|---|
| `int` | The exact Z-order integer. |

### getParentActivity

Added in [1.0.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core-locationbutton.md.txt#1.0.0-alpha01)

```
public final Activity getParentActivity()
```

The `Activity` that hosts this button.

This activity is used to host the location button. If not explicitly set, the library will attempt to resolve the hosting activity by traversing the `Context` wrapper chain of the context passed to the constructor.

### setBackgroundColor

```
public void setBackgroundColor(int color)
```

### setCompositionOrder

Added in [1.0.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core-locationbutton.md.txt#1.0.0-alpha01)

```
public final void setCompositionOrder(int order)
```

Controls the composition order of the underlying SurfaceView.

By default, this is set on Top in Z-order, as this button is a secure system component.

- For developers migrating from legacy SurfaceView APIs:

<!-- -->

- `setZOrderOnTop(true)` is equivalent to passing `1`.

- `setZOrderOnTop(false)` is equivalent to passing `-2`.

<!-- -->

- See also [SurfaceView.setCompositionOrder](https://developer.android.com/reference/android/view/SurfaceView.md.txt#setCompositionOrder(int)) for reference.

| Parameters |
|---|---|
| `int order` | The exact Z-order integer. Default is 1 (on top of the app window). |

### setCornerRadius

Added in [1.0.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core-locationbutton.md.txt#1.0.0-alpha01)

```
public final void setCornerRadius(float radius)
```

Sets the corner radius of the button background.

| Parameters |
|---|---|
| `float radius` | The desired corner radius in pixels. |

### setIconTint

Added in [1.0.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core-locationbutton.md.txt#1.0.0-alpha01)

```
public final void setIconTint(int color)
```

Sets the color tint applied to the location icon.

| Parameters |
|---|---|
| `int color` | The resolved ARGB color integer. |

### setOnErrorListener

Added in [1.0.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core-locationbutton.md.txt#1.0.0-alpha01)

```
public final void setOnErrorListener(OnErrorListener listener)
```

Sets the listener to receive remote session errors on `Build.VERSION_CODES.CINNAMON_BUN` and above platforms.

| Parameters |
|---|---|
| `OnErrorListener listener` | The `OnErrorListener` that will handle callbacks, or null to clear a previously set listener. |

### setOnPermissionResultListener

Added in [1.0.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core-locationbutton.md.txt#1.0.0-alpha01)

```
public final void setOnPermissionResultListener(OnPermissionResultListener listener)
```

Sets the listener to receive permission results.

**Note:** On platforms before `Build.VERSION_CODES.CINNAMON_BUN`, if you rely on the default permission request flow (i.e. you do not provide a custom `OnRequestPermissionsListener`), the hosting `Activity` must implement `androidx.activity.result.ActivityResultRegistryOwner` and the `LocationButton` must have an `android:id` to deliver the permission result to this listener.

| Parameters |
|---|---|
| `OnPermissionResultListener listener` | The `OnPermissionResultListener` that will handle callbacks, or null to clear a previously set listener. |

### setOnRequestPermissionsListener

Added in [1.0.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core-locationbutton.md.txt#1.0.0-alpha01)

```
public final void setOnRequestPermissionsListener(OnRequestPermissionsListener listener)
```

Sets the listener to handle permission requests on platforms before `Build.VERSION_CODES.CINNAMON_BUN`.

Provide this listener if you want to customize the permission request flow (e.g. to show rationale) or if the hosting `Activity` does not implement `androidx.activity.result.ActivityResultRegistryOwner` on platforms before `Build.VERSION_CODES.CINNAMON_BUN`.

| Parameters |
|---|---|
| `OnRequestPermissionsListener listener` | The `OnRequestPermissionsListener` that will handle callbacks, or null to clear a previously set listener. |

### setPadding

```
public void setPadding(int left, int top, int right, int bottom)
```

### setPaddingRelative

```
public void setPaddingRelative(int start, int top, int end, int bottom)
```

### setParentActivity

Added in [1.0.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core-locationbutton.md.txt#1.0.0-alpha01)

```
public final void setParentActivity(Activity value)
```

The `Activity` that hosts this button.

This activity is used to host the location button. If not explicitly set, the library will attempt to resolve the hosting activity by traversing the `Context` wrapper chain of the context passed to the constructor.

### setPressedCornerRadius

Added in [1.0.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core-locationbutton.md.txt#1.0.0-alpha01)

```
public final void setPressedCornerRadius(float radius)
```

Sets the corner radius of the button background when the user presses it.

| Parameters |
|---|---|
| `float radius` | The desired pressed-state corner radius in pixels. |

### setStrokeColor

Added in [1.0.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core-locationbutton.md.txt#1.0.0-alpha01)

```
public final void setStrokeColor(int color)
```

Sets the width of the button's outer stroke border.

| Parameters |
|---|---|
| `int color` | The resolved ARGB color integer. |

### setStrokeWidth

Added in [1.0.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core-locationbutton.md.txt#1.0.0-alpha01)

```
public final void setStrokeWidth(int strokeWidth)
```

Sets the width of the button's outer stroke border.

| Parameters |
|---|---|
| `int strokeWidth` | The desired stroke width in pixels. |

### setTextColor

Added in [1.0.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core-locationbutton.md.txt#1.0.0-alpha01)

```
public final void setTextColor(int color)
```

Sets the color of the text displayed inside the button.

| Parameters |
|---|---|
| `int color` | The resolved ARGB color integer. |

### setTextType

Added in [1.0.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core-locationbutton.md.txt#1.0.0-alpha01)

```
public final void setTextType(int textType)
```

Sets the text content displayed inside the button.

| Parameters |
|---|---|
| `int textType` | The predefined `LocationButtonTextType` identifier. Value is one of the following: - `0` - `1` - `2` - `3` - `4` - `5` <br /> |

## Protected methods

### addViewInLayout

```
protected boolean addViewInLayout(View child, int index, ViewGroup.LayoutParams params)
```

### onAttachedToWindow

```
protected void onAttachedToWindow()
```

### onConfigurationChanged

```
protected void onConfigurationChanged(Configuration newConfig)
```

### onDetachedFromWindow

```
protected void onDetachedFromWindow()
```

### onLayout

```
protected void onLayout(boolean changed, int left, int top, int right, int bottom)
```

### onMeasure

```
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
```

### onSizeChanged

```
protected void onSizeChanged(int w, int h, int oldw, int oldh)
```

## Extension functions

### LocationButtonCompat.setLocationButtonProvider

Artifact: [androidx.core.locationbutton:locationbutton](https://developer.android.com/jetpack/androidx/releases/core-locationbutton.md.txt) [View Source](https://cs.android.com/search?q=file:androidx/core/locationbutton/LocationButtonCompat.kt+function:setLocationButtonProvider)

```
@RequiresApi(value = 37)
public final void LocationButtonCompat.setLocationButtonProvider(
    @NonNull LocationButton receiver,
    LocationButtonProvider provider
)
```

Sets the `LocationButtonProvider` to provide a location button.

| Parameters |
|---|---|
| `LocationButtonProvider provider` | The `LocationButtonProvider` to use, or null to clear. |