Skip to content

Commit

Permalink
Cleaned up third party and added cards
Browse files Browse the repository at this point in the history
Signed-off-by: Brandyn A. White <bwhite@dappervision.com>
  • Loading branch information
Brandyn A. White committed Mar 13, 2014
1 parent 49593c5 commit 7ad98f0
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 4 deletions.
54 changes: 54 additions & 0 deletions doc/cards.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
GDK Cards
=========
WearScript uses an abstraction called a CardTree that allows for a hierarchy of cards where a node can optionally have either a menu or another set of cards beneath it and every card can have a tap/select callback. The syntax is overloaded to make common functionality concise.

The following displays a GDK card (consists of a body and footer)
.. code-block:: javascript
var tree = new WS.Cards();
tree.add('Body text', 'Footer text');
WS.cardTree(tree);
WS.displayCardTree();
Lets add another card
.. code-block:: javascript
var tree = new WS.Cards();
tree.add('Body 0', 'Footer 0');
tree.add('Body 1', 'Footer 1');
WS.cardTree(tree);
WS.displayCardTree();
Select and tap callbacks are optional arguments
.. code-block:: javascript
var tree = new WS.Cards();
tree.add('Body 0', 'Footer 0', function () {WS.say('Selected')});
tree.add('Body 1', 'Footer 1', undefined, function () {WS.say('Tapped')});
WS.cardTree(tree);
WS.displayCardTree();
A menu is added with alternating title and callback arguments at the end of the parameter list. Tap/select parameters (if present) precede them.
.. code-block:: javascript
var tree = new WS.Cards();
tree.add('Body 0', 'Footer 0', 'Say 0', function () {WS.say('Say 0')}, 'Say 1', function () {WS.say('Say 1')});
tree.add('Body 1', 'Footer 1', function () {WS.say('Selected')}, 'Say 0', function () {WS.say('Say 0')}, 'Say 1', function () {WS.say('Say 1')});
tree.add('Body 2', 'Footer 2', function () {WS.say('Selected')}, function () {WS.say('Tapped')}, 'Say 0', function () {WS.say('Say 0')}, 'Say 1', function () {WS.say('Say 1')});
WS.cardTree(tree);
WS.displayCardTree();
A subtree of cards is added by creating another set of cards and placing it as the last parameter (may only have a menu or a subtree for a card). There is no depth limit for subtrees.

.. code-block:: javascript
var tree = new WS.Cards();
tree.add('Body 0', 'Footer 0');
var subtree = new WS.Cards();
subtree.add('Sub Body 0', 'Sub Footer 0');
subtree.add('Sub Body 1', 'Sub Footer 1');
tree.add('Body 1', 'Footer 1', subtree);
WS.cardTree(tree);
WS.displayCardTree();
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ One-Line Installer(Linux/OSX): Execute the following in a shell to install WearS
start
setup-client
setup-server
cards
tips
hacking
reference
Expand Down
1 change: 0 additions & 1 deletion thirdparty/install_binary_linux.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env sh
./adb/linux/adb install OpenCV_2.4.6_Manager_2.9_armv7a-neon.apk
./adb/linux/adb install CaptureActivity.apk
./adb/linux/adb install wearscript.apk
1 change: 0 additions & 1 deletion thirdparty/install_binary_osx.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env sh
./adb/osx/adb install OpenCV_2.4.6_Manager_2.9_armv7a-neon.apk
./adb/osx/adb install CaptureActivity.apk
./adb/osx/adb install wearscript.apk
1 change: 0 additions & 1 deletion thirdparty/install_binary_windows.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
adb\windows\adb.exe install OpenCV_2.4.6_Manager_2.9_armv7a-neon.apk
adb\windows\adb.exe install CaptureActivity.apk
adb\windows\adb.exe install wearscript.apk
1 change: 0 additions & 1 deletion thirdparty/wearscript.apk

This file was deleted.

0 comments on commit 7ad98f0

Please sign in to comment.