text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta content="IE=edge" http-equiv="X-UA-Compatible">

<link rel="shortcut icon" type="image/x-icon" href="../../../../../favicon.ico" />
<title>ViewCompat - Android SDK | Android Developers</title>

<link rel="stylesheet"
href="http://fonts.googleapis.com/css?family=Roboto+Condensed">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:light,regular,medium,thin,italic,mediumitalic,bold"
  title="roboto">

<link href="../../../../../assets/css/default.css?v=7" rel="stylesheet" type="text/css">

<link href="../../../../../assets/css/fullscreen.css" rel="stylesheet" class="fullscreen"
type="text/css">

           Developers

ViewCompat - Android SDK

      <form class="dac-header-search-form" onsubmit="return submit_search()">
        <input id="search_autocomplete" type="text" value="" autocomplete="off" name="q"
          onfocus="search_focus_changed(this, true)" onblur="search_focus_changed(this, false)"
          onkeydown="return search_changed(event, true, '../../../../../')"
          onkeyup="return search_changed(event, false, '../../../../../')"
          class="dac-header-search-input" placeholder="Search" />
          close
      </form>

          Developer
          Console

Results

Loading...

           Developers

        Home

            Android

            Wear

            TV

            Auto

        Design

        Develop

            Training

            API Guides

            Reference

            Tools

            Google Services

            Preview

        Distribute

            Google Play

            Essentials

            Get Users

            Engage & Retain

            Earn

            Analyze

            Stories

          API level:

            <select id="apiLevelSelector">

            </select>

Android APIs

  android

  android.accessibilityservice

  android.accounts

  android.animation

  android.annotation

  android.app

  android.app.admin

  android.app.assist

  android.app.backup

  android.app.job

  android.app.usage

  android.appwidget

  android.bluetooth

  android.bluetooth.le

  android.content

  android.content.pm

  android.content.res

  android.database

  android.database.sqlite

  android.databinding

  android.drm

  android.gesture

  android.graphics

  android.graphics.drawable

  android.graphics.drawable.shapes

  android.graphics.pdf

  android.hardware

  android.hardware.camera2

  android.hardware.camera2.params

  android.hardware.display

  android.hardware.fingerprint

  android.hardware.input

  android.hardware.usb

  android.inputmethodservice

  android.location

  android.media

  android.media.audiofx

  android.media.browse

  android.media.effect

  android.media.midi

  android.media.projection

  android.media.session

  android.media.tv

  android.mtp

  android.net

  android.net.http

  android.net.nsd

  android.net.rtp

  android.net.sip

  android.net.wifi

  android.net.wifi.p2p

  android.net.wifi.p2p.nsd

  android.nfc

  android.nfc.cardemulation

  android.nfc.tech

  android.opengl

  android.os

  android.os.storage

  android.preference

  android.print

  android.print.pdf

  android.printservice

  android.provider

  android.renderscript

  android.sax

  android.security

  android.security.keystore

  android.service.carrier

  android.service.chooser

  android.service.dreams

  android.service.media

  android.service.notification

  android.service.restrictions

  android.service.textservice

  android.service.voice

  android.service.wallpaper

  android.speech

  android.speech.tts

  android.support.annotation

  android.support.app.recommendation

  android.support.customtabs

  android.support.design

  android.support.design.widget

  android.support.multidex

  android.support.percent

  android.support.v13.app

  android.support.v14.preference

  android.support.v17.leanback

  android.support.v17.leanback.app

  android.support.v17.leanback.database

  android.support.v17.leanback.graphics

  android.support.v17.leanback.system

  android.support.v17.leanback.widget

  android.support.v17.preference

  android.support.v4.accessibilityservice

  android.support.v4.animation

  android.support.v4.app

  android.support.v4.content

  android.support.v4.content.pm

  android.support.v4.content.res

  android.support.v4.database

  android.support.v4.graphics

  android.support.v4.graphics.drawable

  android.support.v4.hardware.display

  android.support.v4.hardware.fingerprint

  android.support.v4.media

  android.support.v4.media.session

  android.support.v4.net

  android.support.v4.os

  android.support.v4.print

  android.support.v4.provider

  android.support.v4.text

  android.support.v4.util

  android.support.v4.view

  android.support.v4.view.accessibility

  android.support.v4.view.animation

  android.support.v4.widget

  android.support.v7.app

  android.support.v7.appcompat

  android.support.v7.cardview

  android.support.v7.graphics

  android.support.v7.graphics.drawable

  android.support.v7.gridlayout

  android.support.v7.media

  android.support.v7.mediarouter

  android.support.v7.preference

  android.support.v7.recyclerview

  android.support.v7.util

  android.support.v7.view

  android.support.v7.widget

  android.support.v7.widget.helper

  android.support.v7.widget.util

  android.support.v8.renderscript

  android.system

  android.telecom

  android.telephony

  android.telephony.cdma

  android.telephony.gsm

  android.test

  android.test.mock

  android.test.suitebuilder

  android.test.suitebuilder.annotation

  android.text

  android.text.format

  android.text.method

  android.text.style

  android.text.util

  android.transition

  android.util

  android.view

  android.view.accessibility

  android.view.animation

  android.view.inputmethod

  android.view.textservice

  android.webkit

  android.widget

  com.android.internal.backup

  com.android.internal.logging

  com.android.internal.os

  com.android.internal.statusbar

  com.android.internal.widget

  com.android.test.runner

  dalvik.annotation

  dalvik.bytecode

  dalvik.system

  java.awt.font

  java.beans

  java.io

  java.lang

  java.lang.annotation

  java.lang.ref

  java.lang.reflect

  java.math

  java.net

  java.nio

  java.nio.channels

  java.nio.channels.spi

  java.nio.charset

  java.nio.charset.spi

  java.security

  java.security.acl

  java.security.cert

  java.security.interfaces

  java.security.spec

  java.sql

  java.text

  java.util

  java.util.concurrent

  java.util.concurrent.atomic

  java.util.concurrent.locks

  java.util.jar

  java.util.logging

  java.util.prefs

  java.util.regex

  java.util.zip

  javax.crypto

  javax.crypto.interfaces

  javax.crypto.spec

  javax.microedition.khronos.egl

  javax.microedition.khronos.opengles

  javax.net

  javax.net.ssl

  javax.security.auth

  javax.security.auth.callback

  javax.security.auth.login

  javax.security.auth.x500

  javax.security.cert

  javax.sql

  javax.xml

  javax.xml.datatype

  javax.xml.namespace

  javax.xml.parsers

  javax.xml.transform

  javax.xml.transform.dom

  javax.xml.transform.sax

  javax.xml.transform.stream

  javax.xml.validation

  javax.xml.xpath

  junit.framework

  junit.runner

  org.apache.http.conn

  org.apache.http.conn.scheme

  org.apache.http.conn.ssl

  org.apache.http.params

  org.json

  org.w3c.dom

  org.w3c.dom.ls

  org.xml.sax

  org.xml.sax.ext

  org.xml.sax.helpers

  org.xmlpull.v1

  org.xmlpull.v1.sax2

Interfaces

ActionProvider.VisibilityListener

LayoutInflaterFactory

MenuItemCompat.OnActionExpandListener

NestedScrollingChild

NestedScrollingParent

OnApplyWindowInsetsListener

ScrollingView

TintableBackgroundView

ViewPager.OnPageChangeListener

ViewPager.PageTransformer

ViewPropertyAnimatorListener

ViewPropertyAnimatorUpdateListener

Classes

AccessibilityDelegateCompat

ActionProvider

GestureDetectorCompat

GravityCompat

InputDeviceCompat

KeyEventCompat

LayoutInflaterCompat

MarginLayoutParamsCompat

MenuCompat

MenuItemCompat

MotionEventCompat

NestedScrollingChildHelper

NestedScrollingParentHelper

PagerAdapter

PagerTabStrip

PagerTitleStrip

ScaleGestureDetectorCompat

VelocityTrackerCompat

ViewCompat

ViewConfigurationCompat

ViewGroupCompat

ViewPager

ViewPager.LayoutParams

ViewPager.SavedState

ViewPager.SimpleOnPageChangeListener

ViewParentCompat

ViewParentCompatICS

ViewPropertyAnimatorCompat

ViewPropertyAnimatorListenerAdapter

WindowCompat

WindowInsetsCompat

      fullscreen
      Use Tree NavigationUse Panel Navigation

Summary:

  XML Attrs

  | Constants

  | Ctors

  | Methods

  | Inherited Methods

| [Expand All]

    public

    class

ViewCompat

    extends Object

        java.lang.Object

               ↳

        android.support.v4.view.ViewCompat

Class Overview

Helper for accessing features in View introduced after API
 level 4 in a backwards compatible fashion.

Summary

XML Attributes

        <nobr>Attribute Name</nobr>
        <nobr>Related Method</nobr>
        <nobr>Description</nobr>

        android:translationY

            setTranslationY(View,float)

          translation in y of the view.

Constants

        int
        ACCESSIBILITY_LIVE_REGION_ASSERTIVE

          Live region mode specifying that accessibility services should interrupt
 ongoing speech to immediately announce changes to this view.

        int
        ACCESSIBILITY_LIVE_REGION_NONE

          Live region mode specifying that accessibility services should not
 automatically announce changes to this view.

        int
        ACCESSIBILITY_LIVE_REGION_POLITE

          Live region mode specifying that accessibility services should announce
 changes to this view.

        int
        IMPORTANT_FOR_ACCESSIBILITY_AUTO

          Automatically determine whether a view is important for accessibility.

        int
        IMPORTANT_FOR_ACCESSIBILITY_NO

          The view is not important for accessibility.

        int
        IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS

          The view is not important for accessibility, nor are any of its
 descendant views.

        int
        IMPORTANT_FOR_ACCESSIBILITY_YES

          The view is important for accessibility.

        int
        LAYER_TYPE_HARDWARE

Indicates that the view has a hardware layer.

        int
        LAYER_TYPE_NONE

          Indicates that the view does not have a layer.

        int
        LAYER_TYPE_SOFTWARE

