# SushiTextView

text-medium

A view that allows showing text to the user. Can use any of the typographies supported by Sushi This builds upon Android Support Library's AppCompatTextView

# Features

Supports all the features of AppCompatTextView. Additionally, we support font-icon based drawables, on left (start) and right (end).

Attribute Value
app:textFontWeight extralight, light, regular (default), medium or semibold
app:drawableLeft @drawable or @string which is treated as iconfont character
app:drawableRight @drawable or @string which is treated as iconfont character
app:drawableStart @drawable or @string which is treated as iconfont character
app:drawableEnd @drawable or @string which is treated as iconfont character

NOTE

For all the four drawable properties, use app:drawableLeft and never android:drawableLeft. Behaviour with drawableTop and drawableBottom is also unspecified. This view only handles horizontal drawables properly.

# Usage

# Creating in XML

<com.zomato.sushilib.atoms.textviews.SushiTextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Text listing"
    android:textSize="@dimen/sushi_textsize_700"
    app:textFontWeight="extralight"
    app:drawableLeft="@string/icon_unfilled_star" />

# Changing properties in Java/Kotlin

myTextView.setTextAppearance(R.style.TextAppearance_Sushi_Label)

// Setting a tint (via a ColorStateList) of the drawables
myTextView.setCompoundDrawableTintList(ColorStateList.valueOf(Color.RED))
// Ideally set a proper ColorStateList that supports disabled/enabled modes etc

# Examples

# Weights

text-semibold text-medium

# Drawable

text-with-drawable