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-15998] implemented support for attributed string on Android #6358

Closed
wants to merge 4 commits into from

Conversation

salachi
Copy link
Contributor

@salachi salachi commented Nov 17, 2014

https://jira.appcelerator.org/browse/TIMOB-15998

Implemented support for attributedstring

@ingo ingo changed the title TIMOB-15998-implemented support for attributedstring [TIMOB-15998] implemented support for attributed string on Android Nov 17, 2014
@@ -58,7 +69,46 @@ public TiUIView createView(Activity activity)
{
return new TiUILabel(this);
}

@Kroll.getProperty
Copy link
Contributor

Choose a reason for hiding this comment

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

Please put the @Kroll annotations on the same line

@hieupham007
Copy link
Contributor

Please merge with master and add documentation

@@ -276,6 +295,10 @@ public void propertyChanged(String key, Object oldValue, Object newValue, KrollP
} else if (key.equals(TiC.PROPERTY_SHADOW_COLOR)) {
shadowColor = TiConvert.toColor(TiConvert.toString(newValue));
tv.setShadowLayer(shadowRadius, shadowX, shadowY, shadowColor);
} else if (key.equals(TiC.PROPERTY_ATTRIBUTED_STRING)) {
if (newValue instanceof AttributedStringProxy) {
Copy link
Contributor

Choose a reason for hiding this comment

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

you can merge these ifs

@ashcoding
Copy link
Contributor

Hi. Tried the pull request. Is it missing the class file "AttributedStringProxy" and "AttributeProxy"? I don't seem to have it.

@salachi
Copy link
Contributor Author

salachi commented Nov 18, 2014

Sorry, I forgot the proxy files to upload, uploaded now.

@ashcoding
Copy link
Contributor

Took a look at everything and done testing. Code reviewed and function tested to be okay.

Things to change for code are the things mentioned by Hieu:-
-Merging with the latest master cause I think it conflicts with TiC.java
-Docs
-Slight code changes

@salachi
Copy link
Contributor Author

salachi commented Nov 19, 2014

Addressed comments and merged with master

@ingo
Copy link
Contributor

ingo commented Nov 19, 2014

@salachi @hieupham007 @ashcoding Shouldn't Ashraf be the merger here? He is listed as the reviewer.

@ashcoding
Copy link
Contributor

@ingo It's actually merging the branch with master so the conflicts are settled and that the pull request can be done easily.

type: Titanium.UI.iOS.AttributedString
platforms: [iphone, ipad]
since: 3.2.0
type: Titanium.UI.AttributedString
Copy link
Contributor

Choose a reason for hiding this comment

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

For iOS, it is still type "Titanium.UI.iOS.AttributedString". Until iOS changes this, perhaps the document should list iOS as Titanium.UI.iOS.AttributedString and Android as Titanium.UI.AttributedString.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know how to add both types here, when I add both types with coma separated, documentation validation fails.

Copy link
Contributor

Choose a reason for hiding this comment

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

@salachi Since Chee Kiat created another ticket to handle the iOS parity, could you just write the documentation for Android separately and leave the iOS as it was?

Chee Kiat will handle the iOS part and fix the documentation to show parity later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I mentioned above, I don't know how to specify both types (generic and IOS) for the same property in the documentation.

Copy link
Contributor

Choose a reason for hiding this comment

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

For the doc in UI Label, you could write:-

description: |
        If set, the label ignores the `text`, `color`, and `shadow` properties.
        For iOS, use <Titanium.UI.iOS.AttributedString>. For Android, use <Titanium.UI.AttributedString>
    type: [Titanium.UI.iOS.AttributedString, Titanium.UI.AttributedString]

Once this pull request is done with this fix, Chee Kiat can fix the docs related to this with the iOS Jira Ticket he is going to do to address the parity issue.

@ashcoding
Copy link
Contributor

I think the documents for this should have one for Android and one for iOS since for iOS, you still need to use the "Titanium.UI.iOS" prefix. This probably needs another ticket for the fix and not within scope of this ticket.

Code reviewed and tested to work for android. Docs need to change.

@negupta
Copy link
Contributor

negupta commented Nov 20, 2014

I would recommend copying Titanium.UI.iOS.AttributedString implementation to Titanium.UI.AttributedString so that it is now a cross platform property. We can then deprecate Titanium.UI.iOS.AttributedString.

@cheekiatng
Copy link
Contributor

JIRI ticket created to modify iOS AttributedString such that this becomes cross platform.
https://jira.appcelerator.org/browse/TIMOB-18062

@cheekiatng
Copy link
Contributor

Will update this pull request with iOS changes, including documentation and submit a new pull request under https://jira.appcelerator.org/browse/TIMOB-18062. No further actions needed on this pull request.

@hieupham007
Copy link
Contributor

Sunil, please address @ashcoding comments regarding docs.

@ashcoding
Copy link
Contributor

@hieupham007 The docs don't need changes done in this PR. Chee Kiat's PR has taken over this PR which includes the changes done here, iOS changes and docs. His PR #6409

@hieupham007
Copy link
Contributor

Code reviewed, looks good. Waiting on doc review to merge

since: 3.2.0
type: Titanium.UI.AttributedString
platforms: [iphone, ipad, android]
since: {iphone: "3.2.0", ipad: "3.2.0", android: "3.5.0"}
Copy link
Contributor

Choose a reason for hiding this comment

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

android: "3.6.0"

@bhatfield
Copy link
Contributor

Reviewed and ran validate.

Docs are missing Titanium.UI.ATTRIBUTE_* constants.

@cheekiatng
Copy link
Contributor

Closing this PR in favor of #6409
that contains iOS modifications and documentation fixes on top of this PR.

@cheekiatng cheekiatng closed this Dec 5, 2014
@ingo
Copy link
Contributor

ingo commented Dec 5, 2014

Attention: The contributor has signed the CLA

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

Successfully merging this pull request may close these issues.

None yet

7 participants