Indicates that the view has a software layer.

        int
        LAYOUT_DIRECTION_INHERIT

          Horizontal layout direction of this view is inherited from its parent.

        int
        LAYOUT_DIRECTION_LOCALE

          Horizontal layout direction of this view is from deduced from the default language
 script for the locale.

        int
        LAYOUT_DIRECTION_LTR

          Horizontal layout direction of this view is from Left to Right.

        int
        LAYOUT_DIRECTION_RTL

          Horizontal layout direction of this view is from Right to Left.

        int
        MEASURED_HEIGHT_STATE_SHIFT

          Bit shift of MEASURED_STATE_MASK to get to the height bits
 for functions that combine both width and height into a single int,
 such as getMeasuredState(View) and the childState argument of
 resolveSizeAndState(int, int, int).

        int
        MEASURED_SIZE_MASK

          Bits of getMeasuredWidthAndState(View) and
 getMeasuredWidthAndState(View) that provide the actual measured size.

        int
        MEASURED_STATE_MASK

          Bits of getMeasuredWidthAndState(View) and
 getMeasuredWidthAndState(View) that provide the additional state bits.

        int
        MEASURED_STATE_TOO_SMALL

          Bit of getMeasuredWidthAndState(View) and
 getMeasuredWidthAndState(View) that indicates the measured size
 is smaller that the space the view would like to have.

        int
        OVER_SCROLL_ALWAYS

          Always allow a user to over-scroll this view, provided it is a
 view that can scroll.

        int
        OVER_SCROLL_IF_CONTENT_SCROLLS

          Allow a user to over-scroll this view only if the content is large
 enough to meaningfully scroll, provided it is a view that can scroll.

        int
        OVER_SCROLL_NEVER

          Never allow a user to over-scroll this view.

        int
        SCROLL_AXIS_HORIZONTAL

          Indicates scrolling along the horizontal axis.

        int
        SCROLL_AXIS_NONE

          Indicates no axis of view scrolling.

        int
        SCROLL_AXIS_VERTICAL

          Indicates scrolling along the vertical axis.

Public Constructors

        <nobr>

            </nobr>

        <nobr>
        ViewCompat()</nobr>

Public Methods

        <nobr>

            static

            ViewPropertyAnimatorCompat</nobr>

        <nobr>
        animate(View view)</nobr>

          This method returns a ViewPropertyAnimator object, which can be used to animate
 specific properties on this View.

        <nobr>

            static

            boolean</nobr>

        <nobr>
        canScrollHorizontally(View v, int direction)</nobr>

          Check if this view can be scrolled horizontally in a certain direction.

        <nobr>

            static

            boolean</nobr>

        <nobr>
        canScrollVertically(View v, int direction)</nobr>

          Check if this view can be scrolled vertically in a certain direction.

        <nobr>

            static

            int</nobr>

        <nobr>
        combineMeasuredStates(int curState, int newState)</nobr>

          Merge two states as returned by getMeasuredState(View).

        <nobr>

            static

            WindowInsetsCompat</nobr>

        <nobr>
        dispatchApplyWindowInsets(View view, WindowInsetsCompat insets)</nobr>

          Request to apply the given window insets to this view or another view in its subtree.

        <nobr>

            static

            void</nobr>

        <nobr>
        dispatchFinishTemporaryDetach(View view)</nobr>

          Notify a view that its temporary detach has ended; the view is now reattached.

        <nobr>

            static

            boolean</nobr>

        <nobr>
        dispatchNestedFling(View view, float velocityX, float velocityY, boolean consumed)</nobr>

          Dispatch a fling to a nested scrolling parent.

        <nobr>

            static

            boolean</nobr>

        <nobr>
        dispatchNestedPreFling(View view, float velocityX, float velocityY)</nobr>

          Dispatch a fling to a nested scrolling parent before it is processed by this view.

        <nobr>

            static

            boolean</nobr>

        <nobr>
        dispatchNestedPreScroll(View view, int dx, int dy, int[] consumed, int[] offsetInWindow)</nobr>

          Dispatch one step of a nested scroll in progress before this view consumes any portion of it.

        <nobr>

            static

            boolean</nobr>

        <nobr>
        dispatchNestedScroll(View view, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int[] offsetInWindow)</nobr>

          Dispatch one step of a nested scroll in progress.

        <nobr>

            static

            void</nobr>

        <nobr>
        dispatchStartTemporaryDetach(View view)</nobr>

          Notify a view that it is being temporarily detached.

        <nobr>

            static

            int</nobr>

        <nobr>
        getAccessibilityLiveRegion(View view)</nobr>

          Gets the live region mode for the specified View.

        <nobr>

            static

            AccessibilityNodeProviderCompat</nobr>

        <nobr>
        getAccessibilityNodeProvider(View view)</nobr>

          Gets the provider for managing a virtual view hierarchy rooted at this View
 and reported to AccessibilityServices
 that explore the window content.

        <nobr>

            static

            float</nobr>

        <nobr>
        getAlpha(View view)</nobr>

          The opacity of the view.

        <nobr>

            static

            ColorStateList</nobr>

        <nobr>
        getBackgroundTintList(View view)</nobr>

          Return the tint applied to the background drawable, if specified.

        <nobr>

            static

            PorterDuff.Mode</nobr>

        <nobr>
        getBackgroundTintMode(View view)</nobr>

          Return the blending mode used to apply the tint to the background
 drawable, if specified.

        <nobr>

            static

            Rect</nobr>

        <nobr>
        getClipBounds(View view)</nobr>

          Returns a copy of the current setClipBounds(View, Rect).

        <nobr>

            static

            float</nobr>

        <nobr>
        getElevation(View view)</nobr>

          The base elevation of this view relative to its parent, in pixels.

        <nobr>

            static

            boolean</nobr>

        <nobr>
        getFitsSystemWindows(View v)</nobr>

          Returns true if this view should adapt to fit system window insets.

        <nobr>

            static

            int</nobr>

        <nobr>
        getImportantForAccessibility(View view)</nobr>

          Gets the mode for determining whether this View is important for accessibility
 which is if it fires accessibility events and if it is reported to
 accessibility services that query the screen.

        <nobr>

            static

            int</nobr>

        <nobr>
        getLabelFor(View view)</nobr>

          Gets the id of a view for which a given view serves as a label for
 accessibility purposes.

        <nobr>

            static

            int</nobr>

        <nobr>
        getLayerType(View view)</nobr>

          Indicates what type of layer is currently associated with this view.

        <nobr>

            static

            int</nobr>

        <nobr>
        getLayoutDirection(View view)</nobr>

          Returns the resolved layout direction for this view.

        <nobr>

            static

            int</nobr>

        <nobr>
        getMeasuredHeightAndState(View view)</nobr>

          Return the full height measurement information for this view as computed
 by the most recent call to measure(int, int).

        <nobr>

            static

            int</nobr>

        <nobr>
        getMeasuredState(View view)</nobr>

          Return only the state bits of getMeasuredWidthAndState(View)
 and getMeasuredHeightAndState(View), combined into one integer.

        <nobr>

            static

            int</nobr>

        <nobr>
        getMeasuredWidthAndState(View view)</nobr>

          Return the full width measurement information for this view as computed
 by the most recent call to measure(int, int).

        <nobr>

            static

            int</nobr>

        <nobr>
        getMinimumHeight(View view)</nobr>

          Returns the minimum height of the view.

        <nobr>

            static

            int</nobr>

        <nobr>
        getMinimumWidth(View view)</nobr>

          Returns the minimum width of the view.

        <nobr>

            static

            int</nobr>

        <nobr>
        getOverScrollMode(View v)</nobr>

          Returns the over-scroll mode for this view.

        <nobr>

            static

            int</nobr>

        <nobr>
        getPaddingEnd(View view)</nobr>

          Returns the end padding of the specified view depending on its resolved layout direction.

        <nobr>

            static

            int</nobr>

        <nobr>
        getPaddingStart(View view)</nobr>

          Returns the start padding of the specified view depending on its resolved layout direction.

        <nobr>

            static

            ViewParent</nobr>

        <nobr>
        getParentForAccessibility(View view)</nobr>

          Gets the parent for accessibility purposes.

        <nobr>

            static

            float</nobr>

        <nobr>
        getPivotX(View view)</nobr>

          The x location of the point around which the view is
 rotated and scaled.

        <nobr>

            static

            float</nobr>

        <nobr>
        getPivotY(View view)</nobr>

          The y location of the point around which the view is rotated and scaled.

        <nobr>

            static

            float</nobr>

        <nobr>
        getRotation(View view)</nobr>

        <nobr>

            static

            float</nobr>

        <nobr>
        getRotationX(View view)</nobr>

        <nobr>

            static

            float</nobr>

        <nobr>
        getRotationY(View view)</nobr>

        <nobr>

            static

            float</nobr>

        <nobr>
        getScaleX(View view)</nobr>

        <nobr>

            static

            float</nobr>

        <nobr>
        getScaleY(View view)</nobr>

        <nobr>

            static

            String</nobr>

        <nobr>
        getTransitionName(View view)</nobr>

          Returns the name of the View to be used to identify Views in Transitions.

        <nobr>

            static

            float</nobr>

        <nobr>
        getTranslationX(View view)</nobr>

          The horizontal location of this view relative to its left position.

        <nobr>

            static

            float</nobr>

        <nobr>
        getTranslationY(View view)</nobr>

          The vertical location of this view relative to its left position.

        <nobr>

            static

            float</nobr>

        <nobr>
        getTranslationZ(View view)</nobr>

          The depth location of this view relative to its elevation.

        <nobr>

            static

            int</nobr>

        <nobr>
        getWindowSystemUiVisibility(View view)</nobr>

          Returns the current system UI visibility that is currently set for the entire window.

        <nobr>

            static

            float</nobr>

        <nobr>
        getX(View view)</nobr>

        <nobr>

            static

            float</nobr>

        <nobr>
        getY(View view)</nobr>

        <nobr>

            static

            float</nobr>

        <nobr>
        getZ(View view)</nobr>

          The visual z position of this view, in pixels.

        <nobr>

            static

            boolean</nobr>

        <nobr>
        hasAccessibilityDelegate(View v)</nobr>

          Checks whether provided View has an accessibility delegate attached to it.

        <nobr>

            static

            boolean</nobr>

        <nobr>
        hasNestedScrollingParent(View view)</nobr>

          Returns true if this view has a nested scrolling parent.

        <nobr>

            static

            boolean</nobr>

        <nobr>
        hasOverlappingRendering(View view)</nobr>

          Returns whether this View has content which overlaps.

        <nobr>

            static

            boolean</nobr>

        <nobr>
        hasTransientState(View view)</nobr>

          Indicates whether the view is currently tracking transient state that the
 app should not need to concern itself with saving and restoring, but that
 the framework should take special note to preserve when possible.

        <nobr>

            static

            boolean</nobr>

        <nobr>
        isAttachedToWindow(View view)</nobr>

          Returns true if the provided view is currently attached to a window.

        <nobr>

            static

            boolean</nobr>

        <nobr>
        isLaidOut(View view)</nobr>

          Returns true if view has been through at least one layout since it
 was last attached to or detached from a window.

        <nobr>

            static

            boolean</nobr>

        <nobr>
        isNestedScrollingEnabled(View view)</nobr>

          Returns true if nested scrolling is enabled for this view.

        <nobr>

            static

            boolean</nobr>

        <nobr>
        isOpaque(View view)</nobr>

          Indicates whether this View is opaque.

        <nobr>

            static

            boolean</nobr>

        <nobr>
        isPaddingRelative(View view)</nobr>

          Return if the padding as been set through relative values
 View.setPaddingRelative(int, int, int, int) or thru

        <nobr>

            static

            void</nobr>

        <nobr>
        jumpDrawablesToCurrentState(View v)</nobr>

          On API 11 devices and above, call Drawable.jumpToCurrentState()
 on all Drawable objects associated with this view.

        <nobr>

            static

            void</nobr>

        <nobr>
        offsetLeftAndRight(View view, int offset)</nobr>

          Offset this view's horizontal location by the specified amount of pixels.

        <nobr>

            static

            void</nobr>

        <nobr>
        offsetTopAndBottom(View view, int offset)</nobr>

          Offset this view's vertical location by the specified number of pixels.

        <nobr>

            static

            WindowInsetsCompat</nobr>

        <nobr>
        onApplyWindowInsets(View view, WindowInsetsCompat insets)</nobr>

          Called when the view should apply WindowInsetsCompat according to its internal policy.

        <nobr>

            static

            void</nobr>

        <nobr>
        onInitializeAccessibilityEvent(View v, AccessibilityEvent event)</nobr>

          Initializes an AccessibilityEvent with information about
 this View which is the event source.

        <nobr>

            static

            void</nobr>

        <nobr>
        onInitializeAccessibilityNodeInfo(View v, AccessibilityNodeInfoCompat info)</nobr>

          Initializes an AccessibilityNodeInfo with information
 about this view.

        <nobr>

            static

            void</nobr>

        <nobr>
        onPopulateAccessibilityEvent(View v, AccessibilityEvent event)</nobr>

          Called from dispatchPopulateAccessibilityEvent(AccessibilityEvent)
 giving a chance to this View to populate the accessibility event with its
 text content.

        <nobr>

            static

            boolean</nobr>

        <nobr>
        performAccessibilityAction(View view, int action, Bundle arguments)</nobr>

          Performs the specified accessibility action on the view.

        <nobr>

            static

            void</nobr>

        <nobr>
        postInvalidateOnAnimation(View view)</nobr>

