Example usage for android.widget TextView getLinkTextColors

List of usage examples for android.widget TextView getLinkTextColors

Introduction

In this page you can find the example usage for android.widget TextView getLinkTextColors.

Prototype

public final ColorStateList getLinkTextColors() 

Source Link

Usage

From source file:com.bt.download.android.gui.util.UIUtils.java

/**
 * Android devices with SDK below target=11 do not support textView.setAlpha().
 * This is a work around. //from w  w  w  .j  a va 2 s. c  om
 * @param v - the text view
 * @param alpha - a value from 0 to 255. (0=transparent, 255=fully visible)
 */
public static void setTextViewAlpha(TextView v, int alpha) {
    v.setTextColor(v.getTextColors().withAlpha(alpha));
    v.setHintTextColor(v.getHintTextColors().withAlpha(alpha));
    v.setLinkTextColor(v.getLinkTextColors().withAlpha(alpha));

    Drawable[] compoundDrawables = v.getCompoundDrawables();
    for (int i = 0; i < compoundDrawables.length; i++) {
        Drawable d = compoundDrawables[i];
        if (d != null) {
            d.setAlpha(alpha);
        }
    }

}