Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.graphics.Rect;
import android.view.MotionEvent;
import android.view.View;

public class Main {
    public static boolean isMotionFocusOnView(View view, MotionEvent event) {
        Rect focusBound = new Rect();
        view.getFocusedRect(focusBound);
        return focusBound.contains((int) event.getX(), (int) event.getY());
    }
}