android.widget
Class HorizontalScrollView

java.lang.Object
  extended by android.view.View
      extended by android.view.ViewGroup
          extended by android.widget.FrameLayout
              extended by android.widget.HorizontalScrollView
All Implemented Interfaces:
Drawable.Callback, AccessibilityEventSource, KeyEvent.Callback, ViewManager, ViewParent

public class HorizontalScrollView
extends FrameLayout


Nested Class Summary
 
Nested classes/interfaces inherited from class android.widget.FrameLayout
FrameLayout.LayoutParams
 
Nested classes/interfaces inherited from class android.view.ViewGroup
ViewGroup.MarginLayoutParams, ViewGroup.OnHierarchyChangeListener
 
Nested classes/interfaces inherited from class android.view.View
View.BaseSavedState, View.MeasureSpec, View.OnClickListener, View.OnCreateContextMenuListener, View.OnFocusChangeListener, View.OnKeyListener, View.OnLongClickListener, View.OnTouchListener
 
Field Summary
 
Fields inherited from class android.view.ViewGroup
CLIP_TO_PADDING_MASK, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE
 
Fields inherited from class android.view.View
DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, INVISIBLE, KEEP_SCREEN_ON, NO_ID, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET
 
Constructor Summary
HorizontalScrollView(Context context)
           
HorizontalScrollView(Context context, AttributeSet attrs)
           
HorizontalScrollView(Context context, AttributeSet attrs, int defStyle)
           
 
Method Summary
 void addView(View child)
           
 void addView(View child, int index)
           
 void addView(View child, int index, ViewGroup.LayoutParams params)
           
 void addView(View child, ViewGroup.LayoutParams params)
           
 boolean arrowScroll(int direction)
           
protected  int computeHorizontalScrollRange()
           
 void computeScroll()
           
protected  int computeScrollDeltaToGetChildRectOnScreen(Rect rect)
           
 boolean dispatchKeyEvent(KeyEvent event)
           
 boolean executeKeyEvent(KeyEvent event)
           
 void fling(int velocityX)
           
 boolean fullScroll(int direction)
           
protected  float getLeftFadingEdgeStrength()
           
 int getMaxScrollAmount()
           
protected  float getRightFadingEdgeStrength()
           
 boolean isFillViewport()
           
 boolean isSmoothScrollingEnabled()
           
protected  void measureChild(View child, int parentWidthMeasureSpec, int parentHeightMeasureSpec)
           
protected  void measureChildWithMargins(View child, int parentWidthMeasureSpec, int widthUsed, int parentHeightMeasureSpec, int heightUsed)
           
 boolean onInterceptTouchEvent(MotionEvent ev)
           
protected  void onLayout(boolean changed, int l, int t, int r, int b)
           
protected  void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
           
protected  boolean onRequestFocusInDescendants(int direction, Rect previouslyFocusedRect)
           
protected  void onSizeChanged(int w, int h, int oldw, int oldh)
           
 boolean onTouchEvent(MotionEvent ev)
           
 boolean pageScroll(int direction)
           
 void requestChildFocus(View child, View focused)
           
 boolean requestChildRectangleOnScreen(View child, Rect rectangle, boolean immediate)
           
 void requestLayout()
           
 void scrollTo(int x, int y)
           
 void setFillViewport(boolean fillViewport)
           
 void setSmoothScrollingEnabled(boolean smoothScrollingEnabled)
           
 void smoothScrollBy(int dx, int dy)
           
 void smoothScrollTo(int x, int y)
           
 
Methods inherited from class android.widget.FrameLayout
checkLayoutParams, draw, drawableStateChanged, gatherTransparentRegion, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getConsiderGoneChildrenWhenMeasuring, getForeground, setForeground, setForegroundGravity, setMeasureAllChildren, verifyDrawable
 
Methods inherited from class android.view.ViewGroup
addFocusables, addFocusables, addStatesFromChildren, addTouchables, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, canAnimate, childDrawableStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchDraw, dispatchFreezeSelfOnly, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetPressed, dispatchSetSelected, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowVisibilityChanged, drawChild, findFocus, fitSystemWindows, focusableViewAvailable, focusSearch, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getPersistentDrawingCache, hasFocus, hasFocusable, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, measureChildren, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onAnimationEnd, onAnimationStart, onCreateDrawableState, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeDetachedView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestDisallowInterceptTouchEvent, requestFocus, requestTransparentRegion, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setOnHierarchyChangeListener, setPadding, setPersistentDrawingCache, setStaticTransformationsEnabled, showContextMenuForChild, startLayoutAnimation, updateViewLayout
 