Cause an invalidate to happen on the next animation time step, typically the
 next display frame.

        <nobr>

            static

            void</nobr>

        <nobr>
        postInvalidateOnAnimation(View view, int left, int top, int right, int bottom)</nobr>

Cause an invalidate of the specified area to happen on the next animation
 time step, typically the next display frame.

        <nobr>

            static

            void</nobr>

        <nobr>
        postOnAnimation(View view, Runnable action)</nobr>

Causes the Runnable to execute on the next animation time step.

        <nobr>

            static

            void</nobr>

        <nobr>
        postOnAnimationDelayed(View view, Runnable action, long delayMillis)</nobr>

Causes the Runnable to execute on the next animation time step,
 after the specified amount of time elapses.

        <nobr>

            static

            void</nobr>

        <nobr>
        requestApplyInsets(View view)</nobr>

          Ask that a new dispatch of View.onApplyWindowInsets(WindowInsets) be performed.

        <nobr>

            static

            int</nobr>

        <nobr>
        resolveSizeAndState(int size, int measureSpec, int childMeasuredState)</nobr>

          Utility to reconcile a desired size and state, with constraints imposed
 by a MeasureSpec.

        <nobr>

            static

            void</nobr>

        <nobr>
        setAccessibilityDelegate(View v, AccessibilityDelegateCompat delegate)</nobr>

          Sets a delegate for implementing accessibility support via compositon as
 opposed to inheritance.

        <nobr>

            static

            void</nobr>

        <nobr>
        setAccessibilityLiveRegion(View view, int mode)</nobr>

          Sets the live region mode for the specified view.

        <nobr>

            static

            void</nobr>

        <nobr>
        setActivated(View view, boolean activated)</nobr>

          Changes the activated state of this view.

        <nobr>

            static

            void</nobr>

        <nobr>
        setAlpha(View view, float value)</nobr>

Sets the opacity of the view.

        <nobr>

            static

            void</nobr>

        <nobr>
        setBackgroundTintList(View view, ColorStateList tintList)</nobr>

          Applies a tint to the background drawable.

        <nobr>

            static

            void</nobr>

        <nobr>
        setBackgroundTintMode(View view, PorterDuff.Mode mode)</nobr>

          Specifies the blending mode used to apply the tint specified by
 setBackgroundTintList(android.view.View, android.content.res.ColorStateList) to
 the background drawable.

        <nobr>

            static

            void</nobr>

        <nobr>
        setChildrenDrawingOrderEnabled(ViewGroup viewGroup, boolean enabled)</nobr>

          Tells the ViewGroup whether to draw its children in the order defined by the method
 ViewGroup.getChildDrawingOrder(int, int).

        <nobr>

            static

            void</nobr>

        <nobr>
        setClipBounds(View view, Rect clipBounds)</nobr>

          Sets a rectangular area on this view to which the view will be clipped
 when it is drawn.

        <nobr>

            static

            void</nobr>

        <nobr>
        setElevation(View view, float elevation)</nobr>

          Sets the base elevation of this view, in pixels.

        <nobr>

            static

            void</nobr>

        <nobr>
        setFitsSystemWindows(View view, boolean fitSystemWindows)</nobr>

          Sets whether or not this view should account for system screen decorations
 such as the status bar and inset its content; that is, controlling whether
 the default implementation of fitSystemWindows(Rect) will be
 executed.

        <nobr>

            static

            void</nobr>

        <nobr>
        setHasTransientState(View view, boolean hasTransientState)</nobr>

          Set whether this view is currently tracking transient state that the
 framework should attempt to preserve when possible.

        <nobr>

            static

            void</nobr>

        <nobr>
        setImportantForAccessibility(View view, int mode)</nobr>

          Sets how to determine whether this view is important for accessibility
 which is if it fires accessibility events and if it is reported to
 accessibility services that query the screen.

        <nobr>

            static

            void</nobr>

        <nobr>
        setLabelFor(View view, int labeledId)</nobr>

          Sets the id of a view for which a given view serves as a label for
 accessibility purposes.

        <nobr>

            static

            void</nobr>

        <nobr>
        setLayerPaint(View view, Paint paint)</nobr>

          Updates the Paint object used with the current layer (used only if the current
 layer type is not set to LAYER_TYPE_NONE).

        <nobr>

            static

            void</nobr>

        <nobr>
        setLayerType(View view, int layerType, Paint paint)</nobr>

Specifies the type of layer backing this view.

        <nobr>

            static

            void</nobr>

        <nobr>
        setLayoutDirection(View view, int layoutDirection)</nobr>

          Set the layout direction for this view.

        <nobr>

            static

            void</nobr>

        <nobr>
        setNestedScrollingEnabled(View view, boolean enabled)</nobr>

          Enable or disable nested scrolling for this view.

        <nobr>

            static

            void</nobr>

        <nobr>
        setOnApplyWindowInsetsListener(View v, OnApplyWindowInsetsListener listener)</nobr>

          Set an OnApplyWindowInsetsListener to take over the policy for applying
 window insets to this view.

        <nobr>

            static

            void</nobr>

        <nobr>
        setOverScrollMode(View v, int overScrollMode)</nobr>

          Set the over-scroll mode for this view.

        <nobr>

            static

            void</nobr>

        <nobr>
        setPaddingRelative(View view, int start, int top, int end, int bottom)</nobr>

          Sets the relative padding.

        <nobr>

            static

            void</nobr>

        <nobr>
        setPivotX(View view, float value)</nobr>

          Sets the x location of the point around which the view is
 rotated and scaled.

        <nobr>

            static

            void</nobr>

        <nobr>
        setPivotY(View view, float value)</nobr>

          Sets the y location of the point around which the view is
 rotated and scaled.

        <nobr>

            static

            void</nobr>

        <nobr>
        setRotation(View view, float value)</nobr>

          Sets the degrees that the view is rotated around the pivot point.

        <nobr>

            static

            void</nobr>

        <nobr>
        setRotationX(View view, float value)</nobr>

          Sets the degrees that the view is rotated around the horizontal axis through the pivot point.

        <nobr>

            static

            void</nobr>

        <nobr>
        setRotationY(View view, float value)</nobr>

          Sets the degrees that the view is rotated around the vertical axis through the pivot point.

        <nobr>

            static

            void</nobr>

        <nobr>
        setSaveFromParentEnabled(View v, boolean enabled)</nobr>

          Controls whether the entire hierarchy under this view will save its
 state when a state saving traversal occurs from its parent.

        <nobr>

            static

            void</nobr>

        <nobr>
        setScaleX(View view, float value)</nobr>

          Sets the amount that the view is scaled in x around the pivot point, as a proportion of
 the view's unscaled width.

        <nobr>

            static

            void</nobr>

        <nobr>
        setScaleY(View view, float value)</nobr>

          Sets the amount that the view is scaled in Y around the pivot point, as a proportion of
 the view's unscaled width.

        <nobr>

            static

            void</nobr>

        <nobr>
        setTransitionName(View view, String transitionName)</nobr>

          Sets the name of the View to be used to identify Views in Transitions.

        <nobr>

            static

            void</nobr>

        <nobr>
        setTranslationX(View view, float value)</nobr>

          Sets the horizontal location of this view relative to its left position.

        <nobr>

            static

            void</nobr>

        <nobr>
        setTranslationY(View view, float value)</nobr>

          Sets the vertical location of this view relative to its top position.

        <nobr>

            static

            void</nobr>

        <nobr>
        setTranslationZ(View view, float translationZ)</nobr>

          Sets the depth location of this view relative to its elevation.

        <nobr>

            static

            void</nobr>

        <nobr>
        setX(View view, float value)</nobr>

          Sets the visual x position of this view, in pixels.

        <nobr>

            static

            void</nobr>

        <nobr>
        setY(View view, float value)</nobr>

          Sets the visual y position of this view, in pixels.

        <nobr>

            static

            boolean</nobr>

        <nobr>
        startNestedScroll(View view, int axes)</nobr>

          Begin a nestable scroll operation along the given axes.

        <nobr>

            static

            void</nobr>

        <nobr>
        stopNestedScroll(View view)</nobr>

          Stop a nested scroll in progress.

  [Expand]

Inherited Methods

