Added in API level 1

ImageSwitcher


open class ImageSwitcher : ViewSwitcher
kotlin.Any
   ↳ android.view.View
   ↳ android.view.ViewGroup
   ↳ android.widget.FrameLayout
   ↳ android.widget.ViewAnimator
   ↳ android.widget.ViewSwitcher
   ↳ android.widget.ImageSwitcher

ViewSwitcher that switches between two ImageViews when a new image is set on it. The views added to an ImageSwitcher must all be ImageViews.

Summary

Inherited XML attributes
Inherited constants
Public constructors

Creates a new empty ImageSwitcher.

ImageSwitcher(context: Context!, attrs: AttributeSet!)

Creates a new empty ImageSwitcher for the given context and with the specified set attributes.

Public methods
open CharSequence!

open Unit

Sets a new drawable on the ImageSwitcher.

open Unit

Sets a new image on the ImageSwitcher with the given resource id.

open Unit

Sets a new image on the ImageSwitcher with the given Uri.

Inherited functions
Inherited properties

Public constructors

ImageSwitcher

Added in API level 1
ImageSwitcher(context: Context!)

Creates a new empty ImageSwitcher.

Parameters
context Context!: the application's environment

ImageSwitcher

Added in API level 1
ImageSwitcher(
    context: Context!,
    attrs: AttributeSet!)

Creates a new empty ImageSwitcher for the given context and with the specified set attributes.

Parameters
context Context!: the application environment
attrs AttributeSet!: a collection of attributes

Public methods

getAccessibilityClassName

Added in API level 23
open fun getAccessibilityClassName(): CharSequence!

setImageDrawable

Added in API level 1
open fun setImageDrawable(drawable: Drawable!): Unit

Sets a new drawable on the ImageSwitcher. This will set that drawable on the next ImageView in the switcher and will then switch to that view.

Parameters
drawable Drawable!: the drawable to be set or null to clear the content

setImageResource

Added in API level 1
open fun setImageResource(resid: Int): Unit

Sets a new image on the ImageSwitcher with the given resource id. This will set that image resource on the next ImageView in the switcher and will then switch to that view.

Parameters
resid Int: a Drawable resource id

setImageURI

Added in API level 1
open fun setImageURI(uri: Uri!): Unit

Sets a new image on the ImageSwitcher with the given Uri. This will set that image on the next ImageView in the switcher and will then switch to that view.

Parameters
uri Uri!: the Uri of an image