position And Size View As Icon - Android User Interface

Android examples for User Interface:View Position

Description

position And Size View As Icon

Demo Code


//package com.java2s;

import android.view.View;

public class Main {
    private static void positionAndSizeAsIcon(View srcView, View desView) {
        desView.setScaleX(srcView.getWidth() / (float) desView.getWidth());
        desView.setScaleY(srcView.getHeight() / (float) desView.getHeight());
        desView.setAlpha(0.2f);/*from  w w  w.  j ava2s  .c  o  m*/
        desView.setVisibility(View.VISIBLE);
    }
}

Related Tutorials