From class

  java.lang.Object

        <nobr>

            Object</nobr>

        <nobr>
        clone()</nobr>

          Creates and returns a copy of this Object.

        <nobr>

            boolean</nobr>

        <nobr>
        equals(Object o)</nobr>

          Compares this instance with the specified object and indicates if they
 are equal.

        <nobr>

            void</nobr>

        <nobr>
        finalize()</nobr>

          Invoked when the garbage collector has detected that this instance is no longer reachable.

        <nobr>

            final

            Class<?></nobr>

        <nobr>
        getClass()</nobr>

          Returns the unique instance of Class that represents this
 object's class.

        <nobr>

            int</nobr>

        <nobr>
        hashCode()</nobr>

          Returns an integer hash code for this object.

        <nobr>

            final

            void</nobr>

        <nobr>
        notify()</nobr>

          Causes a thread which is waiting on this object's monitor (by means of
 calling one of the wait() methods) to be woken up.

        <nobr>

            final

            void</nobr>

        <nobr>
        notifyAll()</nobr>

          Causes all threads which are waiting on this object's monitor (by means
 of calling one of the wait() methods) to be woken up.

        <nobr>

            String</nobr>

        <nobr>
        toString()</nobr>

          Returns a string containing a concise, human-readable description of this
 object.

        <nobr>

            final

            void</nobr>

        <nobr>
        wait()</nobr>

          Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

        <nobr>

            final

            void</nobr>

        <nobr>
        wait(long millis, int nanos)</nobr>

          Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
 specified timeout expires.

        <nobr>

            final

            void</nobr>

        <nobr>
        wait(long millis)</nobr>

          Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
 specified timeout expires.

XML Attributes

android:translationY

translation in y of the view. This value is added post-layout to the top
             property of the view, which is set by its layout.

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.

This corresponds to the global attribute
          resource symbol translationY.

Related Methods

setTranslationY(View,float)

Constants

        public
        static
        final
        int

        ACCESSIBILITY_LIVE_REGION_ASSERTIVE

Live region mode specifying that accessibility services should interrupt
 ongoing speech to immediately announce changes to this view.

 Use with setAccessibilityLiveRegion(View, int).

        Constant Value:

                2
                (0x00000002)

        public
        static
        final
        int

        ACCESSIBILITY_LIVE_REGION_NONE

Live region mode specifying that accessibility services should not
 automatically announce changes to this view. This is the default live
 region mode for most views.

 Use with setAccessibilityLiveRegion(View, int).

        Constant Value:

                0
                (0x00000000)

        public
        static
        final
        int

        ACCESSIBILITY_LIVE_REGION_POLITE

Live region mode specifying that accessibility services should announce
 changes to this view.

 Use with setAccessibilityLiveRegion(View, int).

        Constant Value:

                1
                (0x00000001)

        public
        static
        final
        int

        IMPORTANT_FOR_ACCESSIBILITY_AUTO

Automatically determine whether a view is important for accessibility.

        Constant Value:

                0
                (0x00000000)

        public
        static
        final
        int

        IMPORTANT_FOR_ACCESSIBILITY_NO

The view is not important for accessibility.

        Constant Value:

                2
                (0x00000002)

        public
        static
        final
        int

        IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS

The view is not important for accessibility, nor are any of its
 descendant views.

        Constant Value:

                4
                (0x00000004)

        public
        static
        final
        int

        IMPORTANT_FOR_ACCESSIBILITY_YES

The view is important for accessibility.

        Constant Value:

                1
                (0x00000001)

        public
        static
        final
        int

        LAYER_TYPE_HARDWARE

Indicates that the view has a hardware layer. A hardware layer is backed
 by a hardware specific texture (generally Frame Buffer Objects or FBO on
 OpenGL hardware) and causes the view to be rendered using Android's hardware
 rendering pipeline, but only if hardware acceleration is turned on for the
 view hierarchy. When hardware acceleration is turned off, hardware layers
 behave exactly as software layers.

A hardware layer is useful to apply a specific color filter and/or
 blending mode and/or translucency to a view and all its children.

A hardware layer can be used to cache a complex view tree into a
 texture and reduce the complexity of drawing operations. For instance,
 when animating a complex view tree with a translation, a hardware layer can
 be used to render the view tree only once.

A hardware layer can also be used to increase the rendering quality when
 rotation transformations are applied on a view. It can also be used to
 prevent potential clipping issues when applying 3D transforms on a view.

        Constant Value:

                2
                (0x00000002)

        public
        static
        final
        int

        LAYER_TYPE_NONE

Indicates that the view does not have a layer.

        Constant Value:

                0
                (0x00000000)

        public
        static
        final
        int

        LAYER_TYPE_SOFTWARE

Indicates that the view has a software layer. A software layer is backed
 by a bitmap and causes the view to be rendered using Android's software
 rendering pipeline, even if hardware acceleration is enabled.

Software layers have various usages:

When the application is not using hardware acceleration, a software layer
 is useful to apply a specific color filter and/or blending mode and/or
 translucency to a view and all its children.

When the application is using hardware acceleration, a software layer
 is useful to render drawing primitives not supported by the hardware
 accelerated pipeline. It can also be used to cache a complex view tree
 into a texture and reduce the complexity of drawing operations. For instance,
 when animating a complex view tree with a translation, a software layer can
 be used to render the view tree only once.

Software layers should be avoided when the affected view tree updates
 often. Every update will require to re-render the software layer, which can
 potentially be slow (particularly when hardware acceleration is turned on
 since the layer will have to be uploaded into a hardware texture after every
 update.)

        Constant Value:

                1
                (0x00000001)

        public
        static
        final
        int

        LAYOUT_DIRECTION_INHERIT

Horizontal layout direction of this view is inherited from its parent.
 Use with setLayoutDirection(View, int).

        Constant Value:

                2
                (0x00000002)

        public
        static
        final
        int

        LAYOUT_DIRECTION_LOCALE

Horizontal layout direction of this view is from deduced from the default language
 script for the locale. Use with setLayoutDirection(View, int).

        Constant Value:

                3
                (0x00000003)

        public
        static
        final
        int

        LAYOUT_DIRECTION_LTR

Horizontal layout direction of this view is from Left to Right.

        Constant Value:

                0
                (0x00000000)

        public
        static
        final
        int

        LAYOUT_DIRECTION_RTL

Horizontal layout direction of this view is from Right to Left.

        Constant Value:

                1
                (0x00000001)

        public
        static
        final
        int

        MEASURED_HEIGHT_STATE_SHIFT

Bit shift of MEASURED_STATE_MASK to get to the height bits
 for functions that combine both width and height into a single int,
 such as getMeasuredState(View) and the childState argument of
 resolveSizeAndState(int, int, int).

        Constant Value:

                16
                (0x00000010)

        public
        static
        final
        int

        MEASURED_SIZE_MASK

Bits of getMeasuredWidthAndState(View) and
 getMeasuredWidthAndState(View) that provide the actual measured size.

        Constant Value:

                16777215
                (0x00ffffff)

        public
        static
        final
        int

        MEASURED_STATE_MASK

Bits of getMeasuredWidthAndState(View) and
 getMeasuredWidthAndState(View) that provide the additional state bits.

        Constant Value:

                -16777216
                (0xff000000)

        public
        static
        final
        int

        MEASURED_STATE_TOO_SMALL

Bit of getMeasuredWidthAndState(View) and
 getMeasuredWidthAndState(View) that indicates the measured size
 is smaller that the space the view would like to have.

        Constant Value:

                16777216
                (0x01000000)

        public
        static
        final
        int

        OVER_SCROLL_ALWAYS

Always allow a user to over-scroll this view, provided it is a
 view that can scroll.

        Constant Value:

                0
                (0x00000000)

        public
        static
        final
        int

        OVER_SCROLL_IF_CONTENT_SCROLLS

Allow a user to over-scroll this view only if the content is large
 enough to meaningfully scroll, provided it is a view that can scroll.

        Constant Value:

                1
                (0x00000001)

        public
        static
        final
        int

        OVER_SCROLL_NEVER

Never allow a user to over-scroll this view.

        Constant Value:

                2
                (0x00000002)

        public
        static
        final
        int

        SCROLL_AXIS_HORIZONTAL

Indicates scrolling along the horizontal axis.

        Constant Value:

                1
                (0x00000001)

        public
        static
        final
        int

        SCROLL_AXIS_NONE

Indicates no axis of view scrolling.

        Constant Value:

                0
                (0x00000000)

        public
        static
        final
        int

        SCROLL_AXIS_VERTICAL

Indicates scrolling along the vertical axis.

        Constant Value:

                2
                (0x00000002)

Public Constructors

        public

      ViewCompat
      ()

Public Methods

        public
        static

        ViewPropertyAnimatorCompat

      animate
      (View view)

This method returns a ViewPropertyAnimator object, which can be used to animate
 specific properties on this View.

Prior to API 14, this method will do nothing.

Returns

ViewPropertyAnimator The ViewPropertyAnimator associated with this View.

        public
        static

        boolean

      canScrollHorizontally
      (View v, int direction)

Check if this view can be scrolled horizontally in a certain direction.

Parameters

          v
          The View against which to invoke the method.

          direction
          Negative to check scrolling left, positive to check scrolling right.

Returns

true if this view can be scrolled in the specified direction, false otherwise.

        public
        static

        boolean

      canScrollVertically
      (View v, int direction)

Check if this view can be scrolled vertically in a certain direction.

Parameters

          v
          The View against which to invoke the method.

          direction
          Negative to check scrolling up, positive to check scrolling down.

Returns

true if this view can be scrolled in the specified direction, false otherwise.

        public
        static

        int

      combineMeasuredStates
      (int curState, int newState)

Merge two states as returned by getMeasuredState(View).

Parameters

          curState
          The current state as returned from a view or the result
 of combining multiple views.

          newState
          The new view state to combine.

Returns

Returns a new integer reflecting the combination of the two
 states.

        public
        static

        WindowInsetsCompat

      dispatchApplyWindowInsets
      (View view, WindowInsetsCompat insets)

Request to apply the given window insets to this view or another view in its subtree.

This method should be called by clients wishing to apply insets corresponding to areas
 obscured by window decorations or overlays. This can include the status and navigation bars,
 action bars, input methods and more. New inset categories may be added in the future.
 The method returns the insets provided minus any that were applied by this view or its
 children.

Parameters

          insets
          Insets to apply

Returns

The provided insets minus the insets that were consumed

        public
        static

        void

      dispatchFinishTemporaryDetach
      (View view)

Notify a view that its temporary detach has ended; the view is now reattached.

        public
        static

        boolean

      dispatchNestedFling
      (View view, float velocityX, float velocityY, boolean consumed)

Dispatch a fling to a nested scrolling parent.

This method should be used to indicate that a nested scrolling child has detected
 suitable conditions for a fling. Generally this means that a touch scroll has ended with a
 velocity in the direction of scrolling that meets or exceeds
 the minimum fling velocity
 along a scrollable axis.

