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-19629 Android: user defined letter case for button text #8572

Closed
wants to merge 1 commit into from

Conversation

frankieandone
Copy link
Contributor

- name: textAllCaps
summary: |
All text to upper case letters, specified using true or false.
type: [boolean]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use type: Boolean

@hansemannn hansemannn added this to the 6.1.0 milestone Nov 2, 2016
@@ -130,6 +131,12 @@ public void processProperties(KrollDict d)
if (needShadow) {
btn.setShadowLayer(shadowRadius, shadowX, shadowY, shadowColor);
}
if (d.containsKey(TiC.PROPERTY_TEXT_ALL_CAPS)){
boolean caps = TiConvert.toBoolean(d.get(TiC.PROPERTY_TEXT_ALL_CAPS));
Copy link
Contributor

Choose a reason for hiding this comment

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

Set a default value to fall back onto

boolean caps = TiConvert.toBoolean(d.get(TiC.PROPERTY_TEXT_ALL_CAPS), false);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
btn.setAllCaps(caps);
}
}
btn.invalidate();
}

Copy link
Contributor

Choose a reason for hiding this comment

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

You should also add a similar setter to propertyChanged

...
} else if (key.equals(TiC.PROPERTY_TEXT_ALL_CAPS)) {
    boolean caps = TiConvert.toBoolean(d.get(TiC.PROPERTY_TEXT_ALL_CAPS), false);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        btn.setAllCaps(caps);
    }
...

@garymathews
Copy link
Contributor

garymathews commented Nov 4, 2016

So looking at the ticket, the issue is to do with the android:textAllCaps XML property of a custom theme being ignored when set in a ListView. Exposing textAllCap as a Titanium API does not fix this issue.

@frankieandone
Copy link
Contributor Author

There are 3 fixes available which this is one #1.

  1. custom theme set in application tag in tiapp.xml was overridden by default theme set in activity tag. removed default theme attribute in activity in the template.
  2. user explicitly changes their tiapp.xml so that their application has custom theme set and ALSO the activity theme set.
  3. expose textAllCaps and programmatically set caps to false which was already pushed and PR'd but was rejected because it didn't address the xml.

@garymathews
Copy link
Contributor

Superseded by #8592

@garymathews garymathews closed this Nov 8, 2016
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

3 participants