WIMM Labs


com.wimm.framework.watches
Class DigitalWatchView

java.lang.Object
  extended by android.view.View
      extended by android.view.ViewGroup
          extended by android.widget.RelativeLayout
              extended by com.wimm.framework.watches.BaseWatchView
                  extended by com.wimm.framework.watches.DigitalWatchView
All Implemented Interfaces:
Drawable.Callback, AccessibilityEventSource, KeyEvent.Callback, ViewManager, ViewParent

public class DigitalWatchView
extends BaseWatchView

The DigitalWatchView class extends BaseWatchView to provide digital watch functionality. The constant variables for this class draw the watchface and watchface assets in active and passive mode.

Note: See the Watchface Tutorial for more information about developing watchfaces.

Since:
WIMM SDK 1.0.0

Nested Class Summary
static class DigitalWatchView.NumberTransition
          NumberTransition enumerates BLIT, CROSSFADE, and FLIP named type constants for setTransitionType(com.wimm.framework.watches.DigitalWatchView.NumberTransition).
 
Nested classes/interfaces inherited from class com.wimm.framework.watches.BaseWatchView
BaseWatchView.UpdateResolution
 
Nested classes/interfaces inherited from class android.widget.RelativeLayout
RelativeLayout.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
static int DRAW_FACE
          Tag for the watchface canvas asset.
static int DRAW_HOUR1_ACTIVE
          Tag for the first of the four digits on the watchface.
static int DRAW_HOUR1_PASSIVE
          Tag for the first of the four digits on the watchface, in passive mode.
static int DRAW_HOUR2_ACTIVE
          Tag for the second of the four digits on the the watchface.
static int DRAW_HOUR2_PASSIVE
          Tag for the second of the four digits on the watchface, in passive mode.
static int DRAW_MINUTE1_ACTIVE
          Tag for the third of the four digits on the watchface.
static int DRAW_MINUTE1_PASSIVE
          Tag for the third of the four digits on the watchface, in passive mode.
static int DRAW_MINUTE2_ACTIVE
          Tag for the last of the four digits on the watchface.
static int DRAW_MINUTE2_PASSIVE
          Tag for the last of the four digits on the watchface, in passive mode.
static int DRAW_SEPARATOR_OFF_ACTIVE
          Tag for the the separator's OFF state in active mode.
static int DRAW_SEPARATOR_ON_ACTIVE
          Tag for the the separator's ON state in active mode.
static int DRAW_SEPARATOR_PASSIVE
          Tag for the spacer that separates the hour and minute digits, in passive mode.
static int DRAW_SPACER_ACTIVE
          Tag for the spacer that separates the hour and minute digits.
static int DRAW_SPACER_PASSIVE
          Tag for the spacer that separates the hour and minute digits, in passive mode.
 
Fields inherited from class com.wimm.framework.watches.BaseWatchView
DRAW_BACKGROUND_ACTIVE, DRAW_BACKGROUND_PASSIVE
 
Fields inherited from class android.widget.RelativeLayout
ABOVE, ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_LEFT, ALIGN_PARENT_BOTTOM, ALIGN_PARENT_LEFT, ALIGN_PARENT_RIGHT, ALIGN_PARENT_TOP, ALIGN_RIGHT, ALIGN_TOP, BELOW, CENTER_HORIZONTAL, CENTER_IN_PARENT, CENTER_VERTICAL, LEFT_OF, RIGHT_OF, TRUE
 
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
DigitalWatchView(Context context, AttributeSet attrs)
          Instantiates a new digital watch view.
 
Method Summary
 void setDrawable(int tag, Drawable drawable)
          Sets a watchface asset from a Drawable.
 void setTransitionType(DigitalWatchView.NumberTransition transitionType)
          Sets the transition type (see DigitalWatchView.NumberTransition).
 
Methods inherited from class com.wimm.framework.watches.BaseWatchView
animateFromPreview, drawComplications, drawPassiveWatch, drawWatch, getActiveUpdateResolution, getDrawable, getTime, isAnimatingFromPreview, isDisplayActive, setDisplayActive, setDrawable, shouldDrawPassiveComplications, use24HourTime
 
Methods inherited from class android.widget.RelativeLayout
checkLayoutParams, dispatchPopulateAccessibilityEvent, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getBaseline, onLayout, onMeasure, requestLayout, setGravity, setHorizontalGravity, setIgnoreGravity, setVerticalGravity
 
Methods inherited from class android.view.ViewGroup
addFocusables, addFocusables, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, canAnimate, childDrawableStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchDraw, dispatchFreezeSelfOnly, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetPressed, dispatchSetSelected, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowVisibilityChanged, drawableStateChanged, drawChild, findFocus, fitSystemWindows, focusableViewAvailable, focusSearch, gatherTransparentRegion, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getPersistentDrawingCache, hasFocus, hasFocusable, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, measureChild, measureChildren, measureChildWithMargins, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onAnimationEnd, onAnimationStart, onCreateDrawableState, onInterceptTouchEvent, onRequestFocusInDescendants, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeDetachedView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, 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, computeHorizontalScrollRange, computeScroll, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createContextMenu, destroyDrawingCache, draw, finalize, findViewById, findViewWithTag, focusSearch, forceLayout, getAnimation, getApplicationWindowToken, getBackground, 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, 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, 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, onSizeChanged, onStartTemporaryDetach, onTouchEvent, 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, scrollTo, 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, verifyDrawable, 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
 

Field Detail

DRAW_HOUR1_ACTIVE

