Example usage for android.widget RelativeLayout setScaleX

List of usage examples for android.widget RelativeLayout setScaleX

Introduction

In this page you can find the example usage for android.widget RelativeLayout 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:com.luseen.spacenavigation.BadgeHelper.java

/**
 * Show badge//from w w w  .  j  a  v a  2  s  . c o m
 *
 * @param view      target badge
 * @param badgeItem BadgeItem object
 */
static void showBadge(RelativeLayout view, BadgeItem badgeItem) {

    Utils.changeViewVisibilityVisible(view);
    TextView badgeTextView = (TextView) view.findViewById(R.id.badge_text_view);
    badgeTextView.setText(badgeItem.getBadgeText());

    view.setScaleX(0);
    view.setScaleY(0);

    ViewCompat.animate(view).setDuration(200).scaleX(1).scaleY(1).setListener(new SimpleViewAnimatorListener() {
        @Override
        public void onAnimationEnd(View view) {
            Utils.changeViewVisibilityVisible(view);
        }
    }).start();
}