Added in API level 1
Deprecated in API level 16

Gallery


open class Gallery : AbsSpinner, GestureDetector.OnGestureListener
kotlin.Any
   ↳ android.view.View
   ↳ android.view.ViewGroup
   ↳ android.widget.AdapterView<android.widget.SpinnerAdapter>
   ↳ android.widget.AbsSpinner
   ↳ android.widget.Gallery

A view that shows items in a center-locked, horizontally scrolling list.

The default values for the Gallery assume you will be using android.R.styleable#Theme_galleryItemBackground as the background for each View given to the Gallery from the Adapter. If you are not doing this, you may need to adjust some Gallery properties, such as the spacing.

Views given to the Gallery should use Gallery.LayoutParams as their layout parameters type.

Summary

Nested classes
open

Gallery extends LayoutParams to provide a place to hold current Transformation information along with previous position/transformation info.

XML attributes
android:animationDuration Sets how long a transition animation should run (in milliseconds) when layout has changed.
android:gravity Specifies how an object should position its content, on both the X and Y axes, within its own bounds.
android:spacing
Inherited XML attributes
Inherited constants
Public constructors
Gallery(context: Context!)

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

Gallery(context: Context!, attrs: AttributeSet!, defStyleAttr: Int)

Gallery(context: Context!, attrs: AttributeSet!, defStyleAttr: Int, defStyleRes: Int)

Public methods
open Boolean

open Unit

open ViewGroup.LayoutParams!

open CharSequence!

open Boolean

open Boolean
onFling(e1: MotionEvent?, e2: MotionEvent, velocityX: Float, velocityY: Float)

open Boolean
onKeyDown(keyCode: Int, event: KeyEvent!)

Handles left, right, and clicking

open Boolean
onKeyUp(keyCode: Int, event: KeyEvent!)

open Unit

Notified when a long press occurs with the initial on down MotionEvent that trigged it.

open Boolean
onScroll(e1: MotionEvent?, e2: MotionEvent, distanceX: Float, distanceY: Float)

open Unit

open Boolean

open Boolean

open Unit
setAnimationDuration(animationDurationMillis: Int)

Sets how long the transition animation should run when a child view changes position.

open Unit

Whether or not to callback on any getOnItemSelectedListener() while the items are being flinged.

open Unit
setGravity(gravity: Int)

Describes how the child views are aligned.

open Unit
setSpacing(spacing: Int)

Sets the spacing between items in a Gallery

open Unit
setUnselectedAlpha(unselectedAlpha: Float)

Sets the alpha of items that are not selected in the Gallery.

open Boolean

open Boolean

open Boolean
showContextMenuForChild(originalView: View!)

open Boolean
showContextMenuForChild(originalView: View!, x: Float, y: Float)

Protected methods
open Boolean

open Int

open Int

open Int

open Unit

open ViewGroup.LayoutParams!

open ViewGroup.LayoutParams!

open Int
getChildDrawingOrder(childCount: Int, i: Int)

open Boolean

open ContextMenu.ContextMenuInfo!

open Unit

open Unit
onFocusChanged(gainFocus: Boolean, direction: Int, previouslyFocusedRect: Rect?)

open Unit
onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int)

Inherited functions