|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.view.View
sk.baka.ambient.views.ButtonBar
public final class ButtonBar
A very simple, naive and inefficient implementation of the apple-launchbar-like button bar.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class android.view.View |
|---|
android.view.View.BaseSavedState, android.view.View.MeasureSpec, android.view.View.OnClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnFocusChangeListener, android.view.View.OnKeyListener, android.view.View.OnLongClickListener, android.view.View.OnTouchListener |
| Field Summary | |
|---|---|
android.widget.AdapterView.OnItemClickListener |
listener
The ONCLICK listener. |
| 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, 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 | |
|---|---|
ButtonBar(android.content.Context context,
android.util.AttributeSet attrs)
|
|
ButtonBar(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
|
|
ButtonBar(android.content.Context context,
int rootId,
java.lang.Integer textHintColor,
java.lang.Integer textHintBgColor,
java.lang.Boolean extendDown)
Constructor. |
|
| Method Summary | |
|---|---|
java.util.BitSet |
getChecked()
Returns the current check state. |
Interval |
getHighlight()
Returns the highlight interval. |
void |
highlight(Interval interval,
java.util.BitSet checked)
Highlights given buttons. |
protected void |
onAttachedToWindow()
|
protected void |
onDetachedFromWindow()
|
protected void |
onDraw(android.graphics.Canvas canvas)
|
protected void |
onFocusChanged(boolean gainFocus,
int direction,
android.graphics.Rect previouslyFocusedRect)
|
boolean |
onKeyDown(int keyCode,
android.view.KeyEvent event)
|
boolean |
onKeyMultiple(int keyCode,
int repeatCount,
android.view.KeyEvent event)
|
boolean |
onKeyUp(int keyCode,
android.view.KeyEvent event)
|
protected void |
onLayout(boolean changed,
int left,
int top,
int right,
int bottom)
|
protected void |
onMeasure(int widthMeasureSpec,
int heightMeasureSpec)
|
boolean |
onTouchEvent(android.view.MotionEvent event)
|
void |
setBitmaps(int[] bitmapResources,
int[] activityName,
android.graphics.Point bitmapSize,
android.graphics.Point hoveredBitmapSize)
Sets a new set of images to be shown. |
| Methods inherited from class android.view.View |
|---|
addFocusables, addTouchables, bringToFront, buildDrawingCache, cancelLongPress, checkInputConnectionProxy, clearAnimation, clearFocus, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createContextMenu, destroyDrawingCache, dispatchDraw, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetPressed, dispatchSetSelected, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowVisibilityChanged, draw, drawableStateChanged, finalize, findFocus, findViewById, findViewWithTag, fitSystemWindows, focusSearch, forceLayout, getAnimation, getApplicationWindowToken, getBackground, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getContext, getContextMenuInfo, getDefaultSize, getDrawableState, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getKeepScreenOn, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMeasuredHeight, getMeasuredWidth, getNextFocusDownId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParent, getResources, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getTag, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getVerticalFadingEdgeLength, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, hasFocus, hasFocusable, hasWindowFocus, inflate, initializeFadingEdge, initializeScrollbars, invalidate, invalidate, invalidate, invalidateDrawable, isClickable, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isInEditMode, isInTouchMode, isLayoutRequested, isLongClickable, isPaddingOffsetRequired, isPressed, isSaveEnabled, isSelected, isShown, isSoundEffectsEnabled, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, layout, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onCheckIsTextEditor, onCreateContextMenu, onCreateDrawableState, onCreateInputConnection, onFinishInflate, onFinishTemporaryDetach, onKeyPreIme, onKeyShortcut, onRestoreInstanceState, onSaveInstanceState, onScrollChanged, onSetAlpha, onSizeChanged, onStartTemporaryDetach, onTrackballEvent, onWindowFocusChanged, onWindowVisibilityChanged, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, refreshDrawableState, removeCallbacks, requestFocus, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, resolveSize, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, setAnimation, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setClickable, 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, setPadding, setPressed, setSaveEnabled, setScrollBarStyle, setScrollContainer, setSelected, setSoundEffectsEnabled, setTag, setTouchDelegate, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVisibility, setWillNotCacheDrawing, setWillNotDraw, showContextMenu, startAnimation, unscheduleDrawable, unscheduleDrawable, verifyDrawable, willNotCacheDrawing, willNotDraw |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public android.widget.AdapterView.OnItemClickListener listener
| Constructor Detail |
|---|
public ButtonBar(android.content.Context context,
int rootId,
java.lang.Integer textHintColor,
java.lang.Integer textHintBgColor,
java.lang.Boolean extendDown)
context - rootId - Denotes root absolute layout id.textHintColor - text hint color, default white.textHintBgColor - text background color, default 50% transparent black.extendDown - If true (the default) then hovered buttons are
extended downwards. If false then buttons are
extended upwards.
public ButtonBar(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
context - attrs - defStyle -
public ButtonBar(android.content.Context context,
android.util.AttributeSet attrs)
context - attrs - | Method Detail |
|---|
protected void onAttachedToWindow()
onAttachedToWindow in class android.view.Viewprotected void onDetachedFromWindow()
onDetachedFromWindow in class android.view.View
public void setBitmaps(int[] bitmapResources,
int[] activityName,
android.graphics.Point bitmapSize,
android.graphics.Point hoveredBitmapSize)
bitmapResources - the drawables to showactivityName - the activity captions. If -1 then the caption
is not shown for the item. May be null if no
captions are required to be shown.bitmapSize - the size of all bitmaps. Here the Point class is not
used as a point, it denotes dimension instead.hoveredBitmapSize - the size of hovered bitmap. Here the Point class is
not used as a point, it denotes dimension instead.
protected void onMeasure(int widthMeasureSpec,
int heightMeasureSpec)
onMeasure in class android.view.ViewView.measure(int, int)protected void onDraw(android.graphics.Canvas canvas)
onDraw in class android.view.View
protected void onLayout(boolean changed,
int left,
int top,
int right,
int bottom)
onLayout in class android.view.Viewpublic boolean onTouchEvent(android.view.MotionEvent event)
onTouchEvent in class android.view.View
public boolean onKeyDown(int keyCode,
android.view.KeyEvent event)
onKeyDown in interface android.view.KeyEvent.CallbackonKeyDown in class android.view.View
public boolean onKeyUp(int keyCode,
android.view.KeyEvent event)
onKeyUp in interface android.view.KeyEvent.CallbackonKeyUp in class android.view.View
public boolean onKeyMultiple(int keyCode,
int repeatCount,
android.view.KeyEvent event)
onKeyMultiple in interface android.view.KeyEvent.CallbackonKeyMultiple in class android.view.View
protected void onFocusChanged(boolean gainFocus,
int direction,
android.graphics.Rect previouslyFocusedRect)
onFocusChanged in class android.view.View
public void highlight(Interval interval,
java.util.BitSet checked)
interval - highlighted buttons. May be null - in this case
the interval is empty.checked - a set of checked items.public Interval getHighlight()
nullpublic java.util.BitSet getChecked()
null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||