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-17340] Android: Implement Ti.UI.ATTRIBUTE_BASELINE_OFFSET #9564

Merged
merged 1 commit into from Nov 13, 2017

Conversation

garymathews
Copy link
Contributor

  • Implement Titanium.UI.ATTRIBUTE_BASELINE_OFFSET for Android for parity with iOS
TEST CASE
var win = Ti.UI.createWindow({backgroundColor: 'gray'}),
    text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent lobortis laoreet nibh in tempor. Mauris justo nibh, suscipit ut venenatis id, vehicula quis arcu. Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
    atr = Ti.UI.createAttributedString({
        text: text,
        attributes: [{
            type: Ti.UI.ATTRIBUTE_BASELINE_OFFSET,
            value: 50,
            range: [0, text.length]
        }]
    }),
    lbl = Ti.UI.createLabel({
        top: 5,
        left: 5,
        width: Ti.UI.FILL,
        height: Ti.UI.SIZE,
        attributedString: atr
    });

win.add(lbl);
win.open();

JIRA Ticket

Copy link
Contributor

@jquick-axway jquick-axway left a comment

Choose a reason for hiding this comment

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

The following document needs to be updated to indicate Android support. It should be moved from the "iOS Attributes" section to the "Types of Attributes" section.
http://docs.appcelerator.com/platform/latest/#!/guide/Attributed_Strings-section-src-37538231_AttributedStrings-Baseline

We may want to use the above doc's code example for this PR's test case instead since it shows a picture of the result on iOS.

@garymathews
Copy link
Contributor Author

@jquick-axway ah, those docs don't live in this repo; they are on our wiki. I won't update them yet until this PR has passed FR/CR and has been merged (to be sure this will be in 7.0.0) since I believe the changes to those docs would go live.

Copy link
Contributor

@jquick-axway jquick-axway left a comment

Choose a reason for hiding this comment

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

CR: Pass

@lokeshchdhry
Copy link
Contributor

lokeshchdhry commented Nov 13, 2017

FR Passed.

Property Ti.UI.ATTRIBUTE_BASELINE_OFFSET works as expected:

  1. Checked it with Label.
  2. Checked it with TextField.
  3. Checked it with TextArea.

Studio Ver: 4.10.0.201709271713
SDK Ver: 7.0.0 local build
OS Ver: 10.12.3
Xcode Ver: Xcode 8.3.3
Appc NPM: 4.2.10
Appc CLI: 6.3.0
Ti CLI Ver: 5.0.14
Alloy Ver: 1.10.7
Node Ver: 7.10.1
Java Ver: 1.8.0_101
Devices: ⇨ google Nexus 5 --- Android 6.0.1
⇨ google Nexus 6P --- Android 8.0.0

@eric34 eric34 merged commit 2d80ff0 into tidev:master Nov 13, 2017
@joshualambert
Copy link

This PR just saved my bacon. Thanks y'all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants