Connect IQ > APIメモ > Toybox > WatchUi

下位ページ

Content

Module: Toybox::WatchUi

watch apps のためのユーザーインターフェース
  • Since : 1.0.0

直下のname space

  • Classes
    • BehaviorDelegate
    • Bitmap
    • BitmapResource, ClickEvent, Confirmation, ConfirmationDelegate, DataField, Drawable, FontResource, --InputDelegate
    • KeyEvent, Menu, MenuInputDelegate, NumberPicker, NumberPickerDelegate, Picker, PickerDelegate, PickerFactory, ProgressBar, SimpleDataField, SwipeEvent, Text, TextPicker, TextPickerDelegate
    • Connect IQ/APIメモ/Toybox/WatchUi/View
    • WatchFace

定数

  • KEY_POWER = 0 : The power key. Since : 1.0.0
  • KEY_LIGHT = 1 : The light key. Since : 1.0.0
  • KEY_ZIN = 2 : The zoom in key. Since : 1.0.0
  • KEY_ZOUT = 3 : The zoom out key. Since : 1.0.0
  • KEY_ENTER = 4 : The enter key. Since : 1.0.0
  • KEY_ESC = 5 : The escape key. Since : 1.0.0
  • KEY_FIND = 6 : The find key. Since : 1.0.0
  • KEY_MENU = 7 : The menu key. Since : 1.0.0
  • KEY_DOWN = 8 : The down key. Since : 1.0.0
  • KEY_DOWN_LEFT = 9 : The down left key. Since : 1.0.0
  • KEY_DOWN_RIGHT = 10 : The down key. Since : 1.0.0
  • KEY_LEFT = 11 : The left key. Since : 1.0.0
  • KEY_RIGHT = 12 : The right key. Since : 1.0.0
  • KEY_UP = 13 : The up key. Since : 1.0.0
  • KEY_UP_LEFT = 14 : The up-left. Since : 1.0.0
  • KEY_UP_RIGHT = 15 : The up-right key. Since : 1.0.0

  • EXTENDED_KEYS = 16 : The following keys have been added after ConnectIQ version 1.1.2. Before evaluating these keys, the test ( Toybox.WatchUi has :EXTENDED_KEYS ) should be made. Since : 1.1.2
  • KEY_PAGE = 17 : The page key. Since : 1.1.2
  • KEY_START = 18 : The start key. Since : 1.1.2
  • KEY_LAP = 19 : The lap key. Since : 1.1.2
  • KEY_RESET = 20 : The reset key. Since : 1.1.2
  • KEY_SPORT = 21 : The sport key. Since : 1.1.2
  • KEY_CLOCK = 22 : The clock key. Since : 1.1.2
  • KEY_MODE = 23 : The mode key. Since : 1.1.2

  • ANIM_TYPE_LINEAR = 0 : Animate the property linearly, so the speed remains constant over time. Since : 1.0.0
  • ANIM_TYPE_EASE_IN = 1 : Animate the property so the speed increases until the end. Since :1.0.0
  • ANIM_TYPE_EASE_OUT = 2 : Animate the property so the speed increases until the end. Since : 1.0.0
  • ANIM_TYPE_EASE_IN_OUT = 3 : Animate the property so there is a initial speed up and slow down at the end. Since : 1.0.0

プレス(Press)

  • PRESS_TYPE_DOWN = 0 : Key is pressed down. Since : 1.1.2
  • PRESS_TYPE_UP = 1 : Key is released. Since : 1.1.2
  • PRESS_TYPE_ACTION = 2 : Key action is performed. Since : 1.1.2

クリック(Click)

  • CLICK_TYPE_TAP = 0 : A quick press and release of the screen. Since : 1.0.0
  • CLICK_TYPE_HOLD = 1 : A press and hold of the screen. Since : 1.0.0
  • CLICK_TYPE_RELEASE = 2 : A release of a hold on the screen. Since : 1.0.0

スワイプ(Swipe)

  • SWIPE_UP = 0 : A swipe in the upward direction. Since : 1.0.0
  • SWIPE_RIGHT = 1 : A swipe towards the right. Since : 1.0.0
  • SWIPE_DOWN = 2 : A swipe in the downward direction. Since : 1.0.0
  • SWIPE_LEFT = 3 : A swipe towards the left. Since : 1.0.0

CONFIRM_NO = 0 : . Since : 1.0.0
CONFIRM_YES = 1 : . Since : 1.0.0


  • NUMBER_PICKER_DISTANCE = 0 : A Float in meters. Since : 1.0.0
  • NUMBER_PICKER_TIME = 1 : A Duration. Since : 1.0.0
  • NUMBER_PICKER_TIME_MIN_SEC = 2 : A Duration. Since : 1.0.0
  • NUMBER_PICKER_TIME_OF_DAY = 3 : A Duration representing the number of seconds since midnight. Since : 1.0.0
  • NUMBER_PICKER_WEIGHT = 4 : A Float in kilograms. Since : 1.0.0
  • NUMBER_PICKER_HEIGHT = 5 : A Float in meters. Since : 1.0.0
  • NUMBER_PICKER_CALORIES = 6 : A Number. Since : 1.0.0
  • NUMBER_PICKER_BIRTH_YEAR = 7 : A Number. Since : 1.0.0

