Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIMOB-8821: BlackBerry: Implement UI.Label #61

Merged
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions apidoc/Titanium/UI/ActivityIndicator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ properties:
summary: Key identifying a string in the locale file to use for the message text.
description: Only one of `message` or `messageid` should be specified.
type: String
platforms: [android, iphone, ipad, mobileweb]

- name: right
summary: Right position of the view.
Expand Down
5 changes: 3 additions & 2 deletions apidoc/Titanium/UI/Font.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ description: |

* [Custom Fonts in the Titanium Mobile Guides](https://wiki.appcelerator.org/display/guides/Custom+Fonts)


properties:
- name: fontFamily
summary: Name of a font family, for example, "Helvetica" or "DroidSans."
Expand Down Expand Up @@ -92,6 +91,8 @@ properties:
For example, "16dp" specifies a size of 16 density-independent pixels.

iOS ingores any unit specifier after the size value.

On BlackBerry, fontSize use post script units. Valid ranges are >= 0. Sizes < 0 will be clamped to 0.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also specify that we value should be a Number. String currently also work but only if not followed by unit specifier (either we have it ignore the unit specifiers like for iOS or update the doc to specify that it only takes a number).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

type: [ Number, String ]
default: 15px
- name: fontWeight
Expand All @@ -102,5 +103,5 @@ properties:
- name: fontStyle
summary: Font style. Valid values are "italic" or "normal."
type: String
platforms: [ iphone, ipad ]
platforms: [ iphone, ipad, blackberry ]
default: normal
1 change: 1 addition & 0 deletions apidoc/Titanium/UI/Label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ properties:
summary: Key identifying a string from the locale file to use for the label text.
description: Only one of `text` or `textid` should be specified.
type: String
platforms: [android,iphone,ipad,mobileweb]
- name: wordWrap
summary: Enable or disable word wrapping in the label.
type: Boolean
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to update the Font apidoc as well

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot found documentation for it

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apidoc/Titanium/UI/Font.yml

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't meant that. For example for Android it says: "On Android, use the font file name, minus the .otf or .ttf extension.
For example, if you are using the Chantelli Antiqua font and the file is
named Chantelli_Antiqua.ttf, specify fontFamily: 'Chantelli_Antiqua'
on Android."
Cannot find appropriate documentation for BB.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What you're looking at is for custom fonts. Can you install custom fonts on the BB? If you can't find the answer through investigation or documentation, then ask suavek.

The Font doc still needs to be updated to reflect the work of this PR.

  • fontFamily: Do you know which fonts are supported currently?
  • fontSize: what unit does the BB use? should the unit be appended to the number?
  • fontStyle: does italic work? currently it says only supported for iphone ipad
  • fontWeight: do bold and semibold work?

If you've tested your work you should already know most of these answers

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are still things that need to be updated but need to wait for R6 to find the answers then add them to the JIra Issue for reworking label/font after R6

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm that the jira issue has been updated with the information above?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still awaiting confirmation

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expand Down
15 changes: 15 additions & 0 deletions apidoc/Titanium/UI/TextField.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,29 @@ since: "0.8"
methods:
- name: blur
summary: Forces the field to lose focus.
platforms: [android, iphone, ipad, mobileweb]
- name: focus
summary: Forces the field to gain focus.
platforms: [android, iphone, ipad, mobileweb]
- name: hasText
summary: Returns `true` if the field contains text, `false` if it is empty.
platforms: [android, iphone, ipad, mobileweb]
events:
- name: blur
summary: Fired when the field loses focus.
platforms: [android, iphone, ipad, mobileweb]
properties:
- name: value
summary: Value of the field at the time of the event.
- name: change
summary: Fired when the field value changes.
platforms: [android, iphone, ipad, mobileweb]
properties:
- name: value
summary: New value of the field.
- name: focus
summary: Fired when the field gains focus.
platforms: [android, iphone, ipad, mobileweb]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be aware that Harut already made most of these in a patch to update apidoc that also got merged. Since you didn't put platform as the last element for events you'll need to be careful when merging not to duplicate the platforms lines

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

platforms lines have been duplicated in this file. remove them please

properties:
- name: value
summary: Value of the field at the time of the event.
Expand All @@ -49,13 +55,16 @@ properties:

For Mobile Web, `TEXT_AUTOCAPITALIZATION_WORDS` is unsupported.
type: Number
platforms: [android, iphone, ipad, mobileweb]
- name: autocorrect
summary: If true, allows the input field to autocorrect misspelled words.
type: Boolean
platforms: [android, iphone, ipad, mobileweb]
- name: borderStyle
summary: Border style for the field.
description: Specify one of the `INPUT_BORDERSTYLE` constants defined in [Titanium.UI](Titanium.UI.INPUT_BORDERSTYLE_BEZEL).
type: Number
platforms: [android, iphone, ipad, mobileweb]
- name: clearButtonMode
summary: When to display the clear button.
description: |
Expand All @@ -69,14 +78,17 @@ properties:
- name: clearOnEdit
summary: Should the value of the field be cleared when the user starts editing?
type: Boolean
platforms: [android, iphone, ipad, mobileweb]
- name: editable
summary: Is the field editable?
type: Boolean
default: true
platforms: [android, iphone, ipad, mobileweb]
- name: enabled
summary: Is the field enabled?
type: Boolean
default: true
platforms: [android, iphone, ipad, mobileweb]
- name: font
summary: Font to use for text.
type: Font
Expand Down Expand Up @@ -108,6 +120,7 @@ properties:
address, you should always specify the appropriate keyboard type.
type: Number
default: the platform's default keyboard
platforms: [android, iphone, ipad, mobileweb]
- name: leftButton
summary: Left button view. Using an object other than a [Button](Titanium.UI.Button) may have unpredictable results.
type: Object
Expand Down Expand Up @@ -147,6 +160,7 @@ properties:
Note: on iOS, `passwordMask` *must* be specified when the text field is created.
type: Boolean
default: false
platforms: [android, iphone, ipad, mobileweb]
- name: returnKeyType
summary: Specifies the text to display on the keyboard **Return** key when this field is focused.
description: |
Expand All @@ -160,6 +174,7 @@ properties:
Mobile Web on Android devices will only display "Go" regardless of which `RETURNKEY` type is used.
type: Number
default: the platform's default return key
platforms: [android, iphone, ipad, mobileweb]
- name: rightButton
summary: Right button view.
description: Using an object other than a [Button](Titanium.UI.Button) may have
Expand Down