I am trying to change the color of the text on a static/immersion card related to medical alerts. Such that an allergy is shown in red and bold colors and is easily noticeable. Is there a way to do this in Glass GDK as the card.SetText() method just takes a String as its parameter and the card is given a layout before.
Asked
Active
Viewed 483 times
2 Answers
0
The GDK Card
class does not have functionality to alter the color of text, reference here: https://developers.google.com/glass/develop/gdk/reference/com/google/android/glass/app/Card
However, you can alter text color in your style. Add a line in res/values/styles.xml within your <style>
object
<item name="android:textColor">#00FF00</item>
More information on styles and themes here: http://developer.android.com/guide/topics/ui/themes.html

asporter
- 71
- 7
-
is there a way to apply different styles to different part of the text appearing on the card.Thanks! – Ashmit Apr 26 '14 at 00:22
-
You didnt specify that in your original question, but see this post: http://stackoverflow.com/questions/1529068/is-it-possible-to-have-multiple-styles-inside-a-textview – asporter Apr 27 '14 at 20:02
-
You may want to consider using a small icon/picture to indicate allergy instead of text color. Glancing at something with a symbol is much more likely to be noticed on a Google Glass screen. – ErstwhileIII Apr 28 '14 at 00:17
-
Thanks for the suggestions. So the final solution is card.setText((TextView).getText()); where text view is where you make your text edits. – Ashmit Apr 29 '14 at 06:59
0
For those who need a solution to this Make your modifications to the textview in the layout and then set that text to the card as-
card.setText((TextView).getText());

Ashmit
- 35
- 5