- ImageView
- Общая информация
- Метод setImageResource()
- Метод setImageBitmap()
- Метод setImageDrawable()
- Метод setImageURI()
- Другие методы
- Масштабирование через свойство Scale Type
- Атрибут android:adjustViewBounds=»true»
- Загрузка изображения из галереи
- Получить размеры ImageView — будьте осторожны
- Копирование изображений между ImageView
- Примеры
- Невозможно изменить видимость ImageView
- Image View Class
- Definition
- Remarks
- Constructors
- Fields
- Properties
- Methods
- Events
- Explicit Interface Implementations
- Extension Methods
ImageView
Общая информация
Компонент ImageView предназначен для отображения изображений. Находится в разделе Widgets.
Для загрузки изображения в XML-файле используется атрибут android:src, в последнее время чаще используется атрибут app:srcCompat.
ImageView является базовым элементом-контейнером для использования графики. Можно загружать изображения из разных источников, например, из ресурсов программы, контент-провайдеров. В классе ImageView существует несколько методов для загрузки изображений:
- setImageResource(int resId) — загружает изображение по идентификатору ресурса
- setImageBitmap(Bitmap bitmap) — загружает растровое изображение
- setImageDrawable(Drawable drawable) — загружает готовое изображение
- setImageURI(Uri uri) — загружает изображение по его URI
Метод setImageResource()
Сначала нужно получить ссылку на ImageView, а затем используется идентификатор изображения из ресурсов:
Метод setImageBitmap()
Используется класс BitmapFactory для чтения ресурса изображения в объект Bitmap, а затем в ImageView указывается полученный Bitmap. Могут быть и другие варианты.
Метод setImageDrawable()
Если у вас есть готовое изображение, например, на SD-карте, то его можно использовать в качестве объекта Drawable.
Drawable можно получить и из ресурсов, хотя такой код выглядит избыточным, если можно сразу вызвать setImageResource().
Метод setImageURI()
Берётся URI файла изображения и используется в качестве источника изображения. Этот способ годится для работы с локальными изображениями.
Загружаем Drawable через URI.
Другие методы
Также вам часто придется использовать методы, связанные с размерами и масштабированием: setMaxHeight(), setMaxWidth(), getMinimunHeight(), getMinimunWidth(), getScaleType(), setScaleType().
Масштабирование через свойство Scale Type
Для масштабирования картинки в ImageView есть свойство Scale Type и соответствующий ему атрибут android:scaleType и перечисление ImageView.ScaleType.
- CENTER
- CENTER_CROP
- CENTER_INSIDE
- FIT_CENTER
- FIT_START
- FIT_END
- FIT_XY
- MATRIX
Чтобы увидеть разницу между разными режимами, желательно использовать большую картинку, превосходящую по ширине экрана устройства. Допустим, у нас есть простенькая разметка:
Для наглядности я задал красный цвет для фона ImageView.
Режим android:scaleType=»center» выводит картинку в центре без масштабирования. Если у вас будет картинка большего размера, то края могут быть обрезаны.
Режим android:scaleType=»centerCrop» также размещает картинку в центре, но учитывает ширину или высоту контейнера. Режим попытается сделать так, чтобы ширина (или высота) картинки совпала с шириной (или высотой) контейнера, а остальное обрезается.
Режим android:scaleType=»centerInside» масштабирует картинку, сохраняя пропорции. Можно увидеть задний фон контейнера, если его размеры отличаются от размера картинки.
Режим android:scaleType=»fitCenter» (по умолчанию) похож на предыдущий, но может не сохранять пропорции.
Если выбрать режим android:scaleType=»fitStart», то картинка прижимается к левому верхнему углу и таким образом заполняет верхнюю половину контейнера.
Значение android:scaleType=»fitEnd» сместит картинку в нижнюю часть контейнера.
Режим android:scaleType=»fitXY» растягивает/сжимает картинку, чтобы подогнать её к контейнеру. Может получиться вытянутая картинка, поэтому будьте осторожны.
Последний атрибут android:scaleType=»matrix» вывел картинку без изменений в левом верхнем углу с обрезанными краями.
Атрибут android:adjustViewBounds=»true»
При использовании атрибута scaleType=»fitCenter» из предыдущего примера Android вычисляет размеры самой картинки, игнорируя размеры ImageView. В этом случае ваша разметка может «поехать». Атрибут adjustViewBounds заставляет картинку подчиниться размеру компонента-контейнера. В некоторых случаях это может не сработать, например, если у ImageView установлен атрибут layout_width=»0dip». В таком случае поместите ImageView в RelativeLayout или FrameLayout и используйте значение 0dip для этих контейнеров.
Загрузка изображения из галереи
Предположим, у вас есть на экране компонент ImageView, и вы хотите загрузить в него какое-нибудь изображение из галереи по нажатию кнопки:
Намерение ACTION_PICK вызывает отображение галереи всех изображений, хранящихся на телефоне, позволяя выбрать одно изображение. При этом возвращается адрес URI, определяющий местоположение выбранного изображения. Для его получения используется метод getData(). Далее для преобразования URI-адреса в соответствующий экземпляр класса Bitmap используется специальный метод Media.getBitmap(). И у нас появляется возможность установить изображение в ImageView при помощи setImageBitmap().
На самом деле можно поступить ещё проще и использовать метод setImageURI.
Сравните с предыдущим примером — чувствуете разницу? Тем не менее, приходится часто наблюдать подобный избыточный код во многих проектах. Это связано с тем, что метод порой кэширует адрес и не происходит изменений. Рекомендуется использовать инструкцию setImageURI(null) для сброса кэша и повторный вызов метода с нужным Uri.
В последних версиях системных эмуляторов два примера не работают. Проверяйте на реальных устройствах.
Получить размеры ImageView — будьте осторожны
У элемента ImageView есть два метода getWidth() и getHeight(), позволяющие получить его ширину и высоту. Но если вы попробуете вызвать указанные методы сразу в методе onCreate(), то они возвратят нулевые значения. Можно добавить кнопку и вызвать данные методы через нажатие, тогда будут получены правильные результаты. Либо использовать другой метод активности, который наступает позже.
Копирование изображений между ImageView
Если вам надо скопировать изображение из одного ImageView в другой, то можно получить объект Drawable через метод getDrawable() и присвоить ему второму компоненту.
Примеры
В моих статьях можно найти примеры использования ImageView.
Источник
Невозможно изменить видимость ImageView
У меня есть ListView с помощью настраиваемого адаптера для заполнения ListView.
Как вы можете видеть, видимость ImageView исчезла. Я хочу сделать его видимым для одной конкретной строки. Вот код, который я пробовал, но он не работает …
Я заработал. Я использовал это для запуска активности ListView.
В деятельности ListView,
Затем я добавил это в bindview()
Я заработал. Я использовал это для запуска операции просмотра списка.
В деятельности listview,
Затем я добавил это в bindview ()
Возможно, вы должны сделать это в getView() вашего адаптера
Вы должны сделать это так
Если он работает некоторое время, я могу помочь вам. Случилось так, что всякий раз, когда вы перемещаете список, он снова воссоздает все представления, и в этом случае он никогда не сохраняет последнее состояние зрения. Итак, что вам нужно сделать, это сохранить состояние каждого вашего изображения и в getView (), которое вы должны установить соответственно. Я отправляю один из своих ответов, который может вам помочь. Вот вам небольшой код для вашей помощи: я создам логический arraylist.
Private ArrayList imageview_visible = null;
Затем я установлю состояния всего изображения как false в моем конструкторе:
В своем getView напишите этот код:
Public View getView (int position, View convertView, родительская группа ViewGroup)/>
Всякий раз, когда вы открываете или скрываете свой вид, просто сохраните его в imageview_visible.set (true или false), это сохранит состояние всех ваших изображений и задает каждый вид изображения соответственно
Используйте LayoutInflater для получения объекта просмотра
Попробуйте следующий код следующим образом:
Это работает для меня … Это может вам помочь.
Я столкнулся с аналогичными проблемами, когда несколько виджетов появлялись для некоторых строк, но не для других. Проблемы были вызваны переработкой. Я не совсем уверен, что это ваша проблема здесь, но вы все равно должны ее обработать. Фокус в том, чтобы установить видимость для каждой строки; А не только для строки, которую вы хотите отобразить / исчезнуть.
В противном случае вы предполагаете, что для позиций, отличных от 0, видимость GONE, но это может быть не так, если вы хотите пересмотреть вид. Кстати, я делаю эту работу в bindView. Не уверен, что это технически правильно.
У меня такая же проблема … я решил с нестандартным решением, но работал для меня …
Импорт R из Android
И iv.setVisibility(View.VISIBLE); И iv.setVisibility(ImageView.VISIBLE); Исправлены, но лучше использовать View вместо ImageView потому что VISIBLE & GONE определены в классе View .
Вы больше всего меняете как видимость ( VISIBLE и GONE ) в том, if . как:
Источник
Image View Class
Definition
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Displays image resources, for example android.graphics.Bitmap or android.graphics.drawable.Drawable resources.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Constructors
A constructor used when creating managed representations of JNI objects; called by the runtime.
Fields
Live region mode specifying that accessibility services should interrupt ongoing speech to immediately announce changes to this view.
(Inherited from View)
Live region mode specifying that accessibility services should not automatically announce changes to this view.
(Inherited from View)
Live region mode specifying that accessibility services should announce changes to this view.
(Inherited from View)
Flag requesting you to add views that are marked as not important for autofill (see #setImportantForAutofill(int) ) to a ViewStructure .
(Inherited from View)
Hint indicating that this view can be autofilled with a credit card expiration date.
(Inherited from View)
Hint indicating that this view can be autofilled with a credit card expiration day.
(Inherited from View)
Hint indicating that this view can be autofilled with a credit card expiration month.
(Inherited from View)
Hint indicating that this view can be autofilled with a credit card expiration year.
(Inherited from View)
Hint indicating that this view can be autofilled with a credit card number.
(Inherited from View)
Hint indicating that this view can be autofilled with a credit card security code.
(Inherited from View)
Hint indicating that this view can be autofilled with an email address.
(Inherited from View)
Hint indicating that this view can be autofilled with a user’s real name.
(Inherited from View)
Hint indicating that this view can be autofilled with a password.
(Inherited from View)
Hint indicating that this view can be autofilled with a phone number.
(Inherited from View)
Hint indicating that this view can be autofilled with a postal address.
(Inherited from View)
Hint indicating that this view can be autofilled with a postal code.
(Inherited from View)
Hint indicating that this view can be autofilled with a username.
(Inherited from View)
Autofill type for a field that contains a date, which is represented by a long representing the number of milliseconds since the standard base time known as «the epoch», namely January 1, 1970, 00:00:00 GMT (see java.util.Date#getTime() .
(Inherited from View)
Autofill type for a selection list field, which is filled by an int representing the element index inside the list (starting at 0 ).
(Inherited from View)
Autofill type for views that cannot be autofilled.
(Inherited from View)
Autofill type for a text field, which is filled by a CharSequence .
(Inherited from View)
Autofill type for a togglable field, which is filled by a boolean .
(Inherited from View)
Flag indicating that a drag can cross window boundaries.
(Inherited from View)
When this flag is used with #DRAG_FLAG_GLOBAL_URI_READ and/or #DRAG_FLAG_GLOBAL_URI_WRITE , the URI permission grant applies to any URI that is a prefix match against the original granted URI.
(Inherited from View)
When this flag is used with #DRAG_FLAG_GLOBAL , the drag recipient will be able to request read access to the content URI(s) contained in the ClipData object.
(Inherited from View)
When this flag is used with #DRAG_FLAG_GLOBAL , the drag recipient will be able to request write access to the content URI(s) contained in the ClipData object.
(Inherited from View)
Flag indicating that the drag shadow will be opaque.
(Inherited from View)
Find find views that contain the specified content description.
(Inherited from View)
This view determines focusability automatically.
(Inherited from View)
Automatically determine whether a view is important for accessibility.
(Inherited from View)
The view is not important for accessibility.
(Inherited from View)
The view is not important for accessibility, nor are any of its descendant views.
(Inherited from View)
The view is important for accessibility.
(Inherited from View)
Automatically determine whether a view is important for autofill.
(Inherited from View)
The view is not important for autofill, but its children (if any) will be traversed.
(Inherited from View)
The view is not important for autofill, and its children (if any) will not be traversed.
(Inherited from View)
The view is important for autofill, and its children (if any) will be traversed.
(Inherited from View)
The view is important for autofill, but its children (if any) will not be traversed.
(Inherited from View)
Automatically determine whether a view is important for content capture.
(Inherited from View)
The view is not important for content capture, but its children (if any) will be traversed.
(Inherited from View)
The view is not important for content capture, and its children (if any) will not be traversed.
(Inherited from View)
The view is important for content capture, and its children (if any) will be traversed.
(Inherited from View)
The view is important for content capture, but its children (if any) will not be traversed.
(Inherited from View)
Horizontal layout direction of this view is inherited from its parent.
(Inherited from View)
Horizontal layout direction of this view is from deduced from the default language script for the locale.
(Inherited from View)
Horizontal layout direction of this view is from Left to Right.
(Inherited from View)
Horizontal layout direction of this view is from Right to Left.
(Inherited from View)
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() and the childState argument of #resolveSizeAndState(int, int, int) .
(Inherited from View)
Bits of #getMeasuredWidthAndState() and #getMeasuredWidthAndState() that provide the actual measured size.
(Inherited from View)
Bits of #getMeasuredWidthAndState() and #getMeasuredWidthAndState() that provide the additional state bits.
(Inherited from View)
Bit of #getMeasuredWidthAndState() and #getMeasuredWidthAndState() that indicates the measured size is smaller that the space the view would like to have.
(Inherited from View)
Used to mark a View that has no ID.
(Inherited from View)
This view does not want keystrokes.
(Inherited from View)
Always allow a user to over-scroll this view, provided it is a view that can scroll.
(Inherited from View)
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.
(Inherited from View)
Never allow a user to over-scroll this view.
(Inherited from View)
Indicates that the screen has changed state and is now off.
(Inherited from View)
Indicates that the screen has changed state and is now on.
(Inherited from View)
Indicates scrolling along the horizontal axis.
(Inherited from View)
Indicates no axis of view scrolling.
(Inherited from View)
Indicates scrolling along the vertical axis.
(Inherited from View)
The content of this view will be considered for scroll capture if scrolling is possible.
(Inherited from View)
Explicitly exclude this view as a potential scroll capture target.
(Inherited from View)
Explicitly exclude all children of this view as potential scroll capture targets.
(Inherited from View)
Explicitly include this view as a potential scroll capture target.
(Inherited from View)
Flag for #setSystemUiVisibility(int) : View has requested to go into the normal fullscreen mode so that its content can take over the screen while still allowing the user to interact with the application.
(Inherited from View)
Flag for #setSystemUiVisibility(int) : View has requested that the system navigation be temporarily hidden.
(Inherited from View)
Flag for #setSystemUiVisibility(int) : View would like to remain interactive when hiding the navigation bar with #SYSTEM_UI_FLAG_HIDE_NAVIGATION .
(Inherited from View)
Flag for #setSystemUiVisibility(int) : View would like to remain interactive when hiding the status bar with #SYSTEM_UI_FLAG_FULLSCREEN and/or hiding the navigation bar with #SYSTEM_UI_FLAG_HIDE_NAVIGATION .
(Inherited from View)
Flag for SystemUiVisibility: View would like its window to be laid out as if it has requested SystemUiFlagFullscreen, even if it currently hasn’t.
(Inherited from View)
Flag for #setSystemUiVisibility(int) : View would like its window to be laid out as if it has requested #SYSTEM_UI_FLAG_HIDE_NAVIGATION , even if it currently hasn’t.
(Inherited from View)
Flag for #setSystemUiVisibility(int) : When using other layout flags, we would like a stable view of the content insets given to #fitSystemWindows(Rect) .
(Inherited from View)
Flag for #setSystemUiVisibility(int) : Requests the navigation bar to draw in a mode that is compatible with light navigation bar backgrounds.
(Inherited from View)
Flag for #setSystemUiVisibility(int) : Requests the status bar to draw in a mode that is compatible with light status bar backgrounds.
(Inherited from View)
Flag for #setSystemUiVisibility(int) : View has requested the system UI to enter an unobtrusive «low profile» mode.
(Inherited from View)
Special constant for #setSystemUiVisibility(int) : View has requested the system UI (status bar) to be visible (the default).
(Inherited from View)
Flags that can impact the layout in relation to system UI.
(Inherited from View)
Center the paragraph, e.
(Inherited from View)
Default for the root view.
(Inherited from View)
Default text alignment.
(Inherited from View)
Align to the end of the paragraph, e.
(Inherited from View)
Align to the start of the paragraph, e.
(Inherited from View)
Align to the end of the view, which is ALIGN_RIGHT if the view’s resolved layoutDirection is LTR, and ALIGN_LEFT otherwise.
(Inherited from View)
Align to the start of the view, which is ALIGN_LEFT if the view’s resolved layoutDirection is LTR, and ALIGN_RIGHT otherwise.
(Inherited from View)
Text direction is using «any-RTL» algorithm.
(Inherited from View)
Text direction is using «first strong algorithm».
(Inherited from View)
Text direction is using «first strong algorithm».
(Inherited from View)
Text direction is using «first strong algorithm».
(Inherited from View)
Text direction is inherited through ViewGroup
(Inherited from View)
Text direction is coming from the system Locale.
(Inherited from View)
Text direction is forced to LTR.
(Inherited from View)
Text direction is forced to RTL.
(Inherited from View)
The logging tag used by this class with android.
(Inherited from View)
Properties
Return the class name of this object to be used for accessibility purposes.
(Inherited from View)
Gets whether this view is a heading for accessibility purposes. -or- Set if view is a heading for a section of content for accessibility purposes.
(Inherited from View)
Gets the live region mode for this View. -or- Sets the live region mode for this view.
(Inherited from View)
Gets the provider for managing a virtual view hierarchy rooted at this View and reported to android.accessibilityservice.AccessibilityService s that explore the window content.
(Inherited from View)
Gets the id of a view after which this one is visited in accessibility traversal. -or- Sets the id of a view after which this one is visited in accessibility traversal.
(Inherited from View)
Gets the id of a view before which this one is visited in accessibility traversal. -or- Sets the id of a view before which this one is visited in accessibility traversal.
(Inherited from View)
Indicates the activation state of this view. -or- Changes the activated state of this view.
(Inherited from View)
True when ImageView is adjusting its bounds to preserve the aspect ratio of its drawable
The opacity of the view. -or- Sets the opacity of the view to a value from 0 to 1, where 0 means the view is completely transparent and 1 means the view is completely opaque.
(Inherited from View)
Get the animation currently associated with this view. -or- Sets the next animation to play for this view.
(Inherited from View)
Retrieve a unique token identifying the top-level «real» window of the window that this view is attached to.
(Inherited from View)
Returns the mapping of attribute resource ID to source resource ID where the attribute value was set.
(Inherited from View)
Gets the unique, logical identifier of this view in the activity, for autofill purposes. -or- Sets the unique, logical identifier of this view in the activity, for autofill purposes.
(Inherited from View)
Describes the autofill type of this view, so an android.service.autofill.AutofillService can create the proper AutofillValue when autofilling the view.
(Inherited from View)
Gets the View ‘s current autofill value.
(Inherited from View)
Gets the background drawable -or- Set the background to a given Drawable, or remove the background.
(Inherited from View)
Return the blending mode used to apply the tint to the background drawable, if specified.
(Inherited from View)
Return the tint applied to the background drawable, if specified. -or- Applies a tint to the background drawable.
(Inherited from View)
Return the blending mode used to apply the tint to the background drawable, if specified.
(Inherited from View)
Return the offset of the widget’s text baseline from the widget’s top boundary.
(Inherited from View)
Checks whether this view’s baseline is considered the bottom of the view. -or- Sets whether the baseline of this view to the bottom of the view.
Bottom position of this view relative to its parent. -or- Sets the bottom position of this view relative to its parent.
(Inherited from View)
Returns the strength, or intensity, of the bottom faded edge.
(Inherited from View)
Amount by which to extend the bottom fading region.
(Inherited from View)
Gets the distance along the Z axis from the camera to this view.
(Inherited from View)
Returns the runtime class of this Object .
(Inherited from Object)
Indicates whether this view reacts to click events or not. -or- Enables or disables click events for this view.
(Inherited from View)
Returns a copy of the current #setClipBounds(Rect) clipBounds . -or- Sets a rectangular area on this view to which the view will be clipped when it is drawn.
(Inherited from View)
Returns whether the Outline should be used to clip the contents of the View. -or- Sets whether the View’s Outline should be used to clip the contents of the View.
(Inherited from View)
Returns the active color filter for this ImageView.
Gets the session used to notify content capture events. -or- Sets the (optional) ContentCaptureSession associated with this view.
(Inherited from View)
Returns the View ‘s content description. -or- Sets the View ‘s content description.
(Inherited from View)
Returns the context the view is running in, through which it can access the current theme, resources, etc.
(Inherited from View)
Indicates whether this view reacts to context clicks or not. -or- Enables or disables context clicking for this view.
(Inherited from View)
Views should implement this if they have extra information to associate with the context menu.
(Inherited from View)
Return whether this ImageView crops to padding. -or- Sets whether this ImageView will crop to padding.
/** Returns whether this View should use a default focus highlight when it gets focused but doesn’t have android.R.attr#state_focused defined in its background. -or- Sets whether this View should use a default focus highlight when it gets focused but doesn’t have android.R.attr#state_focused defined in its background.
(Inherited from View)
Gets the logical display to which the view’s window has been attached.
(Inherited from View)
Gets the current Drawable, or null if no Drawable has been assigned.
Calling this method is equivalent to calling getDrawingCache(false) .
(Inherited from View)
Setting a solid background color for the drawing cache’s bitmaps will improve performance and memory usage.
(Inherited from View)
Indicates whether the drawing cache is enabled for this view. -or- Enables or disables the drawing cache.
(Inherited from View)
Returns the quality of the drawing cache. -or- Set the drawing cache quality of this view.
(Inherited from View)
Return the time at which the drawing of the view hierarchy started.
(Inherited from View)
Indicates whether this duplicates its drawable state from its parent. -or- Enables or disables the duplication of the parent’s state into this view.
(Inherited from View)
The base elevation of this view relative to its parent, in pixels. -or- Sets the base elevation of this view, in pixels.
(Inherited from View)
Returns the enabled status for this view. -or- Set the enabled state of this view.
(Inherited from View)
Returns the resource ID for the style specified using style=». » in the AttributeSet ‘s backing XML element or Resources#ID_NULL otherwise if not specified or otherwise not applicable.
(Inherited from View)
Gets whether the framework should discard touches when the view’s window is obscured by another visible window. -or- Sets whether the framework should discard touches when the view’s window is obscured by another visible window.
(Inherited from View)
Check for state of #setFitsSystemWindows(boolean) .
(Inherited from View)
Returns whether this View is currently able to take focus. -or- Sets whether this view can receive focus.
(Inherited from View)
When a view is focusable, it may not want to take focus when in touch mode. -or- Set whether this view can receive focus while in touch mode.
(Inherited from View)
Returns whether this View should receive focus when the focus is restored for the view hierarchy containing this view. -or- Sets whether this View should receive focus when the focus is restored for the view hierarchy containing this view.
(Inherited from View)
See #setForceDarkAllowed(boolean) -or- Sets whether or not to allow force dark to apply to this view.
(Inherited from View)
Returns the drawable used as the foreground of this View. -or- Supply a Drawable that is to be rendered on top of all of the content in the view.
(Inherited from View)
Describes how the foreground is positioned.
(Inherited from View)
Return the blending mode used to apply the tint to the foreground drawable, if specified.
(Inherited from View)
Return the tint applied to the foreground drawable, if specified. -or- Applies a tint to the foreground drawable.
(Inherited from View)
Return the blending mode used to apply the tint to the foreground drawable, if specified.
(Inherited from View)
The handle to the underlying Android instance.
(Inherited from Object)
Set whether this view should have haptic feedback for events such as long presses.
(Inherited from View)
Returns true if this view is focusable or if it contains a reachable View for which #hasExplicitFocusable() returns true .
(Inherited from View)
Returns true if this view has focus itself, or is the ancestor of the view that has focus.
(Inherited from View)
Returns true if this view is focusable or if it contains a reachable View for which #hasFocusable() returns true .
(Inherited from View)
Returns true if this view has a nested scrolling parent.
(Inherited from View)
Return whether this view has an attached OnClickListener.
(Inherited from View)
Return whether this view has an attached OnLongClickListener.
(Inherited from View)
Returns whether this View has content which overlaps.
(Inherited from View)
Checks pointer capture status.
(Inherited from 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. -or- Set whether this view is currently tracking transient state that the framework should attempt to preserve when possible.
(Inherited from View)
Returns true if this view is in a window that currently has window focus.
(Inherited from View)
Return the height of your view.
(Inherited from View)
Indicate whether the horizontal edges are faded when the view is scrolled horizontally. -or- Define whether the horizontal edges should be faded when this view is scrolled horizontally.
(Inherited from View)
Returns the size of the horizontal faded edges used to indicate that more content in this view is visible.
(Inherited from View)
Indicate whether the horizontal scrollbar should be drawn or not. -or- Define whether the horizontal scrollbar should be drawn or not.
(Inherited from View)
Returns the height of the horizontal scrollbar.
(Inherited from View)
Returns the currently configured Drawable for the thumb of the horizontal scroll bar if it exists, null otherwise. -or- Defines the horizontal thumb drawable
(Inherited from View)
Returns the currently configured Drawable for the track of the horizontal scroll bar if it exists, null otherwise. -or- Defines the horizontal track drawable
(Inherited from View)
Returns true if the view is currently hovered. -or- Sets whether the view is currently hovered.
(Inherited from View)
Returns this view’s identifier. -or- Sets the identifier for this view.
(Inherited from View)
Returns the alpha that will be applied to the drawable of this ImageView. -or- Sets the alpha value that should be applied to the image.
Returns the view’s optional matrix. -or- Adds a transformation Matrix that is applied to the view’s drawable when it is drawn.
Gets the blending mode used to apply the tint to the image Drawable
Get the current android.content.res.ColorStateList used to tint the image Drawable, or null if no tint is applied. -or- Applies a tint to the image drawable.
Gets the blending mode used to apply the tint to the image Drawable
Gets the mode for determining whether this View is important for accessibility. -or- 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.
(Inherited from View)
Gets the mode for determining whether this view is important for autofill. -or- Sets the mode for determining whether this view is considered important for autofill.
(Inherited from View)
Gets the mode for determining whether this view is important for content capture. -or- Sets the mode for determining whether this view is considered important for content capture.
(Inherited from View)
Returns whether this View is accessibility focused.
(Inherited from View)
Returns true if this view is currently attached to a window.
(Inherited from View)
True if this view has changed since the last time being drawn.
(Inherited from View)
Returns true if this view has focus
(Inherited from View)
Indicates whether this view is attached to a hardware accelerated window or not.
(Inherited from View)
Computes whether this view should be exposed for accessibility.
(Inherited from View)
Hints the Android System whether the android.app.assist.AssistStructure.ViewNode associated with this view is considered important for autofill purposes.
(Inherited from View)
Hints the Android System whether this view is considered important for content capture, based on the value explicitly set by #setImportantForContentCapture(int) and heuristics when it’s #IMPORTANT_FOR_CONTENT_CAPTURE_AUTO .
(Inherited from View)
Indicates whether this View is currently in edit mode.
(Inherited from View)
Returns whether the view hierarchy is currently undergoing a layout pass.
(Inherited from View)
Returns whether the device is currently in touch mode.
(Inherited from View)
Returns true if this view has been through at least one layout since it was last attached to or detached from a window.
(Inherited from View)
Indicates whether or not this view’s layout will be requested during the next hierarchy layout pass.
(Inherited from View)
Indicates whether this View is opaque.
(Inherited from View)
If the View draws content inside its padding and enables fading edges, it needs to support padding offsets.
(Inherited from View)
Return if the padding has been set through relative values #setPaddingRelative(int, int, int, int) or through
(Inherited from View)
Returns whether or not a pivot has been set by a call to #setPivotX(float) or #setPivotY(float) .
(Inherited from View)
Indicates whether this view is one of the set of scrollable containers in its window.
(Inherited from View)
Returns true when the View is attached and the system developer setting to show the layout bounds is enabled or false otherwise.
(Inherited from View)
Returns the visibility of this view and all of its ancestors
(Inherited from View)
Returns whether the screen should remain on, corresponding to the current value of #KEEP_SCREEN_ON . -or- Controls whether the screen should remain on, modifying the value of #KEEP_SCREEN_ON .
(Inherited from View)
Returns whether this View is a root of a keyboard navigation cluster. -or- Set whether this view is a root of a keyboard navigation cluster.
(Inherited from View)
Return the global KeyEvent.DispatcherState KeyEvent.DispatcherState for this view’s window.
(Inherited from View)
Gets the id of a view for which this view serves as a label for accessibility purposes. -or- Sets the id of a view for which this view serves as a label for accessibility purposes.
(Inherited from View)
Indicates what type of layer is currently associated with this view.
(Inherited from View)
Returns the resolved layout direction for this view. -or- Set the layout direction for this view.
(Inherited from View)
Get the LayoutParams associated with this view. -or- Set the layout parameters associated with this view.
(Inherited from View)
Left position of this view relative to its parent. -or- Sets the left position of this view relative to its parent.
(Inherited from View)
Returns the strength, or intensity, of the left faded edge.
(Inherited from View)
Amount by which to extend the left fading region.
(Inherited from View)
Indicates whether this view reacts to long click events or not. -or- Enables or disables long click events for this view.
(Inherited from View)
The transform matrix of this view, which is calculated based on the current rotation, scale, and pivot properties.
(Inherited from View)
The maximum height of this view.
The maximum width of this view.
Like #getMeasuredHeightAndState() , but only returns the raw height component (that is the result is masked by #MEASURED_SIZE_MASK ).
(Inherited from View)
Return the full height measurement information for this view as computed by the most recent call to #measure(int, int) .
(Inherited from View)
Return only the state bits of #getMeasuredWidthAndState() and #getMeasuredHeightAndState() , combined into one integer.
(Inherited from View)
Like #getMeasuredWidthAndState() , but only returns the raw width component (that is the result is masked by #MEASURED_SIZE_MASK ).
(Inherited from View)
Return the full width measurement information for this view as computed by the most recent call to #measure(int, int) .
(Inherited from View)
Returns the minimum height of the view.
(Inherited from View)
Returns the minimum width of the view.
(Inherited from View)
Returns true if nested scrolling is enabled for this view. -or- Enable or disable nested scrolling for this view.
(Inherited from View)
Gets the id of the root of the next keyboard navigation cluster. -or- Sets the id of the view to use as the root of the next keyboard navigation cluster.
(Inherited from View)
Gets the id of the view to use when the next focus is #FOCUS_DOWN . -or- Sets the id of the view to use when the next focus is #FOCUS_DOWN .
(Inherited from View)
Gets the id of the view to use when the next focus is #FOCUS_FORWARD . -or- Sets the id of the view to use when the next focus is #FOCUS_FORWARD .
(Inherited from View)
Gets the id of the view to use when the next focus is #FOCUS_LEFT . -or- Sets the id of the view to use when the next focus is #FOCUS_LEFT .
(Inherited from View)
Gets the id of the view to use when the next focus is #FOCUS_RIGHT . -or- Sets the id of the view to use when the next focus is #FOCUS_RIGHT .
(Inherited from View)
Gets the id of the view to use when the next focus is #FOCUS_UP . -or- Sets the id of the view to use when the next focus is #FOCUS_UP .
(Inherited from View)
Returns the focus-change callback registered for this view. -or- Register a callback to be invoked when focus of this view changed.
(Inherited from View)
Returns the current ViewOutlineProvider of the view, which generates the Outline that defines the shape of the shadow it casts, and enables outline clipping. -or- Sets the ViewOutlineProvider of the view, which generates the Outline that defines the shape of the shadow it casts, and enables outline clipping.
(Inherited from View)
Returns the overlay for this view, creating it if it does not yet exist.
(Inherited from View)
Returns the over-scroll mode for this view. -or- Set the over-scroll mode for this view.
(Inherited from View)
Returns the bottom padding of this view.
(Inherited from View)
Returns the end padding of this view depending on its resolved layout direction.
(Inherited from View)
Returns the left padding of this view.
(Inherited from View)
Returns the right padding of this view.
(Inherited from View)
Returns the start padding of this view depending on its resolved layout direction.
(Inherited from View)
Returns the top padding of this view.
(Inherited from View)
Gets the parent of this view.
(Inherited from View)
Gets the parent for accessibility purposes.
(Inherited from View)
The x location of the point around which the view is #setRotation(float) rotated and #setScaleX(float) scaled . -or- Sets the x location of the point around which the view is #setRotation(float) rotated and #setScaleX(float) scaled .
(Inherited from View)
The y location of the point around which the view is #setRotation(float) rotated and #setScaleY(float) scaled . -or- Sets the y location of the point around which the view is #setRotation(float) rotated and #setScaleY(float) scaled .
(Inherited from View)
Gets the pointer icon for the current view. -or- Set the pointer icon for the current view.
(Inherited from View)
Indicates whether the view is currently in pressed state. -or- Sets the pressed state for this view.
(Inherited from View)
Returns the resources associated with this view.
(Inherited from View)
Returns this view’s preference for reveal behavior when it gains focus. -or- Sets this view’s preference for reveal behavior when it gains focus.
(Inherited from View)
Right position of this view relative to its parent. -or- Sets the right position of this view relative to its parent.
(Inherited from View)
Returns the strength, or intensity, of the right faded edge.
(Inherited from View)
Amount by which to extend the right fading region.
(Inherited from View)
The AttachedSurfaceControl itself is not a View, it is just the interface to the windowing-system object that contains the entire view hierarchy.
(Inherited from View)
Finds the topmost view in the current view hierarchy.
(Inherited from View)
Provide original WindowInsets that are dispatched to the view hierarchy.
(Inherited from View)
The degrees that the view is rotated around the pivot point. -or- Sets the degrees that the view is rotated around the pivot point.
(Inherited from View)
The degrees that the view is rotated around the horizontal axis through the pivot point. -or- Sets the degrees that the view is rotated around the horizontal axis through the pivot point.
(Inherited from View)
The degrees that the view is rotated around the vertical axis through the pivot point. -or- Sets the degrees that the view is rotated around the vertical axis through the pivot point.
(Inherited from View)
Indicates whether this view will save its state (that is, whether its #onSaveInstanceState method will be called). -or- Controls whether the saving of this view’s state is enabled (that is, whether its #onSaveInstanceState method will be called).
(Inherited from View)
Indicates whether the entire hierarchy under this view will save its state when a state saving traversal occurs from its parent. -or- Controls whether the entire hierarchy under this view will save its state when a state saving traversal occurs from its parent.
(Inherited from View)
The amount that the view is scaled in x around the pivot point, as a proportion of the view’s unscaled width. -or- Sets the amount that the view is scaled in x around the pivot point, as a proportion of the view’s unscaled width.
(Inherited from View)
The amount that the view is scaled in y around the pivot point, as a proportion of the view’s unscaled height. -or- Sets the amount that the view is scaled in Y around the pivot point, as a proportion of the view’s unscaled width.
(Inherited from View)
Returns whether the view should be treated as a focusable unit by screen reader accessibility tools. -or- Sets whether this View should be a focusable element for screen readers and include non-focusable Views from its subtree when providing feedback.
(Inherited from View)
Returns the delay before scrollbars fade. -or- Define the delay before scrollbars fade.
(Inherited from View)
Returns the scrollbar fade duration. -or- Define the scrollbar fade duration.
(Inherited from View)
Returns true if scrollbars will fade when this view is not scrolling -or- Define whether scrollbars will fade when the view is not scrolling.
(Inherited from View)
Returns the scrollbar size. -or- Define the scrollbar size.
(Inherited from View)
Returns the current scrollbar style. -or- Specify the style of the scrollbars.
(Inherited from View)
Returns the current scroll capture hint for this view. -or- Sets the scroll capture hint for this View.
(Inherited from View)
Returns a bitmask representing the enabled scroll indicators.
(Inherited from View)
Return the scrolled left position of this view. -or- Set the horizontal scrolled position of your view.
(Inherited from View)
Return the scrolled top position of this view. -or- Set the vertical scrolled position of your view.
(Inherited from View)
Indicates the selection state of this view. -or- Changes the selection state of this view.
(Inherited from View)
Override this if your view is known to always be drawn on top of a solid color background, and needs to draw fading edges.
(Inherited from View)
Set whether this view should have sound effects enabled for events such as clicking and touching.
(Inherited from View)
A View can be inflated from an XML layout.
(Inherited from View)
Returns the View ‘s state description. -or- Sets the View ‘s state description.
(Inherited from View)
Returns the current StateListAnimator if exists. -or- Attaches the provided StateListAnimator to this View.
(Inherited from View)
Returns the suggested minimum height that the view should use.
(Inherited from View)
Returns the suggested minimum width that the view should use.
(Inherited from View)
Retrieve the list of areas within this view’s post-layout coordinate space where the system should not intercept touch or other pointing device gestures. -or- Sets a list of areas within this view’s post-layout coordinate space where the system should not intercept touch or other pointing device gestures.
(Inherited from View)
Returns the last #setSystemUiVisibility(int) that this view has requested.
(Inherited from View)
Returns this view’s tag. -or- Sets a tag associated with this view and a key.
(Inherited from View)
Return the resolved text alignment. -or- Set the text alignment.
(Inherited from View)
Return the resolved text direction. -or- Set the text direction.
(Inherited from View)
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
Returns the view’s tooltip text. -or- Sets the tooltip text which will be displayed in a small popup next to the view.
(Inherited from View)
Top position of this view relative to its parent. -or- Sets the top position of this view relative to its parent.
(Inherited from View)
Returns the strength, or intensity, of the top faded edge.
(Inherited from View)
Amount by which to extend the top fading region.
(Inherited from View)
Find and return all touchable views that are descendants of this view, possibly including this view if it is touchable itself.
(Inherited from View)
Gets the TouchDelegate for this View. -or- Sets the TouchDelegate for this View.
(Inherited from View)
This property is intended only for use by the Fade transition, which animates it to produce a visual translucency that does not side-effect (or get affected by) the real alpha property. -or- This property is intended only for use by the Fade transition, which animates it to produce a visual translucency that does not side-effect (or get affected by) the real alpha property.
(Inherited from View)
Returns the name of the View to be used to identify Views in Transitions. -or- Sets the name of the View to be used to identify Views in Transitions.
(Inherited from View)
The horizontal location of this view relative to its #getLeft() left position. -or- Sets the horizontal location of this view relative to its #getLeft() left position.
(Inherited from View)
The vertical location of this view relative to its #getTop() top position. -or- Sets the vertical location of this view relative to its #getTop() top position.
(Inherited from View)
The depth location of this view relative to its #getElevation() elevation . -or- Sets the depth location of this view relative to its #getElevation() elevation .
(Inherited from View)
Get the identifier used for this view by the drawing system.
(Inherited from View)
Indicate whether the vertical edges are faded when the view is scrolled horizontally. -or- Define whether the vertical edges should be faded when this view is scrolled vertically.
(Inherited from View)
Returns the size of the vertical faded edges used to indicate that more content in this view is visible.
(Inherited from View)
Indicate whether the vertical scrollbar should be drawn or not. -or- Define whether the vertical scrollbar should be drawn or not.
(Inherited from View)
Set the position of the vertical scroll bar.
(Inherited from View)
Returns the currently configured Drawable for the thumb of the vertical scroll bar if it exists, null otherwise. -or- Defines the vertical scrollbar thumb drawable
(Inherited from View)
Returns the currently configured Drawable for the track of the vertical scroll bar if it exists, null otherwise. -or- Defines the vertical scrollbar track drawable
(Inherited from View)
Returns the width of the vertical scrollbar.
(Inherited from View)
Returns the ViewTranslationResponse associated with this view.
(Inherited from View)
Returns the ViewTreeObserver for this view’s hierarchy.
(Inherited from View)
Returns the visibility status for this view. -or- Set the visibility state of this view.
(Inherited from View)
Return the width of your view.
(Inherited from View)
Retrieve the WindowId for the window this view is currently attached to.
(Inherited from View)
Retrieves the single WindowInsetsController of the window this view is attached to.
(Inherited from View)
Returns the current system UI visibility that is currently set for the entire window.
(Inherited from View)
Retrieve a unique token identifying the window this view is attached to.
(Inherited from View)
Returns the current visibility of the window this view is attached to (either #GONE , #INVISIBLE , or #VISIBLE ).
(Inherited from View)
Methods
Adds the children of this View relevant for accessibility to the given list as output.
(Inherited from View)
Adds extra data to an AccessibilityNodeInfo based on an explicit request for the additional data.
(Inherited from View)
Add any focusable views that are descendants of this view (possibly including this view if it is focusable itself) to views.
(Inherited from View)
Add any focusable views that are descendants of this view (possibly including this view if it is focusable itself) to views.
(Inherited from View)
Adds any keyboard navigation cluster roots that are descendants of this view (possibly including this view if it is a cluster root itself) to views.
(Inherited from View)
Add a listener for attach state changes.
(Inherited from View)
Add a listener that will be called when the bounds of the view change due to layout processing.
(Inherited from View)
Adds a listener which will receive unhandled KeyEvent s.
(Inherited from View)
Add any touchable views that are descendants of this view (possibly including this view if it is touchable itself) to views.
(Inherited from View)
This method returns a ViewPropertyAnimator object, which can be used to animate specific properties on this View.
(Inherited from View)
Applies a temporary transformation Matrix to the view’s drawable when it is drawn.
Convenience method for sending a AccessibilityEvent#TYPE_ANNOUNCEMENT AccessibilityEvent to suggest that an accessibility service announce the specified text to its users.
(Inherited from View)
Convenience method for sending a AccessibilityEvent#TYPE_ANNOUNCEMENT AccessibilityEvent to suggest that an accessibility service announce the specified text to its users.
(Inherited from View)
Automatically fills the content of the virtual children within this view.
(Inherited from View)
Automatically fills the content of the virtual children within this view.
(Inherited from View)
Trigger the scrollbars to draw.
(Inherited from View)
Trigger the scrollbars to draw.
(Inherited from View)
Trigger the scrollbars to draw.
(Inherited from View)
Change the view’s z order in the tree, so it’s on top of other sibling views.
(Inherited from View)
Calling this method is equivalent to calling buildDrawingCache(false) .
(Inherited from View)
Calling this method is equivalent to calling buildDrawingCache(false) .
(Inherited from View)
Forces this view’s layer to be created and this view to be rendered into its layer.
(Inherited from View)
Directly call any attached OnClickListener.
(Inherited from View)
Cancels an ongoing drag and drop operation.
(Inherited from View)
Cancels a pending long press.
(Inherited from View)
Cancel any deferred high-level input events that were previously posted to the event queue.
(Inherited from View)
Check if layout direction resolution can be done.
(Inherited from View)
Check if text alignment resolution can be done.
(Inherited from View)
Check if text direction resolution can be done.
(Inherited from View)
Check if this view can be scrolled horizontally in a certain direction.
(Inherited from View)
Check if this view can be scrolled vertically in a certain direction.
(Inherited from View)
Called by the android.view.inputmethod.InputMethodManager when a view who is not the current input connection target is trying to make a call on the manager.
(Inherited from View)
Cancels any animations for this view.
(Inherited from View)
Removes the image’s android.graphics.ColorFilter .
Called when this view wants to give up focus.
(Inherited from View)
Clear the ViewTranslationCallback from this view.
(Inherited from View)
Creates and returns a copy of this object.
(Inherited from Object)
Compute the horizontal extent of the horizontal scrollbar’s thumb within the horizontal range.
(Inherited from View)
Compute the horizontal offset of the horizontal scrollbar’s thumb within the horizontal range.
(Inherited from View)
Compute the horizontal range that the horizontal scrollbar represents.
(Inherited from View)
Called by a parent to request that a child update its values for mScrollX and mScrollY if necessary.
(Inherited from View)
Compute insets that should be consumed by this view and the ones that should propagate to those under it.
(Inherited from View)
Compute the vertical extent of the vertical scrollbar’s thumb within the vertical range.
(Inherited from View)
Compute the vertical offset of the vertical scrollbar’s thumb within the horizontal range.
(Inherited from View)
Compute the vertical range that the vertical scrollbar represents.
(Inherited from View)
Returns an AccessibilityNodeInfo representing this view from the point of view of an android.accessibilityservice.AccessibilityService .
(Inherited from View)
Show the context menu for this view.
(Inherited from View)
Frees the resources used by the drawing cache.
(Inherited from View)
Request to apply the given window insets to this view or another view in its subtree.
(Inherited from View)
Pass a captured pointer event down to the focused view.
(Inherited from View)
Dispatch a notification about a resource configuration change down the view hierarchy.
(Inherited from View)
Dispatch to collect the ViewTranslationRequest s for translation purpose by traversing the hierarchy when the app requests ui translation.
(Inherited from View)
Dispatch a hint about whether this view is displayed.
(Inherited from View)
Detects if this View is enabled and has a drag event listener.
(Inherited from View)
Called by draw to draw the child views.
(Inherited from View)
Dispatches drawableHotspotChanged to all of this View’s children.
(Inherited from View)
Dispatch #onFinishTemporaryDetach() to this View and its direct children if this is a container View.
(Inherited from View)
Dispatch a generic motion event to the currently focused view.
(Inherited from View)
Dispatch a generic motion event.
(Inherited from View)
Dispatch a generic motion event to the view under the first pointer.
(Inherited from View)
Dispatch a hover event.
(Inherited from View)
Dispatch a key event to the next view on the focus path.
(Inherited from View)
Dispatch a key event before it is processed by any input method associated with the view hierarchy.
(Inherited from View)
Dispatches a key shortcut event.
(Inherited from View)
Dispatch a fling to a nested scrolling parent.
(Inherited from View)
Dispatch a fling to a nested scrolling parent before it is processed by this view.
(Inherited from View)
Report an accessibility action to this view’s parents for delegated processing.
(Inherited from View)
Dispatch one step of a nested scroll in progress before this view consumes any portion of it.
(Inherited from View)
Dispatch one step of a nested scroll in progress.
(Inherited from View)
Dispatches an AccessibilityEvent to the View first and then to its children for adding their text content to the event.
(Inherited from View)
Dispatches creation of a ViewStructure s for autofill purposes down the hierarchy, when an Assist structure is being created as part of an autofill request.
(Inherited from View)
Dispatch creation of ViewStructure down the hierarchy.
(Inherited from View)
Called by #restoreHierarchyState(android.util.SparseArray) to retrieve the state for this view and its children.
(Inherited from View)
Called by #saveHierarchyState(android.util.SparseArray) to store the state for this view and its children.
(Inherited from View)
Dispatch a scroll capture search request down the view hierarchy.
(Inherited from View)
Dispatch setActivated to all of this View’s children.
(Inherited from View)
Dispatch setPressed to all of this View’s children.
(Inherited from View)
Dispatch setSelected to all of this View’s children.
(Inherited from View)
Dispatch #onStartTemporaryDetach() to this View and its direct children if this is a container View.
(Inherited from View)
Dispatch callbacks to #setOnSystemUiVisibilityChangeListener down the view hierarchy.
(Inherited from View)
Pass the touch screen motion event down to the target view, or this view if it is the target.
(Inherited from View)
Pass a trackball motion event down to the focused view.
(Inherited from View)
This method is the last chance for the focused view and its ancestors to respond to an arrow key.
(Inherited from View)
Dispatch a view visibility change down the view hierarchy.
(Inherited from View)
Called when the window containing this view gains or loses window focus.
(Inherited from View)
Dispatches WindowInsetsAnimation.Callback#onEnd(WindowInsetsAnimation) when Window Insets animation ends.
(Inherited from View)
Dispatches WindowInsetsAnimation.Callback#onPrepare(WindowInsetsAnimation) when Window Insets animation is being prepared.
(Inherited from View)
Dispatches WindowInsetsAnimation.Callback#onProgress(WindowInsets, List) when Window Insets animation makes progress.
(Inherited from View)
Dispatches WindowInsetsAnimation.Callback#onStart(WindowInsetsAnimation, Bounds) when Window Insets animation is started.
(Inherited from View)
Dispatch callbacks to #onWindowSystemUiVisibilityChanged(int) down the view hierarchy.
(Inherited from View)
Dispatch a window visibility change down the view hierarchy.
(Inherited from View)
Manually render this view (and all of its children) to the given Canvas.
(Inherited from View)
This function is called whenever the view hotspot changes and needs to be propagated to drawables or child views managed by the view.
(Inherited from View)
This function is called whenever the state of the view changes in such a way that it impacts the state of drawables being shown.
(Inherited from View)
Indicates whether some other object is «equal to» this one.
(Inherited from Object)
Find the view in the hierarchy rooted at this view that currently has focus.
(Inherited from View)
Finds the first descendant view with the given ID, the view itself if the ID matches #getId() , or null if the ID is invalid ( FindViewById (Int32)
Finds the Views that contain given text.
(Inherited from View)
Finds the Views that contain given text.
(Inherited from View)
Look for a child view with the given tag.
(Inherited from View)
Called by the view hierarchy when the content insets for a window have changed, to allow it to adjust its content to fit within those windows.
(Inherited from View)
Find the nearest view in the specified direction that can take focus.
(Inherited from View)
Sets the behavior for overlapping rendering for this view (see #hasOverlappingRendering() for more details on this behavior).
(Inherited from View)
Forces this view to be laid out during the next layout pass.
(Inherited from View)
This is used by the ViewRoot to perform an optimization when the view hierarchy contains one or several SurfaceView.
(Inherited from View)
Called to generate a DisplayHash for this view.
(Inherited from View)
Returns the delegate for implementing accessibility support via composition.
(Inherited from View)
Returns the ordered list of resource ID that are considered when resolving attribute values for this View .
(Inherited from View)
Gets the hints that help an android.service.autofill.AutofillService determine how to autofill the view with the user’s data.
(Inherited from View)
Returns a copy of the current #setClipBounds(Rect) clipBounds .
(Inherited from View)
Return an array of resource IDs of the drawable states representing the current state of the view.
(Inherited from View)
Calling this method is equivalent to calling getDrawingCache(false) .
(Inherited from View)
Return the visible drawing bounds of your view.
(Inherited from View)
Returns the focusable setting for this view.
(Inherited from View)
Find and return all focusable views that are descendants of this view, possibly including this view if it is focusable itself.
(Inherited from View)
When a view has focus and the user navigates away from it, the next view is searched for starting from the rectangle filled in by this method.
(Inherited from View)
If some part of this view is not clipped by any of its parents, then return that area in r in global (root) coordinates.
(Inherited from View)
If some part of this view is not clipped by any of its parents, then return that area in r in global (root) coordinates.
(Inherited from View)
Returns a hash code value for the object.
(Inherited from Object)
Returns the value for overlapping rendering that is used internally.
(Inherited from View)
Hit rectangle in parent’s coordinates
(Inherited from View)
Compute the view’s coordinate within the surface.
(Inherited from View)
Computes the coordinates of this view in its window.
(Inherited from View)
Returns the MIME types accepted by #performReceiveContent for this view, as configured via #setOnReceiveContentListener .
(Inherited from View)
Returns the current ScaleType that is used to scale the bounds of an image to the bounds of the ImageView.
Returns this view’s tag.
(Inherited from View)
Retrieve the overall visible display size in which the window this view is attached to has been positioned in.
(Inherited from View)
The visual x position of this view, in pixels.
(Inherited from View)
The visual y position of this view, in pixels.
(Inherited from View)
The visual z position of this view, in pixels.
(Inherited from View)
Invalidate the whole view.
(Inherited from View)
Invalidate the whole view.
(Inherited from View)
Invalidate the whole view.
(Inherited from View)
Invalidates the specified Drawable.
(Inherited from View)
Called to rebuild this View’s Outline from its ViewOutlineProvider outline provider
(Inherited from View)
Computes whether this virtual autofill view is visible to the user.
(Inherited from View)
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
(Inherited from Object)
Call Drawable#jumpToCurrentState() Drawable.jumpToCurrentState() on all Drawable objects associated with this view.
(Inherited from View)
Find the nearest keyboard navigation cluster in the specified direction.
(Inherited from View)
Assign a size and position to a view and all of its descendants
(Inherited from View)
This is called to find out how big a view should be.
(Inherited from View)
Wakes up a single thread that is waiting on this object’s monitor.
(Inherited from Object)
Wakes up all threads that are waiting on this object’s monitor.
(Inherited from Object)
Offset this view’s horizontal location by the specified amount of pixels.
(Inherited from View)
Offset this view’s vertical location by the specified number of pixels.
(Inherited from View)
Invoked by a parent ViewGroup to notify the end of the animation currently associated with this view.
(Inherited from View)
Invoked by a parent ViewGroup to notify the start of the animation currently associated with this view.
(Inherited from View)
Called when the view should apply WindowInsets according to its internal policy.
(Inherited from View)
This is called when the view is attached to a window.
(Inherited from View)
Called as the result of a call to #cancelPendingInputEvents() on this view or a parent view.
(Inherited from View)
Implement this method to handle captured pointer events
(Inherited from View)
Check whether the called view is a text editor, in which case it would make sense to automatically display a soft input window for it.
(Inherited from View)
Called when the current configuration of the resources being used by the application have changed.
(Inherited from View)
Views should implement this if the view itself is going to add items to the context menu.
(Inherited from View)
Generate the new Drawable state for this view.
Create a new InputConnection for an InputMethod to interact with the view.
(Inherited from View)
Collects a ViewTranslationRequest which represents the content to be translated in the view.
(Inherited from View)
Collects ViewTranslationRequest s which represents the content to be translated for the virtual views in the host view.
(Inherited from View)
This is called when the view is detached from a window.
(Inherited from View)
Gives this view a hint about whether is displayed or not.
(Inherited from View)
Handles drag events sent by the system following a call to android.view.View#startDragAndDrop(ClipData,DragShadowBuilder,Object,int) startDragAndDrop() .
(Inherited from View)
Implement this to do your drawing.
(Inherited from View)
Draw any foreground content for this view.
(Inherited from View)
Request the drawing of the horizontal and the vertical scrollbar.
(Inherited from View)
Filter the touch event to apply security policies.
(Inherited from View)
Finalize inflating a view from XML.
(Inherited from View)
Called after #onStartTemporaryDetach when the container is done changing the view.
(Inherited from View)
Called by the view system when the focus state of this view changes.
(Inherited from View)
Implement this method to handle generic motion events.
(Inherited from View)
Implement this method to handle hover state changes.
(Inherited from View)
Implement this method to handle hover events.
(Inherited from View)
Initializes an AccessibilityEvent with information about this View which is the event source.
(Inherited from View)
Initializes an AccessibilityNodeInfo with information about this view.
(Inherited from View)
Default implementation of KeyEvent.Callback#onKeyDown(int, KeyEvent) KeyEvent.Callback.onKeyDown() : perform press of the view when KeyEvent#KEYCODE_DPAD_CENTER or KeyEvent#KEYCODE_ENTER is released, if the view is enabled and clickable.
(Inherited from View)
Default implementation of KeyEvent.Callback#onKeyLongPress(int, KeyEvent) KeyEvent.Callback.onKeyLongPress() : always returns false (doesn’t handle the event).
(Inherited from View)
Default implementation of KeyEvent.Callback#onKeyMultiple(int, int, KeyEvent) KeyEvent.Callback.onKeyMultiple() : always returns false (doesn’t handle the event).
(Inherited from View)
Handle a key event before it is processed by any input method associated with the view hierarchy.
(Inherited from View)
Called on the focused view when a key shortcut event is not handled.
(Inherited from View)
Default implementation of KeyEvent.Callback#onKeyUp(int, KeyEvent) KeyEvent.Callback.onKeyUp() : perform clicking of the view when KeyEvent#KEYCODE_DPAD_CENTER , KeyEvent#KEYCODE_ENTER or KeyEvent#KEYCODE_SPACE is released.
(Inherited from View)
Called from layout when this view should assign a size and position to each of its children.
(Inherited from View)
Measure the view and its content to determine the measured width and the measured height.
(Inherited from View)
Called by #overScrollBy(int, int, int, int, int, int, int, int, boolean) to respond to the results of an over-scroll operation.
(Inherited from View)
Called when the window has just acquired or lost pointer capture.
(Inherited from View)
Called from #dispatchPopulateAccessibilityEvent(AccessibilityEvent) giving a chance to this View to populate the accessibility event with its text content.
(Inherited from View)
Populates a ViewStructure to fullfil an autofill request.
(Inherited from View)
Populates a ViewStructure containing virtual children to fullfil an autofill request.
(Inherited from View)
Populates a ViewStructure for content capture.
(Inherited from View)
Called when assist structure is being retrieved from a view as part of android.app.Activity#onProvideAssistData Activity.onProvideAssistData .
(Inherited from View)
Called when assist structure is being retrieved from a view as part of android.app.Activity#onProvideAssistData Activity.onProvideAssistData to generate additional virtual structure under this view.
(Inherited from View)
Implements the default behavior for receiving content for this type of view.
(Inherited from View)
Returns the pointer icon for the motion event, or null if it doesn’t specify the icon.
(Inherited from View)
Hook allowing a view to re-apply a representation of its internal state that had previously been generated by #onSaveInstanceState .
(Inherited from View)
Called when any RTL property (layout direction or text direction or text alignment) has been changed.
(Inherited from View)
Hook allowing a view to generate a representation of its internal state that can later be used to create a new instance with that same state.
(Inherited from View)
This method is called whenever the state of the screen this view is attached to changes.
(Inherited from View)
Called when scroll capture is requested, to search for appropriate content to scroll.
(Inherited from View)
This is called in response to an internal scroll in this view (i.
(Inherited from View)
Invoked if there is a Transform that involves alpha.
(Inherited from View)
This is called during layout when the size of this view has changed.
(Inherited from View)
This is called when a container is going to temporarily detach a child, with ViewGroup#detachViewFromParent(View) ViewGroup.detachViewFromParent .
(Inherited from View)
Implement this method to handle touch screen motion events.
(Inherited from View)
Implement this method to handle trackball motion events.
(Inherited from View)
Called when the content from View#onCreateViewTranslationRequest had been translated by the TranslationService.
(Inherited from View)
Called when the content from View#onCreateVirtualViewTranslationRequests had been translated by the TranslationService.
(Inherited from View)
Called when the user-visibility of this View is potentially affected by a change to this view itself, an ancestor view or the window this view is attached to.
(Inherited from View)
Called when the visibility of the view or an ancestor of the view has changed.
(Inherited from View)
Called when the window containing this view gains or loses focus.
(Inherited from View)
Override to find out when the window’s requested system UI visibility has changed, that is the value returned by #getWindowSystemUiVisibility() .
(Inherited from View)
Called when the window containing has change its visibility (between #GONE , #INVISIBLE , and #VISIBLE ).
(Inherited from View)
Scroll the view with standard behavior for scrolling beyond the normal content boundaries.
(Inherited from View)
Performs the specified accessibility action on the view.
(Inherited from View)
Performs the specified accessibility action on the view.
(Inherited from View)
Call this view’s OnClickListener, if it is defined.
(Inherited from View)
Call this view’s OnContextClickListener, if it is defined.
(Inherited from View)
Call this view’s OnContextClickListener, if it is defined.
(Inherited from View)
(Inherited from View)
(Inherited from View)
Calls this view’s OnLongClickListener, if it is defined.
(Inherited from View)
Calls this view’s OnLongClickListener, if it is defined.
(Inherited from View)
Receives the given content.
(Inherited from View)
Play a sound effect for this view.
(Inherited from View)
Causes the Runnable to be added to the message queue.
(Inherited from View)
Causes the Runnable to be added to the message queue, to be run after the specified amount of time elapses.
(Inherited from View)
Cause an invalidate to happen on a subsequent cycle through the event loop.
(Inherited from View)
Cause an invalidate to happen on a subsequent cycle through the event loop.
(Inherited from View)
Cause an invalidate to happen on a subsequent cycle through the event loop.
(Inherited from View)
Cause an invalidate to happen on a subsequent cycle through the event loop.
(Inherited from View)
Cause an invalidate to happen on the next animation time step, typically the next display frame.
(Inherited from View)
Cause an invalidate to happen on the next animation time step, typically the next display frame.
(Inherited from View)
Causes the Runnable to execute on the next animation time step.
(Inherited from View)
Causes the Runnable to execute on the next animation time step, after the specified amount of time elapses.
(Inherited from View)
Call this to force a view to update its drawable state.
(Inherited from View)
Releases the pointer capture.
(Inherited from View)
Removes the specified Runnable from the message queue.
(Inherited from View)
Remove a listener for attach state changes.
(Inherited from View)
Remove a listener for layout changes.
(Inherited from View)
Removes a listener which will receive unhandled KeyEvent s.
(Inherited from View)
Ask that a new dispatch of #onApplyWindowInsets(WindowInsets) be performed.
(Inherited from View)
Ask that a new dispatch of #fitSystemWindows(Rect) be performed.
(Inherited from View)
Call this to try to give focus to a specific view or to one of its descendants.
(Inherited from View)
Call this to try to give focus to a specific view or to one of its descendants.
(Inherited from View)
Call this to try to give focus to a specific view or to one of its descendants.
(Inherited from View)
Call this to try to give focus to a specific view or to one of its descendants.
(Inherited from View)
Call this when something has changed which has invalidated the layout of this view.
(Inherited from View)
Requests pointer capture mode.
(Inherited from View)
Request that a rectangle of this view be visible on the screen, scrolling if necessary just enough.
(Inherited from View)
Request that a rectangle of this view be visible on the screen, scrolling if necessary just enough.
(Inherited from View)
Request unbuffered dispatch of the given event source class to this view.
(Inherited from View)
Request unbuffered dispatch of the given event source class to this view.
(Inherited from View)
Finds the first descendant view with the given ID, the view itself if the ID matches #getId() , or throws an IllegalArgumentException if the ID is invalid or there is no matching view in the hierarchy.
(Inherited from View)
Clears any pivot previously set by a call to #setPivotX(float) or #setPivotY(float) .
(Inherited from View)
Gives focus to the default-focus view in the view hierarchy that has this view as a root.
(Inherited from View)
Restore this view hierarchy’s frozen state from the given container.
(Inherited from View)
Stores debugging information about attributes.
(Inherited from View)
Store this view hierarchy’s frozen state into the given container.
(Inherited from View)
Schedules an action on a drawable to occur at a specified time.
(Inherited from View)
Move the scrolled position of your view.
(Inherited from View)
Set the scrolled position of your view.
(Inherited from View)
Sends an accessibility event of the given type.
(Inherited from View)
This method behaves exactly as #sendAccessibilityEvent(int) but takes as an argument an empty AccessibilityEvent and does not perform a check whether accessibility is enabled.
(Inherited from View)
Sets a delegate for implementing accessibility support via composition (as opposed to inheritance).
(Inherited from View)
Set this to true if you want the ImageView to adjust its bounds to preserve the aspect ratio of its drawable.
Enables or disables click events for this view when disabled.
(Inherited from View)
Sets the alpha value that should be applied to the image.
Sets the hints that help an android.service.autofill.AutofillService determine how to autofill the view with the user’s data.
(Inherited from View)
Sets the background color for this view.
(Inherited from View)
Set the background to a given resource.
(Inherited from View)
Set the offset of the widget’s text baseline from the widget’s top boundary.
Sets the distance along the Z axis (orthogonal to the X/Y plane on which views are drawn) from the camera to this view.
(Inherited from View)
Set a tinting option for the image.
Set a tinting option for the image.
Set a tinting option for the image.
Set the size of the faded edge used to indicate that more content in this view is available.
(Inherited from View)
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.
(Inherited from View)
Sets whether this view can receive focus.
(Inherited from View)
Describes how the foreground is positioned.
(Inherited from View)
Assign a size and position to this view.
Sets the Handle property.
(Inherited from Object)
Sets a Bitmap as the content of this ImageView.
Sets a drawable as the content of this ImageView.
Sets the content of this ImageView to the specified Icon.
Sets the image level, when it is constructed from a android.graphics.drawable.LevelListDrawable .
Sets a drawable as the content of this ImageView.
Set the state of the current android.graphics.drawable.StateListDrawable .
Sets the content of this ImageView to the specified Uri.
Updates the Paint object used with the current layer (used only if the current layer type is not set to #LAYER_TYPE_NONE ).
(Inherited from View)
Specifies the type of layer backing this view.
(Inherited from View)
Assign a size and position to this view.
(Inherited from View)
An optional argument to supply a maximum height for this view.
An optional argument to supply a maximum width for this view.
This method must be called by #onMeasure(int, int) to store the measured width and measured height.
(Inherited from View)
Sets the minimum height of the view.
(Inherited from View)
Sets the minimum width of the view.
(Inherited from View)
Set an OnApplyWindowInsetsListener to take over the policy for applying window insets to this view.
(Inherited from View)
Set a listener to receive callbacks when the pointer capture state of a view changes.
(Inherited from View)
Register a callback to be invoked when this view is clicked.
(Inherited from View)
Register a callback to be invoked when this view is context clicked.
(Inherited from View)
Register a callback to be invoked when the context menu for this view is being built.
(Inherited from View)
Register a drag event listener callback object for this View.
(Inherited from View)
Register a callback to be invoked when a generic motion event is sent to this view.
(Inherited from View)
Register a callback to be invoked when a hover event is sent to this view.
(Inherited from View)
Register a callback to be invoked when a hardware key is pressed in this view.
(Inherited from View)
Register a callback to be invoked when this view is clicked and held.
(Inherited from View)
Sets the listener to be #performReceiveContent used to handle insertion of content into this view.
(Inherited from View)
Register a callback to be invoked when the scroll X or Y positions of this view change.
(Inherited from View)
Set a listener to receive callbacks when the visibility of the system bar changes.
(Inherited from View)
Register a callback to be invoked when a touch event is sent to this view.
(Inherited from View)
Sets the color of the ambient shadow that is drawn when the view has a positive Z or elevation value.
(Inherited from View)
Sets the color of the spot shadow that is drawn when the view has a positive Z or elevation value.
(Inherited from View)
Sets the padding.
(Inherited from View)
Sets the relative padding.
(Inherited from View)
Configure the android.graphics.RenderEffect to apply to this View.
(Inherited from View)
Controls how the image should be resized or moved to match the size of this ImageView.
Sets the callback to receive scroll capture requests.
(Inherited from View)
Change whether this view is one of the set of scrollable containers in its window.
(Inherited from View)
Sets the state of all scroll indicators.
(Inherited from View)
Sets the state of all scroll indicators.
(Inherited from View)
Sets a tag associated with this view and a key.
(Inherited from View)
Changes the visibility of this View without triggering any other changes.
(Inherited from View)
Sets a ViewTranslationCallback that is used to display/hide the translated information.
(Inherited from View)
When a View’s drawing cache is enabled, drawing is redirected to an offscreen bitmap.
(Inherited from View)
If this view doesn’t do any drawing on its own, set this flag to allow further optimizations.
(Inherited from View)
Sets a WindowInsetsAnimation.Callback to be notified about animations of windows that cause insets.
(Inherited from View)
Sets the visual x position of this view, in pixels.
(Inherited from View)
Sets the visual y position of this view, in pixels.
(Inherited from View)
Sets the visual z position of this view, in pixels.
(Inherited from View)
Shows the context menu for this view.
(Inherited from View)
Shows the context menu for this view.
(Inherited from View)
Start an action mode with the default type ActionMode#TYPE_PRIMARY .
(Inherited from View)
Start an action mode with the default type ActionMode#TYPE_PRIMARY .
(Inherited from View)
Start the specified animation now.
(Inherited from View)
Starts a drag and drop operation.
(Inherited from View)
Starts a drag and drop operation.
(Inherited from View)
Begin a nestable scroll operation along the given axes.
(Inherited from View)
Stop a nested scroll in progress.
(Inherited from View)
Returns a string representation of the object.
(Inherited from Object)
Modifies the input matrix such that it maps view-local coordinates to on-screen coordinates.
(Inherited from View)
Modifies the input matrix such that it maps on-screen coordinates to view-local coordinates.
(Inherited from View)
Unschedule any events associated with the given Drawable.
(Inherited from View)
Unschedule any events associated with the given Drawable.
(Inherited from View)
Updates the drag shadow for the ongoing drag and drop operation.
(Inherited from View)
If your view subclass is displaying its own Drawable objects, it should override this function and return true for any Drawable it is displaying.
(Inherited from View)
Causes the current thread to wait until another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object.
(Inherited from Object)
Causes the current thread to wait until another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object.
(Inherited from Object)
Causes the current thread to wait until another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object.
(Inherited from Object)
Returns whether or not this View can cache its drawing or not.
(Inherited from View)
Returns whether or not this View draws on its own.
(Inherited from View)
Events
CapturedPointer | (Inherited from View) |
Click | (Inherited from View) |
ContextClick | (Inherited from View) |
ContextMenuCreated | (Inherited from View) |
Drag | (Inherited from View) |
FocusChange | (Inherited from View) |
GenericMotion | (Inherited from View) |
Hover | (Inherited from View) |
KeyPress | (Inherited from View) |
LayoutChange | (Inherited from View) |
LongClick | (Inherited from View) |
ScrollChange | (Inherited from View) |
SystemUiVisibilityChange | (Inherited from View) |
Touch | (Inherited from View) |
UnhandledKeyEvent | (Inherited from View) |
ViewAttachedToWindow | (Inherited from View) |
ViewDetachedFromWindow | (Inherited from View) |
Explicit Interface Implementations
IJavaPeerable.Disposed() | (Inherited from Object) |
IJavaPeerable.DisposeUnlessReferenced() | (Inherited from Object) |
IJavaPeerable.Finalized() | (Inherited from Object) |
IJavaPeerable.JniManagedPeerState | (Inherited from Object) |
IJavaPeerable.SetJniIdentityHashCode(Int32) | (Inherited from Object) |
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) | (Inherited from Object) |
IJavaPeerable.SetPeerReference(JniObjectReference) | (Inherited from Object) |
Extension Methods
Performs an Android runtime-checked type conversion.
Источник