-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TIMOB-18062] iOS and Android: AttributedString Parity
-Using property accessors in AttributedProxy for Range -Using property accessors in Label Proxy for AttributedString -Using property accessors in AttributedStringProxy for AttributedString
- Loading branch information
Ashraf A. S
committed
Dec 11, 2014
1 parent
0e342e0
commit 7354449
Showing
6 changed files
with
98 additions
and
202 deletions.
There are no files selected for viewing
41 changes: 4 additions & 37 deletions
41
android/modules/ui/src/java/ti/modules/titanium/ui/AttributeProxy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,31 @@ | ||
/** | ||
* Appcelerator Titanium Mobile | ||
* Copyright (c) 2009-2013 by Appcelerator, Inc. All Rights Reserved. | ||
* Copyright (c) 2009-2014 by Appcelerator, Inc. All Rights Reserved. | ||
* Licensed under the terms of the Apache Public License | ||
* Please see the LICENSE included with this distribution for details. | ||
*/ | ||
package ti.modules.titanium.ui; | ||
|
||
import org.appcelerator.kroll.KrollDict; | ||
import org.appcelerator.kroll.KrollProxy; | ||
import org.appcelerator.kroll.annotations.Kroll; | ||
import org.appcelerator.kroll.common.Log; | ||
import org.appcelerator.titanium.TiC; | ||
import org.appcelerator.titanium.util.TiConvert; | ||
|
||
@Kroll.proxy(propertyAccessors = { | ||
TiC.PROPERTY_ATTRIBUTE_TYPE, | ||
TiC.PROPERTY_ATTRIBUTE_VALUE | ||
TiC.PROPERTY_ATTRIBUTE_VALUE, | ||
TiC.PROPERTY_ATTRIBUTE_RANGE, | ||
}) | ||
public class AttributeProxy extends KrollProxy | ||
{ | ||
private static final String TAG = "Attribute"; | ||
|
||
protected int[] range = null; | ||
|
||
protected AttributeProxy() | ||
{ | ||
} | ||
|
||
@Kroll.method @Kroll.setProperty | ||
public void setRange (int[] range) | ||
{ | ||
this.range = range; | ||
} | ||
|
||
@Kroll.method @Kroll.getProperty | ||
public int[] getRange() | ||
{ | ||
return range; | ||
} | ||
|
||
@Override | ||
public void handleCreationDict(KrollDict options) { | ||
super.handleCreationDict(options); | ||
|
||
// Support setting range at creation. | ||
Object inRange = options.get(TiC.PROPERTY_ATTRIBUTE_RANGE); | ||
if (inRange != null && inRange instanceof Object[]) { | ||
try { | ||
int[] rangeArr = TiConvert.toIntArray((Object[]) inRange); | ||
setRange(rangeArr); | ||
|
||
} catch (ClassCastException e) { | ||
Log.e(TAG, "Invalid range array. Must only contain numbers."); | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
public String getApiName() | ||
{ | ||
return "Ti.Android.Attribute"; | ||
return "Ti.UI.Attribute"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.