public static final int DRAW_HOUR1_ACTIVE
Tag for the first of the four digits on the watchface. For example, if the the displayed hour is noon, this is the 1 in 12:00. Must be a LevelListDrawable.

Since:
WIMM SDK 1.0.0
See Also:
BaseWatchView.setDrawable(int, int), Constant Field Values

DRAW_HOUR2_ACTIVE

public static final int DRAW_HOUR2_ACTIVE
Tag for the second of the four digits on the the watchface. For example, if the hour displayed is noon, this is the 2 in 12:00. Must be a LevelListDrawable.

Since:
WIMM SDK 1.0.0
See Also:
BaseWatchView.setDrawable(int, int), Constant Field Values

DRAW_MINUTE1_ACTIVE

public static final int DRAW_MINUTE1_ACTIVE
Tag for the third of the four digits on the watchface. For example, if the hour displayed is noon, this is the first 0 in 12:00. Must be a LevelListDrawable.

Since:
WIMM SDK 1.0.0
See Also:
BaseWatchView.setDrawable(int, int), Constant Field Values

DRAW_MINUTE2_ACTIVE

public static final int DRAW_MINUTE2_ACTIVE
Tag for the last of the four digits on the watchface. For example, if the hour displayed is noon, this is the second 0 in 12:00. Must be a LevelListDrawable.

Since:
WIMM SDK 1.0.0
See Also:
BaseWatchView.setDrawable(int, int), Constant Field Values

DRAW_SPACER_ACTIVE

public static final int DRAW_SPACER_ACTIVE
Tag for the spacer that separates the hour and minute digits.

Since:
WIMM SDK 1.0.0
See Also:
BaseWatchView.setDrawable(int, int), Constant Field Values

DRAW_SEPARATOR_ON_ACTIVE

public static final int DRAW_SEPARATOR_ON_ACTIVE
Tag for the the separator's ON state in active mode. The on/off toggle to create the blinking separator normally seen on a digital watchfacee.

Since:
WIMM SDK 1.0.0
See Also:
BaseWatchView.setDrawable(int, int), Constant Field Values

DRAW_SEPARATOR_OFF_ACTIVE

public static final int DRAW_SEPARATOR_OFF_ACTIVE
Tag for the the separator's OFF state in active mode. The on/off toggle to create the blinking separator normally seen on a digital watchfacee.

Since:
WIMM SDK 1.0.0
See Also:
BaseWatchView.setDrawable(int, int), Constant Field Values

DRAW_HOUR1_PASSIVE

public static final int DRAW_HOUR1_PASSIVE
Tag for the first of the four digits on the watchface, in passive mode. Must be a LevelListDrawable.

Since:
WIMM SDK 1.0.0
See Also:
BaseWatchView.setDrawable(int, int), Constant Field Values

DRAW_HOUR2_PASSIVE

public static final int DRAW_HOUR2_PASSIVE
Tag for the second of the four digits on the watchface, in passive mode. Must be a LevelListDrawable.

Since:
WIMM SDK 1.0.0
See Also:
BaseWatchView.setDrawable(int, int), Constant Field Values

DRAW_MINUTE1_PASSIVE

public static final int DRAW_MINUTE1_PASSIVE
Tag for the third of the four digits on the watchface, in passive mode. Must be a LevelListDrawable.

Since:
WIMM SDK 1.0.0
See Also:
BaseWatchView.setDrawable(int, int), Constant Field Values

DRAW_MINUTE2_PASSIVE

public static final int DRAW_MINUTE2_PASSIVE
Tag for the last of the four digits on the watchface, in passive mode. Must be a LevelListDrawable.

Since:
WIMM SDK 1.0.0
See Also:
BaseWatchView.setDrawable(int, int), Constant Field Values

DRAW_SPACER_PASSIVE

public static final int DRAW_SPACER_PASSIVE
Tag for the spacer that separates the hour and minute digits, in passive mode.

Since:
WIMM SDK 1.0.0
See Also:
BaseWatchView.setDrawable(int, int), Constant Field Values

DRAW_SEPARATOR_PASSIVE

public static final int DRAW_SEPARATOR_PASSIVE
Tag for the spacer that separates the hour and minute digits, in passive mode.

Since:
WIMM SDK 1.0.0
See Also:
BaseWatchView.setDrawable(int, int), Constant Field Values

DRAW_FACE

public static final int DRAW_FACE
Tag for the watchface canvas asset.

Since:
WIMM SDK 1.0.0
See Also:
BaseWatchView.setDrawable(int, int), Constant Field Values
Constructor Detail

DigitalWatchView

public DigitalWatchView(Context context,
                        AttributeSet attrs)
Instantiates a new digital watch view.

Parameters:
context - The Context.
attrs - The AttributeSet.
Since:
WIMM SDK 1.0.0
Method Detail

setDrawable

public void setDrawable(int tag,
                        Drawable drawable)
Description copied from class: BaseWatchView
Sets a watchface asset from a Drawable.

The following example sets the BaseWatchView.DRAW_BACKGROUND_PASSIVE watchface asset to the color black:

   setDrawable(BaseWatchView.DRAW_BACKGROUND_PASSIVE, new ColorDrawable(Color.BLACK));
  

Overrides:
setDrawable in class BaseWatchView
Parameters:
tag - The asset constant.
drawable - The drawable.

setTransitionType

public void setTransitionType(DigitalWatchView.NumberTransition transitionType)
Sets the transition type (see DigitalWatchView.NumberTransition).

Parameters:
transitionType - The new transition type.
Since:
WIMM SDK 1.0.0

WIMM Labs