If a nested scrolling child view would normally fling but it is at the edge of
 its own content, it can use this method to delegate the fling to its nested scrolling
 parent instead. The parent may optionally consume the fling or observe a child fling.

Parameters

          velocityX
          Horizontal fling velocity in pixels per second

          velocityY
          Vertical fling velocity in pixels per second

          consumed
          true if the child consumed the fling, false otherwise

Returns

true if the nested scrolling parent consumed or otherwise reacted to the fling

        public
        static

        boolean

      dispatchNestedPreFling
      (View view, float velocityX, float velocityY)

Dispatch a fling to a nested scrolling parent before it is processed by this view.

Nested pre-fling events are to nested fling events what touch intercept is to touch
 and what nested pre-scroll is to nested scroll. dispatchNestedPreFling
 offsets an opportunity for the parent view in a nested fling to fully consume the fling
 before the child view consumes it. If this method returns true, a nested
 parent view consumed the fling and this view should not scroll as a result.

For a better user experience, only one view in a nested scrolling chain should consume
 the fling at a time. If a parent view consumed the fling this method will return false.
 Custom view implementations should account for this in two ways:

If a custom view is paged and needs to settle to a fixed page-point, do not
     call dispatchNestedPreFling; consume the fling and settle to a valid
     position regardless.

If a nested parent does consume the fling, this view should not scroll at all,
     even to settle back to a valid idle position.

Views should also not offer fling velocities to nested parent views along an axis
 where scrolling is not currently supported; a ScrollView
 should not offer a horizontal fling velocity to its parents since scrolling along that
 axis is not permitted and carrying velocity along that motion does not make sense.

Parameters

          velocityX
          Horizontal fling velocity in pixels per second

          velocityY
          Vertical fling velocity in pixels per second

Returns

true if a nested scrolling parent consumed the fling

        public
        static

        boolean

      dispatchNestedPreScroll
      (View view, int dx, int dy, int[] consumed, int[] offsetInWindow)

Dispatch one step of a nested scroll in progress before this view consumes any portion of it.

Nested pre-scroll events are to nested scroll events what touch intercept is to touch.
 dispatchNestedPreScroll offers an opportunity for the parent view in a nested
 scrolling operation to consume some or all of the scroll operation before the child view
 consumes it.

Parameters

          dx
          Horizontal scroll distance in pixels

          dy
          Vertical scroll distance in pixels

          consumed
          Output. If not null, consumed[0] will contain the consumed component of dx
                 and consumed[1] the consumed dy.

          offsetInWindow
          Optional. If not null, on return this will contain the offset
                       in local view coordinates of this view from before this operation
                       to after it completes. View implementations may use this to adjust
                       expected input coordinate tracking.

Returns

true if the parent consumed some or all of the scroll delta

See Also

dispatchNestedScroll(View, int, int, int, int, int[])

        public
        static

        boolean

      dispatchNestedScroll
      (View view, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int[] offsetInWindow)

Dispatch one step of a nested scroll in progress.

Implementations of views that support nested scrolling should call this to report
 info about a scroll in progress to the current nested scrolling parent. If a nested scroll
 is not currently in progress or nested scrolling is not
 enabled for this view this method does nothing.

Compatible View implementations should also call
 dispatchNestedPreScroll before
 consuming a component of the scroll event themselves.

Parameters

          dxConsumed
          Horizontal distance in pixels consumed by this view during this scroll step

          dyConsumed
          Vertical distance in pixels consumed by this view during this scroll step

          dxUnconsumed
          Horizontal scroll distance in pixels not consumed by this view

          dyUnconsumed
          Horizontal scroll distance in pixels not consumed by this view

          offsetInWindow
          Optional. If not null, on return this will contain the offset
                       in local view coordinates of this view from before this operation
                       to after it completes. View implementations may use this to adjust
                       expected input coordinate tracking.

Returns

true if the event was dispatched, false if it could not be dispatched.

See Also

dispatchNestedPreScroll(View, int, int, int[], int[])

        public
        static

        void

      dispatchStartTemporaryDetach
      (View view)

Notify a view that it is being temporarily detached.

        public
        static

        int

      getAccessibilityLiveRegion
      (View view)

Gets the live region mode for the specified View.

Parameters

          view
          The view from which to obtain the live region mode

Returns

The live region mode for the view.

See Also

setAccessibilityLiveRegion(View, int)

        public
        static

        AccessibilityNodeProviderCompat

      getAccessibilityNodeProvider
      (View view)

Gets the provider for managing a virtual view hierarchy rooted at this View
 and reported to AccessibilityServices
 that explore the window content.

 If this method returns an instance, this instance is responsible for managing
 AccessibilityNodeInfoCompats describing the virtual sub-tree rooted at
 this View including the one representing the View itself. Similarly the returned
 instance is responsible for performing accessibility actions on any virtual
 view or the root view itself.

 If an AccessibilityDelegateCompat has been specified via calling
 setAccessibilityDelegate(View, AccessibilityDelegateCompat) its
 getAccessibilityNodeProvider(View)
 is responsible for handling this call.

Parameters

          view
          The view whose property to get.

Returns

The provider.

See Also

AccessibilityNodeProviderCompat

        public
        static

        float

      getAlpha
      (View view)

The opacity of the view. This is a value from 0 to 1, where 0 means the view is
 completely transparent and 1 means the view is completely opaque.

By default this is 1.0f. Prior to API 11, the returned value is always 1.0f.

Returns

The opacity of the view.

        public
        static

        ColorStateList

      getBackgroundTintList
      (View view)

Return the tint applied to the background drawable, if specified.

 Only returns meaningful info when running on API v21 or newer, or if view
 implements the TintableBackgroundView interface.

        public
        static

        PorterDuff.Mode

      getBackgroundTintMode
      (View view)

Return the blending mode used to apply the tint to the background
 drawable, if specified.

 Only returns meaningful info when running on API v21 or newer, or if view
 implements the TintableBackgroundView interface.

        public
        static

        Rect

      getClipBounds
      (View view)

Returns a copy of the current setClipBounds(View, Rect).

Prior to API 18 this will return null.

Returns

A copy of the current clip bounds if clip bounds are set,
 otherwise null.

        public
        static

        float

      getElevation
      (View view)

The base elevation of this view relative to its parent, in pixels.

Returns

The base depth position of the view, in pixels.

        public
        static

        boolean

      getFitsSystemWindows
      (View v)

Returns true if this view should adapt to fit system window insets. This method will always
 return false before API 16 (Jellybean).

        public
        static

        int

      getImportantForAccessibility
      (View view)

Gets the mode for determining whether this View is important for accessibility
 which is if it fires accessibility events and if it is reported to
 accessibility services that query the screen.

Parameters

          view
          The view whose property to get.

Returns

The mode for determining whether a View is important for accessibility.

See Also

IMPORTANT_FOR_ACCESSIBILITY_YES

IMPORTANT_FOR_ACCESSIBILITY_NO

IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS

IMPORTANT_FOR_ACCESSIBILITY_AUTO

        public
        static

        int

      getLabelFor
      (View view)

Gets the id of a view for which a given view serves as a label for
 accessibility purposes.

Parameters

          view
          The view on which to invoke the corresponding method.

Returns

The labeled view id.

        public
        static

        int

      getLayerType
      (View view)

Indicates what type of layer is currently associated with this view. By default
 a view does not have a layer, and the layer type is LAYER_TYPE_NONE.
 Refer to the documentation of
 setLayerType(android.view.View, int, android.graphics.Paint)
 for more information on the different types of layers.

Parameters

          view
          The view to fetch the layer type from

Returns

LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE or
         LAYER_TYPE_HARDWARE

See Also

setLayerType(android.view.View, int, android.graphics.Paint)

LAYER_TYPE_NONE

LAYER_TYPE_SOFTWARE

LAYER_TYPE_HARDWARE

        public
        static

        int

      getLayoutDirection
      (View view)

Returns the resolved layout direction for this view.

Parameters

          view
          View to get layout direction for

Returns

LAYOUT_DIRECTION_RTL if the layout direction is RTL or returns
 LAYOUT_DIRECTION_LTR if the layout direction is not RTL.

 For compatibility, this will return LAYOUT_DIRECTION_LTR if API version
 is lower than Jellybean MR1 (API 17)

        public
        static

        int

      getMeasuredHeightAndState
      (View view)

Return the full height measurement information for this view as computed
 by the most recent call to measure(int, int).
 This result is a bit mask as defined by MEASURED_SIZE_MASK and
 MEASURED_STATE_TOO_SMALL.
 This should be used during measurement and layout calculations only. Use
 getHeight() to see how wide a view is after layout.

Returns

The measured width of this view as a bit mask.

        public
        static

        int

      getMeasuredState
      (View view)

Return only the state bits of getMeasuredWidthAndState(View)
 and getMeasuredHeightAndState(View), combined into one integer.
 The width component is in the regular bits MEASURED_STATE_MASK
 and the height component is at the shifted bits
 MEASURED_HEIGHT_STATE_SHIFT>>MEASURED_STATE_MASK.

        public
        static

        int

      getMeasuredWidthAndState
      (View view)

Return the full width measurement information for this view as computed
 by the most recent call to measure(int, int).
 This result is a bit mask as defined by MEASURED_SIZE_MASK and
 MEASURED_STATE_TOO_SMALL.
 This should be used during measurement and layout calculations only. Use
 getWidth() to see how wide a view is after layout.

Returns

The measured width of this view as a bit mask.

        public
        static

        int

      getMinimumHeight
      (View view)

Returns the minimum height of the view.

Prior to API 16 this will return 0.

Returns

the minimum height the view will try to be.

        public
        static

        int

      getMinimumWidth
      (View view)

Returns the minimum width of the view.

Prior to API 16 this will return 0.

Returns

the minimum width the view will try to be.

        public
        static

        int

      getOverScrollMode
      (View v)

Returns the over-scroll mode for this view. The result will be
 one of OVER_SCROLL_ALWAYS (default), OVER_SCROLL_IF_CONTENT_SCROLLS
 (allow over-scrolling only if the view content is larger than the container),
 or OVER_SCROLL_NEVER.

Parameters

          v
          The View against which to invoke the method.

Returns

This view's over-scroll mode.

        public
        static

        int

      getPaddingEnd
      (View view)

Returns the end padding of the specified view depending on its resolved layout direction.
 If there are inset and enabled scrollbars, this value may include the space
 required to display the scrollbars as well.

Parameters

          view
          The view to get padding for

Returns

the end padding in pixels

        public
        static

        int

      getPaddingStart
      (View view)

