Resizable Rectangle Overlay on Touch in Android

When I read this question on StackOverFlow, I tried to develop a custom control overlay which behaves like it.

Read this article to make your own resizable rectangle overlay on touch in Android. This will help you in Image or map application.


rectangle overlay

Download Source :

Step 1

Create a package called “customview” in your application and paste following class in it.

Below class holds image, points (location) of 4 corners.

Step 2

We have created a class which holds corners information and image. But to handle those corners, we need to implement that ColorBall objects in another class called “DrawView”. Copy/Paste below code in same package “customview”.

Thats it!!!

To use custom control in your application, write following code in your layout file.

You can do some more research and implementation to add more functionality to this overlay.

You may also like to read

Exit from Activity with twice “Back” b... When we are doing some important operation or work on activity and it may possible that by mistake we pressed "back" button. Then what?? This will sim...
Using Facebook’s Shimmer effect in Android &... In this tutorial, you will learn about how to implement "Shimmer effect" developed by Facebook for Android. Download Source Code
APK Analysis : Spotlight on WhatsApp | How to use ... Android Studio includes an APK Analyzer that provides immediate insight into the composition of your APK after the build process is complete. In th...
Develop apps faster using Data Binding – Par... Google has been pushing updates to existing tools and making the life of android developers easier. They also have been releasing new libraries and AP...
Share on Facebook0Share on Google+2Tweet about this on TwitterShare on LinkedIn0Share on Reddit0Pin on Pinterest0Share on Tumblr0Email this to someone