Skip to content

Commit

Permalink
Merge pull request #1562 from bryan-m-hughes/timob-7167
Browse files Browse the repository at this point in the history
[TIMOB-7167] Updated constants and docs for Ti.UI.
  • Loading branch information
cb1kenobi committed Mar 6, 2012
2 parents 96d4762 + 4bfcb8c commit b78753b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 36 deletions.
26 changes: 6 additions & 20 deletions apidoc/Titanium/UI/UI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -394,12 +394,10 @@ properties:
since: "1.8.0"
- name: FACE_DOWN
summary: Constant value for face-down orientation.
platforms: [android, iphone, ipad]
type: Number
permission: read-only
- name: FACE_UP
summary: Constant value for face-up orientation.
platforms: [android, iphone, ipad]
type: Number
permission: read-only
- name: INPUT_BORDERSTYLE_BEZEL
Expand All @@ -414,7 +412,6 @@ properties:
permission: read-only
- name: INPUT_BORDERSTYLE_NONE
summary: Use no border on the input field.
platforms: [android, iphone, ipad]
type: Number
permission: read-only
- name: INPUT_BORDERSTYLE_ROUNDED
Expand All @@ -426,18 +423,22 @@ properties:
summary: Always show buttons on the input field.
type: Number
permission: read-only
platforms: [android, iphone, ipad]
- name: INPUT_BUTTONMODE_NEVER
summary: Never show buttons on the input field.
type: Number
permission: read-only
platforms: [android, iphone, ipad]
- name: INPUT_BUTTONMODE_ONBLUR
summary: Show buttons on the input field when it loses focus.
type: Number
permission: read-only
platforms: [android, iphone, ipad]
- name: INPUT_BUTTONMODE_ONFOCUS
summary: Show buttons on the input field when it gains focus.
type: Number
permission: read-only
platforms: [android, iphone, ipad]
- name: KEYBOARD_APPEARANCE_ALERT
summary: Use a keyboard appearance suitable for entering text on an alert.
platforms: [android, iphone, ipad]
Expand All @@ -450,14 +451,11 @@ properties:
permission: read-only
- name: KEYBOARD_ASCII
summary: Use an ASCII keyboard.
description: |
Note: on MobileWeb, `KEYBOARD_ASCII` is the same as `KEYBOARD_DEFAULT`.
type: Number
permission: read-only
platforms: [android, iphone, ipad]
- name: KEYBOARD_DEFAULT
summary: Use the default keyboard.
description: |
Note: on MobileWeb, `KEYBOARD_DEFAULT` is the same as `KEYBOARD_ASCII`.
type: Number
permission: read-only
- name: KEYBOARD_EMAIL
Expand Down Expand Up @@ -496,7 +494,6 @@ properties:
permission: read-only
- name: LANDSCAPE_LEFT
summary: Standard landscape orientation (home button on left).
platforms: [android, iphone, ipad]
type: Number
permission: read-only
- name: LANDSCAPE_RIGHT
Expand Down Expand Up @@ -524,27 +521,22 @@ properties:
permission: read-only
- name: PICKER_TYPE_DATE
summary: Use a date picker.
platforms: [android, iphone, ipad]
type: Number
permission: read-only
- name: PICKER_TYPE_DATE_AND_TIME
summary: Use a date and time picker.
platforms: [android, iphone, ipad]
type: Number
permission: read-only
- name: PICKER_TYPE_PLAIN
summary: Use a plain picker (for values other than date or time).
platforms: [android, iphone, ipad]
type: Number
permission: read-only
- name: PICKER_TYPE_TIME
summary: Use a time picker.
platforms: [android, iphone, ipad]
type: Number
permission: read-only
- name: PORTRAIT
summary: Orientation constant for portrait mode orientation.
platforms: [android, iphone, ipad]
type: Number
permission: read-only
- name: RETURNKEY_DEFAULT
Expand Down Expand Up @@ -611,17 +603,14 @@ properties:
permission: read-only
- name: TEXT_ALIGNMENT_CENTER
summary: Center align text.
platforms: [android, iphone, ipad]
type: Number
permission: read-only
- name: TEXT_ALIGNMENT_LEFT
summary: Left align text.
platforms: [android, iphone, ipad]
type: Number
permission: read-only
- name: TEXT_ALIGNMENT_RIGHT
summary: Right align text.
platforms: [android, iphone, ipad]
type: Number
permission: read-only
- name: TEXT_AUTOCAPITALIZATION_ALL
Expand All @@ -640,22 +629,18 @@ properties:
summary: Auto-capitalize the first letter of each word in the input field.
description: |
Mobile Web does not support this because it would interfere with the native capitalization of the mobile browser.
platforms: [android, iphone, ipad]
type: Number
permission: read-only
- name: TEXT_VERTICAL_ALIGNMENT_BOTTOM
summary: Align text to the bottom of the view.
platforms: [android, iphone, ipad]
type: Number
permission: read-only
- name: TEXT_VERTICAL_ALIGNMENT_CENTER
summary: Vertically align text to the center of the view.
platforms: [android, iphone, ipad]
type: Number
permission: read-only
- name: TEXT_VERTICAL_ALIGNMENT_TOP
summary: Align text to the top of the view.
platforms: [android, iphone, ipad]
type: Number
permission: read-only
- name: UNKNOWN
Expand All @@ -666,6 +651,7 @@ properties:
summary: Orientation constant for inverted portait orientation.
type: Number
permission: read-only
platforms: [android, iphone, ipad]
- name: backgroundColor
summary: Sets the background color of the master view (when there are no windows or other top-level controls displayed).
description: |
Expand Down
18 changes: 4 additions & 14 deletions mobileweb/titanium/Ti/UI.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,27 +190,17 @@ define(
UPSIDE_PORTRAIT: 4,
LANDSCAPE_LEFT: 5,
LANDSCAPE_RIGHT: 6,
INPUT_BORDERSTYLE_NONE: 0,
INPUT_BORDERSTYLE_LINE: 1,
INPUT_BORDERSTYLE_BEZEL: 2,
INPUT_BORDERSTYLE_ROUNDED: 3,
INPUT_BUTTONMODE_ALWAYS: 1,
INPUT_BUTTONMODE_NEVER: 0,
INPUT_BUTTONMODE_ONBLUR: 0,
INPUT_BUTTONMODE_ONFOCUS: 1,
KEYBOARD_APPEARANCE_ALERT: 1,
KEYBOARD_APPEARANCE_DEFAULT: 0,
KEYBOARD_ASCII: 1,
INPUT_BORDERSTYLE_NONE: 0, // DO NOT CHANGE! Values are referenced directly in code
INPUT_BORDERSTYLE_LINE: 1, // DO NOT CHANGE! Values are referenced directly in code
INPUT_BORDERSTYLE_BEZEL: 2, // DO NOT CHANGE! Values are referenced directly in code
INPUT_BORDERSTYLE_ROUNDED: 3, // DO NOT CHANGE! Values are referenced directly in code
KEYBOARD_DEFAULT: 2,
KEYBOARD_EMAIL: 3,
KEYBOARD_NAMEPHONE_PAD: 4,
KEYBOARD_NUMBERS_PUNCTUATION: 5,
KEYBOARD_NUMBER_PAD: 6,
KEYBOARD_PHONE_PAD: 7,
KEYBOARD_URL: 8,
NOTIFICATION_DURATION_LONG: 1,
NOTIFICATION_DURATION_SHORT: 2,
PICKER_TYPE_COUNT_DOWN_TIMER: 1,
PICKER_TYPE_DATE: 2,
PICKER_TYPE_DATE_AND_TIME: 3,
PICKER_TYPE_PLAIN: 4,
Expand Down
5 changes: 3 additions & 2 deletions mobileweb/titanium/Ti/UI/Picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ define(["Ti/_/declare", "Ti/UI/View", "Ti/_/UI/Widget", "Ti/UI", "Ti/_/lang", "T
}
}, document.body);


["Date", "Time", "DateTime"].forEach(function(type) {
inputRuler.type = type;
try {
inputRuler.type = type;
} catch(e) {}
inputSizes[type] = {
width: inputRuler.clientWidth + 2 * borderRadius,
height: inputRuler.clientHeight + 2 * borderRadius
Expand Down
2 changes: 2 additions & 0 deletions mobileweb/titanium/Ti/UI/TextField.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ define(["Ti/_/declare", "Ti/_/UI/TextBox", "Ti/_/css", "Ti/_/dom", "Ti/_/lang",
var n = this.domNode,
s = "TiUITextFieldBorderStyle";
if (value !== oldValue) {
// This code references constants Ti.UI.INPUT_BORDERSTYLE_NONE,
// Ti.UI.INPUT_BORDERSTYLE_LINE, Ti.UI.INPUT_BORDERSTYLE_BEZEL, and Ti.UI.INPUT_BORDERSTYLE_ROUNDED
css.remove(n, s + borderStyles[oldValue]);
css.add(n, s + borderStyles[value]);
}
Expand Down

0 comments on commit b78753b

Please sign in to comment.