public class

Text

extends Object
implements Parcelable
java.lang.Object
   ↳ com.usebutton.sdk.models.Text

Class Overview

The Text class represents everything you need to style and set value for a TextView.

Example bright red button that reads "Hi!":

 final Text someText; // text= "Hi!", color = #f00
 final TextView myTextView;
 if (someText == null) {
     myTextView.setVisibility(View.GONE);
 }
 else {
     myTextView(setVisibility(View.VISIBLE);
     // Either
     someText.applyTo(myTextView);
     // Or:
     myTextView.setText(someText.getCopy());
     myTextView.setTextColor(someText.getColor());
 }
 

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Public Methods
static void applyTo(TextView target, Text text)
void applyTo(TextView textView)
Convenience method to set text and color for a TextViewor any of its subclasses (like Button).
int getColor()
String getCopy()
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Public Methods

public static void applyTo (TextView target, Text text)

public void applyTo (TextView textView)

Convenience method to set text and color for a TextViewor any of its subclasses (like Button). Equivalent to calling setText(CharSequence) and setTextColor(int).

public int getColor ()

Returns
  • the text's color represented by an int like outlined in Color

public String getCopy ()

Returns
  • the actual string value for this Text