Returns the start padding of the specified view depending on its resolved layout direction.
 If there are inset and enabled scrollbars, this value may include the space
 required to display the scrollbars as well.

Parameters

          view
          The view to get padding for

Returns

the start padding in pixels

        public
        static

        ViewParent

      getParentForAccessibility
      (View view)

Gets the parent for accessibility purposes. Note that the parent for
 accessibility is not necessary the immediate parent. It is the first
 predecessor that is important for accessibility.

Parameters

          view
          View to retrieve parent for

Returns

The parent for use in accessibility inspection

        public
        static

        float

      getPivotX
      (View view)

The x location of the point around which the view is
 rotated and scaled.

Prior to API 11 this will have no effect.

        public
        static

        float

      getPivotY
      (View view)

The y location of the point around which the view is rotated and scaled.

Prior to API 11 this will return 0.

Returns

The y location of the pivot point.

        public
        static

        float

      getRotation
      (View view)

        public
        static

        float

      getRotationX
      (View view)

        public
        static

        float

      getRotationY
      (View view)

        public
        static

        float

      getScaleX
      (View view)

        public
        static

        float

      getScaleY
      (View view)

        public
        static

        String

      getTransitionName
      (View view)

Returns the name of the View to be used to identify Views in Transitions.
 Names should be unique in the View hierarchy.

This returns null if the View has not been given a name.

Parameters

          view
          The View against which to invoke the method.

Returns

The name used of the View to be used to identify Views in Transitions or null
 if no name has been given.

        public
        static

        float

      getTranslationX
      (View view)

The horizontal location of this view relative to its left position.
 This position is post-layout, in addition to wherever the object's
 layout placed it.

Prior to API 11 this will return 0.

Returns

The horizontal position of this view relative to its left position, in pixels.

        public
        static

        float

      getTranslationY
      (View view)

The vertical location of this view relative to its left position.
 This position is post-layout, in addition to wherever the object's
 layout placed it.

Prior to API 11 this will return 0.

Returns

The vertical position of this view relative to its top position, in pixels.

        public
        static

        float

      getTranslationZ
      (View view)

The depth location of this view relative to its elevation.

Returns

The depth of this view relative to its elevation.

        public
        static

        int

      getWindowSystemUiVisibility
      (View view)

Returns the current system UI visibility that is currently set for the entire window.

        public
        static

        float

      getX
      (View view)

        public
        static

        float

      getY
      (View view)

        public
        static

        float

      getZ
      (View view)

The visual z position of this view, in pixels. This is equivalent to the
 translationZ property plus the current
 elevation property.

Returns

The visual z position of this view, in pixels.

        public
        static

        boolean

      hasAccessibilityDelegate
      (View v)

Checks whether provided View has an accessibility delegate attached to it.

Parameters

          v
          The View instance to check

Returns

True if the View has an accessibility delegate

        public
        static

        boolean

      hasNestedScrollingParent
      (View view)

Returns true if this view has a nested scrolling parent.

The presence of a nested scrolling parent indicates that this view has initiated
 a nested scroll and it was accepted by an ancestor view further up the view hierarchy.

Returns

whether this view has a nested scrolling parent

        public
        static

        boolean

      hasOverlappingRendering
      (View view)

Returns whether this View has content which overlaps.

This function, intended to be overridden by specific View types, is an optimization when
 alpha is set on a view. If rendering overlaps in a view with alpha < 1, that view is drawn to
 an offscreen buffer and then composited into place, which can be expensive. If the view has
 no overlapping rendering, the view can draw each primitive with the appropriate alpha value
 directly. An example of overlapping rendering is a TextView with a background image, such as
 a Button. An example of non-overlapping rendering is a TextView with no background, or an
 ImageView with only the foreground image. The default implementation returns true; subclasses
 should override if they have cases which can be optimized.

Returns

true if the content in this view might overlap, false otherwise.

        public
        static

        boolean

      hasTransientState
      (View view)

Indicates whether the view is currently tracking transient state that the
 app should not need to concern itself with saving and restoring, but that
 the framework should take special note to preserve when possible.

Parameters

          view
          View to check for transient state

Returns

true if the view has transient state

        public
        static

        boolean

      isAttachedToWindow
      (View view)

Returns true if the provided view is currently attached to a window.

        public
        static

        boolean

      isLaidOut
      (View view)

Returns true if view has been through at least one layout since it
 was last attached to or detached from a window.

        public
        static

        boolean

      isNestedScrollingEnabled
      (View view)

Returns true if nested scrolling is enabled for this view.

If nested scrolling is enabled and this View class implementation supports it,
 this view will act as a nested scrolling child view when applicable, forwarding data
 about the scroll operation in progress to a compatible and cooperating nested scrolling
 parent.

Returns

true if nested scrolling is enabled

See Also

setNestedScrollingEnabled(View, boolean)

        public
        static

        boolean

      isOpaque
      (View view)

Indicates whether this View is opaque. An opaque View guarantees that it will
 draw all the pixels overlapping its bounds using a fully opaque color.

 On API 7 and above this will call View's true isOpaque method. On previous platform
 versions it will check the opacity of the view's background drawable if present.

Returns

True if this View is guaranteed to be fully opaque, false otherwise.

        public
        static

        boolean

      isPaddingRelative
      (View view)

Return if the padding as been set through relative values
 View.setPaddingRelative(int, int, int, int) or thru

Returns

true if the padding is relative or false if it is not.

        public
        static

        void

      jumpDrawablesToCurrentState
      (View v)

On API 11 devices and above, call Drawable.jumpToCurrentState()
 on all Drawable objects associated with this view.

 On API 21 and above, also calls StateListAnimator#jumpToCurrentState()
 if there is a StateListAnimator attached to this view.

        public
        static

        void

      offsetLeftAndRight
      (View view, int offset)

Offset this view's horizontal location by the specified amount of pixels.

Parameters

          offset
          the number of pixels to offset the view by

        public
        static

        void

      offsetTopAndBottom
      (View view, int offset)

Offset this view's vertical location by the specified number of pixels.

Parameters

          offset
          the number of pixels to offset the view by

        public
        static

        WindowInsetsCompat

      onApplyWindowInsets
      (View view, WindowInsetsCompat insets)

Called when the view should apply WindowInsetsCompat according to its internal policy.

Clients may supply an OnApplyWindowInsetsListener to a view. If one is set
 it will be called during dispatch instead of this method. The listener may optionally
 call this method from its own implementation if it wishes to apply the view's default
 insets policy in addition to its own.

Parameters

          view
          The View against which to invoke the method.

          insets
          Insets to apply

Returns

The supplied insets with any applied insets consumed

        public
        static

        void

      onInitializeAccessibilityEvent
      (View v, AccessibilityEvent event)

Initializes an AccessibilityEvent with information about
 this View which is the event source. In other words, the source of
 an accessibility event is the view whose state change triggered firing
 the event.

 Example: Setting the password property of an event in addition
          to properties set by the super implementation:

 public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
     super.onInitializeAccessibilityEvent(event);
     event.setPassword(true);
 }

 If an View.AccessibilityDelegate has been specified via calling
 setAccessibilityDelegate(android.view.View.AccessibilityDelegate) its
 onInitializeAccessibilityEvent(View, AccessibilityEvent)
 is responsible for handling this call.

Note: Always call the super implementation before adding
 information to the event, in case the default implementation has basic information to add.

Parameters

          v
          The View against which to invoke the method.

          event
          The event to initialize.

See Also

sendAccessibilityEvent(int)

dispatchPopulateAccessibilityEvent(AccessibilityEvent)

        public
        static

        void

      onInitializeAccessibilityNodeInfo
      (View v, AccessibilityNodeInfoCompat info)

Initializes an AccessibilityNodeInfo with information
 about this view. The base implementation sets:

setParent(View),

setBoundsInParent(Rect),

setBoundsInScreen(Rect),

setPackageName(CharSequence),

setClassName(CharSequence),

setContentDescription(CharSequence),

setEnabled(boolean),

setClickable(boolean),

setFocusable(boolean),

setFocused(boolean),

setLongClickable(boolean),

setSelected(boolean),

 Subclasses should override this method, call the super implementation,
 and set additional attributes.

 If an View.AccessibilityDelegate has been specified via calling
 setAccessibilityDelegate(android.view.View.AccessibilityDelegate) its
 onInitializeAccessibilityNodeInfo(View, android.view.accessibility.AccessibilityNodeInfo)
 is responsible for handling this call.

Parameters

          v
          The View against which to invoke the method.

          info
          The instance to initialize.

        public
        static

        void

      onPopulateAccessibilityEvent
      (View v, AccessibilityEvent event)

Called from dispatchPopulateAccessibilityEvent(AccessibilityEvent)
 giving a chance to this View to populate the accessibility event with its
 text content. While this method is free to modify event
 attributes other than text content, doing so should normally be performed in
 onInitializeAccessibilityEvent(AccessibilityEvent).

 Example: Adding formatted date string to an accessibility event in addition
          to the text added by the super implementation:

 public void onPopulateAccessibilityEvent(AccessibilityEvent event) {
     super.onPopulateAccessibilityEvent(event);
     final int flags = DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_WEEKDAY;
     String selectedDateUtterance = DateUtils.formatDateTime(mContext,
         mCurrentDate.getTimeInMillis(), flags);
     event.getText().add(selectedDateUtterance);
 }

 If an View.AccessibilityDelegate has been specified via calling
 setAccessibilityDelegate(android.view.View.AccessibilityDelegate) its
 onPopulateAccessibilityEvent(View, AccessibilityEvent)
 is responsible for handling this call.

Note: Always call the super implementation before adding
 information to the event, in case the default implementation has basic information to add.

Parameters

          v
          The View against which to invoke the method.

          event
          The accessibility event which to populate.

See Also

sendAccessibilityEvent(int)

dispatchPopulateAccessibilityEvent(AccessibilityEvent)

        public
        static

        boolean

      performAccessibilityAction
      (View view, int action, Bundle arguments)

Performs the specified accessibility action on the view. For
 possible accessibility actions look at AccessibilityNodeInfoCompat.

 If an AccessibilityDelegateCompat has been specified via calling
 setAccessibilityDelegate(View, AccessibilityDelegateCompat) its
 performAccessibilityAction(View, int, Bundle)
 is responsible for handling this call.

Parameters

          action
          The action to perform.

          arguments
          Optional action arguments.

Returns

Whether the action was performed.

        public
        static

        void

      postInvalidateOnAnimation
      (View view)

Cause an invalidate to happen on the next animation time step, typically the
 next display frame.

This method can be invoked from outside of the UI thread
 only when this View is attached to a window.

Parameters

          view
          View to invalidate

        public
        static

        void

      postInvalidateOnAnimation
      (View view, int left, int top, int right, int bottom)