Methods inherited from class android.view.View
awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, cancelLongPress, checkInputConnectionProxy, clearAnimation, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createContextMenu, destroyDrawingCache, finalize, findViewById, findViewWithTag, focusSearch, forceLayout, getAnimation, getApplicationWindowToken, getBackground, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getContentDescription, getContext, getContextMenuInfo, getDefaultSize, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getKeepScreenOn, getKeyDispatcherState, getLayoutParams, getLeft, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMeasuredHeight, getMeasuredWidth, getNextFocusDownId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParent, getResources, getRight, getRightPaddingOffset, getRootView, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getTag, getTag, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getVerticalFadingEdgeLength, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, hasWindowFocus, inflate, initializeFadingEdge, initializeScrollbars, invalidate, invalidate, invalidate, invalidateDrawable, isClickable, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isInEditMode, isInTouchMode, isLayoutRequested, isLongClickable, isOpaque, isPaddingOffsetRequired, isPressed, isSaveEnabled, isScrollbarFadingEnabled, isSelected, isShown, isSoundEffectsEnabled, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, layout, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAttachedToWindow, onCheckIsTextEditor, onCreateContextMenu, onCreateInputConnection, onDetachedFromWindow, onDraw, onDrawScrollBars, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onRestoreInstanceState, onSaveInstanceState, onScrollChanged, onSetAlpha, onStartTemporaryDetach, onTrackballEvent, onWindowFocusChanged, onWindowVisibilityChanged, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, refreshDrawableState, removeCallbacks, requestFocus, requestFocus, requestFocusFromTouch, requestRectangleOnScreen, requestRectangleOnScreen, resolveSize, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAnimation, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setClickable, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFocusable, setFocusableInTouchMode, setHapticFeedbackEnabled, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setId, setKeepScreenOn, setLayoutParams, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnClickListener, setOnCreateContextMenuListener, setOnFocusChangeListener, setOnKeyListener, setOnLongClickListener, setOnTouchListener, setPressed, setSaveEnabled, setScrollbarFadingEnabled, setScrollBarStyle, setScrollContainer, setSelected, setSoundEffectsEnabled, setTag, setTag, setTouchDelegate, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVisibility, setWillNotCacheDrawing, setWillNotDraw, showContextMenu, startAnimation, unscheduleDrawable, unscheduleDrawable, willNotCacheDrawing, willNotDraw
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface android.view.ViewParent
createContextMenu, getParent, isLayoutRequested
 

Constructor Detail

HorizontalScrollView

public HorizontalScrollView(Context context)

HorizontalScrollView

public HorizontalScrollView(Context context,
                            AttributeSet attrs)

HorizontalScrollView

public HorizontalScrollView(Context context,
                            AttributeSet attrs,
                            int defStyle)
Method Detail

getLeftFadingEdgeStrength

protected float getLeftFadingEdgeStrength()
Overrides:
getLeftFadingEdgeStrength in class View

getRightFadingEdgeStrength

protected float getRightFadingEdgeStrength()
Overrides:
getRightFadingEdgeStrength in class View

getMaxScrollAmount

public int getMaxScrollAmount()

addView

public void addView(View child)
Overrides:
addView in class ViewGroup

addView

public void addView(View child,
                    int index)
Overrides:
addView in class ViewGroup

addView

public void addView(View child,
                    ViewGroup.LayoutParams params)
Specified by:
addView in interface ViewManager
Overrides:
addView in class ViewGroup

addView

public void addView(View child,
                    int index,
                    ViewGroup.LayoutParams params)
Overrides:
addView in class ViewGroup

isFillViewport

public boolean isFillViewport()

setFillViewport

public void setFillViewport(boolean fillViewport)

isSmoothScrollingEnabled

public boolean isSmoothScrollingEnabled()

setSmoothScrollingEnabled

public void setSmoothScrollingEnabled(boolean smoothScrollingEnabled)

onMeasure

protected void onMeasure(int widthMeasureSpec,
                         int heightMeasureSpec)
Overrides:
onMeasure in class FrameLayout

dispatchKeyEvent

public boolean dispatchKeyEvent(KeyEvent event)
Overrides:
dispatchKeyEvent in class ViewGroup

executeKeyEvent

public boolean executeKeyEvent(KeyEvent event)

onInterceptTouchEvent

public boolean onInterceptTouchEvent(MotionEvent ev)
Overrides:
onInterceptTouchEvent in class ViewGroup

onTouchEvent

public boolean onTouchEvent(MotionEvent ev)
Overrides:
onTouchEvent in class View

pageScroll

public boolean pageScroll(int direction)

fullScroll

public boolean fullScroll(int direction)

arrowScroll

public boolean arrowScroll(int direction)

smoothScrollBy

public final void smoothScrollBy(int dx,
                                 int dy)

smoothScrollTo

public final void smoothScrollTo(int x,
                                 int y)

computeHorizontalScrollRange

protected int computeHorizontalScrollRange()
Overrides:
computeHorizontalScrollRange in class View

measureChild

protected void measureChild(View child,
                            int parentWidthMeasureSpec,
                            int parentHeightMeasureSpec)
Overrides:
measureChild in class ViewGroup

measureChildWithMargins

protected void measureChildWithMargins(View child,
                                       int parentWidthMeasureSpec,
                                       int widthUsed,
                                       int parentHeightMeasureSpec,
                                       int heightUsed)
Overrides:
measureChildWithMargins in class ViewGroup

computeScroll

public void computeScroll()
Overrides:
computeScroll in class View

computeScrollDeltaToGetChildRectOnScreen

protected int computeScrollDeltaToGetChildRectOnScreen(Rect rect)

requestChildFocus

public void requestChildFocus(View child,
                              View focused)
Specified by:
requestChildFocus in interface ViewParent
Overrides:
requestChildFocus in class ViewGroup

onRequestFocusInDescendants

protected boolean onRequestFocusInDescendants(int direction,
                                              Rect previouslyFocusedRect)
Overrides:
onRequestFocusInDescendants in class ViewGroup

requestChildRectangleOnScreen

public boolean requestChildRectangleOnScreen(View child,
                                             Rect rectangle,
                                             boolean immediate)
Specified by:
requestChildRectangleOnScreen in interface ViewParent
Overrides:
requestChildRectangleOnScreen in class ViewGroup

requestLayout

public void requestLayout()
Specified by:
requestLayout in interface ViewParent
Overrides:
requestLayout in class View

onLayout

protected void onLayout(boolean changed,
                        int l,
                        int t,
                        int r,
                        int b)
Overrides:
onLayout in class FrameLayout

onSizeChanged

protected void onSizeChanged(int w,
                             int h,
                             int oldw,
                             int oldh)
Overrides:
onSizeChanged in class FrameLayout

fling

public void fling(int velocityX)

scrollTo

public void scrollTo(int x,
                     int y)
Overrides:
scrollTo in class View


Copyright © 2008-2010. All Rights Reserved.