pushView/popView での遷移方法 (Transition)

  • SLIDE_IMMEDIATE = 0 : No transition. Since :1.0.0
  • SLIDE_LEFT = 1 : The View slides to the left. Since : 1.0.0
  • SLIDE_RIGHT = 2 : The View slides to the right. Since : 1.0.0
  • SLIDE_DOWN = 3 : The View slides down. Since : 1.0.0
  • SLIDE_UP = 4 : The View slides up. Since : 1.0.0

レイアウト (Layout)

  • LAYOUT_VALIGN_TOP = -0x7FFFFFFF : Set a Drawable's locY property to this to align it to the top edge of the dc. Since : 1.2.0
  • LAYOUT_VALIGN_BOTTOM = -0x7FFFFFFE : Set a Drawable's locY property to this to align it to the bottom edge of the dc. Since : 1.2.0
  • LAYOUT_VALIGN_CENTER = -0x7FFFFFFD : Set a Drawable's locY property to this to center it vertically in the dc. Since : 1.2.0
  • LAYOUT_VALIGN_START = -0x7FFFFFFC : Set the Drawable's locY property equal to it's parent's locY property. Since : 1.2.0
  • LAYOUT_HALIGN_LEFT = -0x7FFFFFFF : Set a Drawable's locX property to this to align it along the left edge of the dc. Since : 1.2.0
  • LAYOUT_HALIGN_RIGHT = -0x7FFFFFFE : Set a Drawable's locX property to this to align it along the right edge of the dc. Since : 1.2.0
  • LAYOUT_HALIGN_CENTER = -0x7FFFFFFD : Set a Drawable's locX property to this to center it horizontally in the dc. Since : 1.2.0
  • LAYOUT_HALIGN_START = -0x7FFFFFFC : Set a Drawable's locX property equal to it's parent's locX property. Since : 1.2.0

関数(要約) WatchiUi

  • (Object) animate(drawable, property, type, start, stop, period, callback) : Use animate() to animate a property over a given period of time.
  • (Object) initResources(rezModule)
  • (Object) loadResource(resource) : Load a resource from the executable with loadResource().
  • (Object) popView(transition) : Pop a View from the View stack with popView().
  • (Object) pushView(view, delegate, transition) : Push a View onto the View stack with pushView().
  • (Object) requestUpdate : Use requestUpdate() to request that onUpdate() method be called for the current View.
  • (Object) switchToView(view, delegate, transition) : Use switchToView() to pop the current View and push the new one.

関数(詳細) WatchUi

(Object) animate(drawable, property, type, start, stop, period, callback)


Use animate() to animate a property over a given period of time. The animation starts after the call and runs the length of the specified period. During this time the View's draw callback will be called.

  • Parameters
    • drawable (Drawable) : Drawable to animate
    • property (Symbol) : Symbol of property to animate over time
    • type : Toybox.WatchUi.ANIM_TYPE_* value
    • start (Number) : Initial value of property
    • stop (Number) : Final value of property after animation
    • period (Float) : Time in seconds for animation to run
    • callback (Method) : Method object to call when complete, or null
  • Since : 1.0.0

(Object) initResources(rezModule)


Since:

   1.0.0

  • (Object) loadResource(resource)

Load a resource from the executable with loadResource().

Parameters:

   resource (Symbol) —

   Rez identifier from resources.xml to load

  • Returns : A Font, Bitmap, or String resource
  • Since : 1.0.0

(Object) popView(transition)

Pop a View from the View stack with popView().
  • Parameters
    • transition : View transition of type SLIDE_*
  • Since : 1.0.0

(Object) pushView(view, delegate, transition) : ヴュースタックにヴューをプッシュする

  • Parameters
    • view (View) : View to push
    • delegate : The input delegate to handle input for the View
    • transition : View transition of type SLIDE_*
  • Since : 1.0.0

(Object) requestUpdate : 現在のヴューの onUpdate() を呼び出す。

  • Since : 1.0.0

(Object) switchToView(view, delegate, transition) : 現在のビューをポップし、新しいビューをプッシュする。

ネイティブビューは入力値としては渡されない。つまり、ノンネイティブビューへのスイッチのみサポートしている。
  • Parameters
    • view (View) : View object to push
    • delegate : the input delegate to handle input for the View
    • transition : View transition of type SLIDE_*
  • Since : 1.0.0
最終更新:2016年03月11日 19:02