Cause an invalidate of the specified area to happen on the next animation
 time step, typically the next display frame.

This method can be invoked from outside of the UI thread
 only when this View is attached to a window.

Parameters

          view
          View to invalidate

          left
          The left coordinate of the rectangle to invalidate.

          top
          The top coordinate of the rectangle to invalidate.

          right
          The right coordinate of the rectangle to invalidate.

          bottom
          The bottom coordinate of the rectangle to invalidate.

        public
        static

        void

      postOnAnimation
      (View view, Runnable action)

Causes the Runnable to execute on the next animation time step.
 The runnable will be run on the user interface thread.

This method can be invoked from outside of the UI thread
 only when this View is attached to a window.

Parameters

          view
          View to post this Runnable to

          action
          The Runnable that will be executed.

        public
        static

        void

      postOnAnimationDelayed
      (View view, Runnable action, long delayMillis)

Causes the Runnable to execute on the next animation time step,
 after the specified amount of time elapses.
 The runnable will be run on the user interface thread.

This method can be invoked from outside of the UI thread
 only when this View is attached to a window.

Parameters

          view
          The view to post this Runnable to

          action
          The Runnable that will be executed.

          delayMillis
          The delay (in milliseconds) until the Runnable
        will be executed.

        public
        static

        void

      requestApplyInsets
      (View view)

Ask that a new dispatch of View.onApplyWindowInsets(WindowInsets) be performed. This
 falls back to View.requestFitSystemWindows() where available.

        public
        static

        int

      resolveSizeAndState
      (int size, int measureSpec, int childMeasuredState)

Utility to reconcile a desired size and state, with constraints imposed
 by a MeasureSpec.  Will take the desired size, unless a different size
 is imposed by the constraints.  The returned value is a compound integer,
 with the resolved size in the MEASURED_SIZE_MASK bits and
 optionally the bit MEASURED_STATE_TOO_SMALL set if the resulting
 size is smaller than the size the view wants to be.

Parameters

          size
          How big the view wants to be

          measureSpec
          Constraints imposed by the parent

Returns

Size information bit mask as defined by
 MEASURED_SIZE_MASK and MEASURED_STATE_TOO_SMALL.

        public
        static

        void

      setAccessibilityDelegate
      (View v, AccessibilityDelegateCompat delegate)

Sets a delegate for implementing accessibility support via compositon as
 opposed to inheritance. The delegate's primary use is for implementing
 backwards compatible widgets. For more details see
 View.AccessibilityDelegate.

Parameters

          v
          The View against which to invoke the method.

          delegate
          The delegate instance.

See Also

View.AccessibilityDelegate

        public
        static

        void

      setAccessibilityLiveRegion
      (View view, int mode)

Sets the live region mode for the specified view. This indicates to
 accessibility services whether they should automatically notify the user
 about changes to the view's content description or text, or to the
 content descriptions or text of the view's children (where applicable).

 For example, in a login screen with a TextView that displays an "incorrect
 password" notification, that view should be marked as a live region with
 mode ACCESSIBILITY_LIVE_REGION_POLITE.

 To disable change notifications for this view, use
 ACCESSIBILITY_LIVE_REGION_NONE. This is the default live region
 mode for most views.

 To indicate that the user should be notified of changes, use
 ACCESSIBILITY_LIVE_REGION_POLITE.

 If the view's changes should interrupt ongoing speech and notify the user
 immediately, use ACCESSIBILITY_LIVE_REGION_ASSERTIVE.

Parameters

          view
          The view on which to set the live region mode

          mode
          The live region mode for this view, one of:

ACCESSIBILITY_LIVE_REGION_NONE

ACCESSIBILITY_LIVE_REGION_POLITE

ACCESSIBILITY_LIVE_REGION_ASSERTIVE

        public
        static

        void

      setActivated
      (View view, boolean activated)

Changes the activated state of this view. A view can be activated or not.
 Note that activation is not the same as selection.  Selection is
 a transient property, representing the view (hierarchy) the user is
 currently interacting with.  Activation is a longer-term state that the
 user can move views in and out of.

Parameters

          activated
          true if the view must be activated, false otherwise

        public
        static

        void

      setAlpha
      (View view, float value)

Sets the opacity of the view. This is a value from 0 to 1, where 0 means the view is
 completely transparent and 1 means the view is completely opaque.

 Note that setting alpha to a translucent value (0 < alpha < 1) can have significant
 performance implications, especially for large views. It is best to use the alpha property
 sparingly and transiently, as in the case of fading animations.

Prior to API 11 this will have no effect.

Parameters

          value
          The opacity of the view.

        public
        static

        void

      setBackgroundTintList
      (View view, ColorStateList tintList)

Applies a tint to the background drawable.

 This will always take effect when running on API v21 or newer. When running on platforms
 previous to API v21, it will only take effect if view implement the
 TintableBackgroundView interface.

        public
        static

        void

      setBackgroundTintMode
      (View view, PorterDuff.Mode mode)

Specifies the blending mode used to apply the tint specified by
 setBackgroundTintList(android.view.View, android.content.res.ColorStateList) to
 the background drawable. The default mode is SRC_IN.

 This will always take effect when running on API v21 or newer. When running on platforms
 previous to API v21, it will only take effect if view implement the
 TintableBackgroundView interface.

        public
        static

        void

      setChildrenDrawingOrderEnabled
      (ViewGroup viewGroup, boolean enabled)

Tells the ViewGroup whether to draw its children in the order defined by the method
 ViewGroup.getChildDrawingOrder(int, int).

Parameters

          enabled
          true if the order of the children when drawing is determined by
        getChildDrawingOrder(int, int), false otherwise

Prior to API 7 this will have no effect.

        public
        static

        void

      setClipBounds
      (View view, Rect clipBounds)

Sets a rectangular area on this view to which the view will be clipped
 when it is drawn. Setting the value to null will remove the clip bounds
 and the view will draw normally, using its full bounds.

Prior to API 18 this does nothing.

Parameters

          view
          The view to set clipBounds.

          clipBounds
          The rectangular area, in the local coordinates of
 this view, to which future drawing operations will be clipped.

        public
        static

        void

      setElevation
      (View view, float elevation)

Sets the base elevation of this view, in pixels.

        public
        static

        void

      setFitsSystemWindows
      (View view, boolean fitSystemWindows)

Sets whether or not this view should account for system screen decorations
 such as the status bar and inset its content; that is, controlling whether
 the default implementation of fitSystemWindows(Rect) will be
 executed. See that method for more details.

        public
        static

        void

      setHasTransientState
      (View view, boolean hasTransientState)

Set whether this view is currently tracking transient state that the
 framework should attempt to preserve when possible.

Parameters

          view
          View tracking transient state

          hasTransientState
          true if this view has transient state

        public
        static

        void

      setImportantForAccessibility
      (View view, int mode)

Sets how to determine whether this view is important for accessibility
 which is if it fires accessibility events and if it is reported to
 accessibility services that query the screen.

 Note: If the current paltform version does not support the
  IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS mode, then
  IMPORTANT_FOR_ACCESSIBILITY_NO will be used as it is the
  closest terms of semantics.

Parameters

          view
          The view whose property to set.

          mode
          How to determine whether this view is important for accessibility.

See Also

IMPORTANT_FOR_ACCESSIBILITY_YES

IMPORTANT_FOR_ACCESSIBILITY_NO

IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS

IMPORTANT_FOR_ACCESSIBILITY_AUTO

        public
        static

        void

      setLabelFor
      (View view, int labeledId)

Sets the id of a view for which a given view serves as a label for
 accessibility purposes.

Parameters

          view
          The view on which to invoke the corresponding method.

          labeledId
          The labeled view id.

        public
        static

        void

      setLayerPaint
      (View view, Paint paint)

Updates the Paint object used with the current layer (used only if the current
 layer type is not set to LAYER_TYPE_NONE). Changed properties of the Paint
 provided to setLayerType(android.view.View, int, android.graphics.Paint)
 will be used the next time the View is redrawn, but
 setLayerPaint(android.view.View, android.graphics.Paint)
 must be called to ensure that the view gets redrawn immediately.

A layer is associated with an optional Paint
 instance that controls how the layer is composed on screen. The following
 properties of the paint are taken into account when composing the layer:

Translucency (alpha)

Blending mode

Color filter

If this view has an alpha value set to < 1.0 by calling
 View#setAlpha(float), the alpha value of the layer's paint is replaced by
 this view's alpha value. Calling View#setAlpha(float) is therefore
 equivalent to setting a hardware layer on this view and providing a paint with
 the desired alpha value.

Parameters

          view
          View to set a layer paint for

          paint
          The paint used to compose the layer. This argument is optional
        and can be null. It is ignored when the layer type is
        LAYER_TYPE_NONE

See Also

setLayerType(View, int, android.graphics.Paint)

        public
        static

        void

      setLayerType
      (View view, int layerType, Paint paint)

Specifies the type of layer backing this view. The layer can be
 disabled, software or
 hardware.

A layer is associated with an optional Paint
 instance that controls how the layer is composed on screen. The following
 properties of the paint are taken into account when composing the layer:

Translucency (alpha)

Blending mode

Color filter

If this view has an alpha value set to < 1.0 by calling
 setAlpha(float), the alpha value of the layer's paint is replaced by
 this view's alpha value. Calling setAlpha(float) is therefore
 equivalent to setting a hardware layer on this view and providing a paint with
 the desired alpha value.

Refer to the documentation of disabled,
 software and hardware
 for more information on when and how to use layers.

Parameters

          view
          View to set the layer type for

          layerType
          The type of layer to use with this view, must be one of
        LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE or
        LAYER_TYPE_HARDWARE

          paint
          The paint used to compose the layer. This argument is optional
        and can be null. It is ignored when the layer type is
        LAYER_TYPE_NONE

        public
        static

        void

      setLayoutDirection
      (View view, int layoutDirection)

Set the layout direction for this view. This will propagate a reset of layout direction
 resolution to the view's children and resolve layout direction for this view.

Parameters

          view
          View to set layout direction for

          layoutDirection
          the layout direction to set. Should be one of:

 LAYOUT_DIRECTION_LTR,
 LAYOUT_DIRECTION_RTL,
 LAYOUT_DIRECTION_INHERIT,
 LAYOUT_DIRECTION_LOCALE.

 Resolution will be done if the value is set to LAYOUT_DIRECTION_INHERIT. The resolution
 proceeds up the parent chain of the view to get the value. If there is no parent, then it
 will return the default LAYOUT_DIRECTION_LTR.

        public
        static

        void

      setNestedScrollingEnabled
      (View view, boolean enabled)

Enable or disable nested scrolling for this view.

