Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.view.View;

import android.widget.LinearLayout;
import android.widget.RelativeLayout;

public class Main {
    private static final int DELAY = 100;

    public static void animateIn(View view) {
        if (view instanceof RelativeLayout) {
            RelativeLayout relativeLayout = (RelativeLayout) view;
            for (int i = 0; i < relativeLayout.getChildCount(); i++) {
                View child = relativeLayout.getChildAt(i);
                child.animate().setStartDelay(100 + i * DELAY).alpha(1).scaleX(1).scaleY(1);
            }
        } else {
            LinearLayout linearLayout = (LinearLayout) view;
            for (int i = 0; i < linearLayout.getChildCount(); i++) {
                View child = linearLayout.getChildAt(i);
                child.animate().setStartDelay(100 + i * DELAY).alpha(1).scaleX(1).scaleY(1);
            }
        }
    }
}