Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.animation.Animator;

import android.os.Build;

import android.view.View;
import android.view.ViewAnimationUtils;

public class Main {
    public static void revealColorFromCoordinates(int x, int y, View viewRoot) {
        float finalRadius = (float) Math.hypot(viewRoot.getWidth(), viewRoot.getHeight());
        Animator anim = null;
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            anim = ViewAnimationUtils.createCircularReveal(viewRoot, x, y, 0, finalRadius);
        }
        //viewRoot.setBackgroundColor(ContextCompat.getColor(viewRoot.getContext(), R.color.colorPrimary));
        anim.setDuration(1000);
        anim.start();
    }
}