If this property is set to true the view will be permitted to initiate nested
 scrolling operations with a compatible parent view in the current hierarchy. If this
 view does not implement nested scrolling this will have no effect. Disabling nested scrolling
 while a nested scroll is in progress has the effect of
 stopping the nested scroll.

Parameters

          enabled
          true to enable nested scrolling, false to disable

See Also

isNestedScrollingEnabled(View)

        public
        static

        void

      setOnApplyWindowInsetsListener
      (View v, OnApplyWindowInsetsListener listener)

Set an OnApplyWindowInsetsListener to take over the policy for applying
 window insets to this view. This will only take effect on devices with API 21 or above.

        public
        static

        void

      setOverScrollMode
      (View v, int overScrollMode)

Set the over-scroll mode for this view. Valid over-scroll modes are
 OVER_SCROLL_ALWAYS (default), OVER_SCROLL_IF_CONTENT_SCROLLS
 (allow over-scrolling only if the view content is larger than the container),
 or OVER_SCROLL_NEVER.

 Setting the over-scroll mode of a view will have an effect only if the
 view is capable of scrolling.

Parameters

          v
          The View against which to invoke the method.

          overScrollMode
          The new over-scroll mode for this view.

        public
        static

        void

      setPaddingRelative
      (View view, int start, int top, int end, int bottom)

Sets the relative padding. The view may add on the space required to display
 the scrollbars, depending on the style and visibility of the scrollbars.
 So the values returned from getPaddingStart(View), getPaddingTop(),
 getPaddingEnd(View) and getPaddingBottom() may be different
 from the values set in this call.

Parameters

          view
          The view on which to set relative padding

          start
          the start padding in pixels

          top
          the top padding in pixels

          end
          the end padding in pixels

          bottom
          the bottom padding in pixels

        public
        static

        void

      setPivotX
      (View view, float value)

Sets the x location of the point around which the view is
 rotated and scaled.
 By default, the pivot point is centered on the object.
 Setting this property disables this behavior and causes the view to use only the
 explicitly set pivotX and pivotY values.

Prior to API 11 this will have no effect.

Parameters

          value
          The x location of the pivot point.

        public
        static

        void

      setPivotY
      (View view, float value)

Sets the y location of the point around which the view is
 rotated and scaled.
 By default, the pivot point is centered on the object.
 Setting this property disables this behavior and causes the view to use only the
 explicitly set pivotX and pivotY values.

Prior to API 11 this will have no effect.

Parameters

          value
          The y location of the pivot point.

        public
        static

        void

      setRotation
      (View view, float value)

Sets the degrees that the view is rotated around the pivot point. Increasing values
 result in clockwise rotation.

Prior to API 11 this will have no effect.

Parameters

          value
          The degrees of rotation.

        public
        static

        void

      setRotationX
      (View view, float value)

Sets the degrees that the view is rotated around the horizontal axis through the pivot point.
 Increasing values result in clockwise rotation from the viewpoint of looking down the
 x axis.

Prior to API 11 this will have no effect.

Parameters

          value
          The degrees of X rotation.

        public
        static

        void

      setRotationY
      (View view, float value)

Sets the degrees that the view is rotated around the vertical axis through the pivot point.
 Increasing values result in counter-clockwise rotation from the viewpoint of looking
 down the y axis.

Prior to API 11 this will have no effect.

Parameters

          value
          The degrees of Y rotation.

        public
        static

        void

      setSaveFromParentEnabled
      (View v, boolean enabled)

Controls whether the entire hierarchy under this view will save its
 state when a state saving traversal occurs from its parent.

Parameters

          enabled
          Set to false to disable state saving, or true
 (the default) to allow it.

        public
        static

        void

      setScaleX
      (View view, float value)

Sets the amount that the view is scaled in x around the pivot point, as a proportion of
 the view's unscaled width. A value of 1 means that no scaling is applied.

Prior to API 11 this will have no effect.

Parameters

          value
          The scaling factor.

        public
        static

        void

      setScaleY
      (View view, float value)

Sets the amount that the view is scaled in Y around the pivot point, as a proportion of
 the view's unscaled width. A value of 1 means that no scaling is applied.

Prior to API 11 this will have no effect.

Parameters

          value
          The scaling factor.

        public
        static

        void

      setTransitionName
      (View view, String transitionName)

Sets the name of the View to be used to identify Views in Transitions.
 Names should be unique in the View hierarchy.

Parameters

          view
          The View against which to invoke the method.

          transitionName
          The name of the View to uniquely identify it for Transitions.

        public
        static

        void

      setTranslationX
      (View view, float value)

Sets the horizontal location of this view relative to its left position.
 This effectively positions the object post-layout, in addition to wherever the object's
 layout placed it.

Prior to API 11 this will have no effect.

Parameters

          value
          The horizontal position of this view relative to its left position,
 in pixels.

        public
        static

        void

      setTranslationY
      (View view, float value)

Sets the vertical location of this view relative to its top position.
 This effectively positions the object post-layout, in addition to wherever the object's
 layout placed it.

Prior to API 11 this will have no effect.

Related XML Attributes

android:translationY

Parameters

          value
          The vertical position of this view relative to its top position,
 in pixels.

        public
        static

        void

      setTranslationZ
      (View view, float translationZ)

Sets the depth location of this view relative to its elevation.

        public
        static

        void

      setX
      (View view, float value)

Sets the visual x position of this view, in pixels. This is equivalent to setting the
 translationX property to be the difference between
 the x value passed in and the current left property of the view as determined
 by the layout bounds.

Prior to API 11 this will have no effect.

Parameters

          value
          The visual x position of this view, in pixels.

        public
        static

        void

      setY
      (View view, float value)

Sets the visual y position of this view, in pixels. This is equivalent to setting the
 translationY property to be the difference between
 the y value passed in and the current top property of the view as determined by the
 layout bounds.

Prior to API 11 this will have no effect.

Parameters

          value
          The visual y position of this view, in pixels.

        public
        static

        boolean

      startNestedScroll
      (View view, int axes)

Begin a nestable scroll operation along the given axes.

A view starting a nested scroll promises to abide by the following contract:

The view will call startNestedScroll upon initiating a scroll operation. In the case
 of a touch scroll this corresponds to the initial ACTION_DOWN.
 In the case of touch scrolling the nested scroll will be terminated automatically in
 the same manner as requestDisallowInterceptTouchEvent(boolean).
 In the event of programmatic scrolling the caller must explicitly call
 stopNestedScroll(View) to indicate the end of the nested scroll.

If startNestedScroll returns true, a cooperative parent was found.
 If it returns false the caller may ignore the rest of this contract until the next scroll.
 Calling startNestedScroll while a nested scroll is already in progress will return true.

At each incremental step of the scroll the caller should invoke
 dispatchNestedPreScroll
 once it has calculated the requested scrolling delta. If it returns true the nested scrolling
 parent at least partially consumed the scroll and the caller should adjust the amount it
 scrolls by.

After applying the remainder of the scroll delta the caller should invoke
 dispatchNestedScroll, passing
 both the delta consumed and the delta unconsumed. A nested scrolling parent may treat
 these values differently. See
 onNestedScroll(View, int, int, int, int).

Parameters

          axes
          Flags consisting of a combination of SCROLL_AXIS_HORIZONTAL
             and/or SCROLL_AXIS_VERTICAL.

Returns

true if a cooperative parent was found and nested scrolling has been enabled for
         the current gesture.

See Also

stopNestedScroll(View)

dispatchNestedPreScroll(View, int, int, int[], int[])

dispatchNestedScroll(View, int, int, int, int, int[])

        public
        static

        void

      stopNestedScroll
      (View view)

Stop a nested scroll in progress.

Calling this method when a nested scroll is not currently in progress is harmless.

See Also

startNestedScroll(View, int)

        Get news & tips

          Blog
          Support

  Except as noted, this content is licensed under Apache 2.0.
  For details and restrictions, see the
  Content License.

    Android 6.0 r1 —

      About Android
      Auto
      TV
      Wear
      Legal

        <select name="language" onchange="changeLangPref(this.value, true)">
          <option value="en" selected="selected">English</option>
          <option value="es">Español</option>
          <option value="ja">日本語</option>
          <option value="ko">한국어</option>
          <option value="pt-br">Português Brasileiro</option>
          <option value="ru">Русский</option>
          <option value="zh-cn">中文(简体)</option>
          <option value="zh-tw">中文(繁體)</option>
        </select>

        <button class="dac-modal-header-close" data-modal-toggle></button>

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

          <form action="https://docs.google.com/forms/d/1QgnkzbEJIDu9lMEea0mxqWrXUJu0oBCLD7ar23V0Yys/formResponse" class="dac-form" method="post" target="dac-newsletter-iframe">

              <fieldset class="dac-form-fieldset">

                      Full name
                      <input type="text" class="dac-form-input" name="entry.1357890476" id="newsletter-full-name" required>
                      *

                      Email address
                      <input type="email" class="dac-form-input" name="entry.472100832" id="newsletter-email" required>
                      *

                      Company / developer name
                      <input type="text" class="dac-form-input" name="entry.1664780309" id="newsletter-company">

                      One of your Play Store app URLs
                      <input type="url" class="dac-form-input" name="entry.47013838" id="newsletter-play-store" required>
                      *

              </fieldset>
              <fieldset class="dac-form-fieldset">

                    <legend class="dac-form-legend">Which best describes your business:*
                    </legend>

                      <input type="radio" value="Apps" class="dac-form-radio" name="entry.1796324055" id="newsletter-business-type-app" required>

                      Apps

                      <input type="radio" value="Games" class="dac-form-radio" name="entry.1796324055" id="newsletter-business-type-games" required>

                      Games

                      <input type="radio" value="Apps and Games" class="dac-form-radio" name="entry.1796324055" id="newsletter-business-type-appsgames" required>

                      Apps & Games

                          <input type="checkbox" class="dac-form-checkbox" name="entry.732309842" id="newsletter-add" required value="Add me to the mailing list for the monthly newsletter and occasional emails about development and Google Play opportunities.">

                          Add me to the mailing list for the monthly newsletter and occasional emails about development and Google Play opportunities.*

                          <input type="checkbox" class="dac-form-checkbox" name="entry.2045036090" id="newsletter-terms" required value="I acknowledge that the information provided in this form will be subject to Google's privacy policy (https://www.google.com/policies/privacy/).">

                          I acknowledge that the information provided in this form will be subject to Google's privacy policy.*

              </fieldset>

              <button type="submit" value="Submit" class="dac-fab dac-primary dac-large dac-modal-action"></button>

          </form>

              You have successfully signed up for the latest Android developer news and tips.

redpajama_set_name: RedPajamaGithub