Example usage for android.widget TextView setScaleX

List of usage examples for android.widget TextView setScaleX

Introduction

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

Prototype

public void setScaleX(float scaleX) 

Source Link

Document

Sets the amount that the view is scaled in x around the pivot point, as a proportion of the view's unscaled width.

Usage

From source file:io.plaidapp.ui.HomeActivity.java

private void animateToolbar() {
    // this is gross but toolbar doesn't expose it's children to animate them :(
    View t = toolbar.getChildAt(0);
    if (t != null && t instanceof TextView) {
        TextView title = (TextView) t;

        // fade in and space out the title.  Animating the letterSpacing performs horribly so
        // fake it by setting the desired letterSpacing then animating the scaleX \_()_/
        title.setAlpha(0f);// www  . ja va 2s  .  c  o m
        title.setScaleX(0.8f);

        title.animate().alpha(1f).scaleX(1f).setStartDelay(300).setDuration(900)
                .setInterpolator(AnimUtils.getFastOutSlowInInterpolator(this));
    }
}