Resizable Rectangle Overlay on Touch in Android

When I read this question http://stackoverflow.com/questions/8974088/how-to-create-a-resizable-rectangle-with-user-touch-events-on-android 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 : https://github.com/rathodchintan/rectangle-overlay

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

NFC Mifare UID (Card Serial Number) reverse issue ... If you are using NFC (Near Field Communication) Mifare in your application, you should be careful while using NFC Mifare UID  (Unique IDentification ...
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...
Auto Restart application after Crash/Force Close i... In an Android application, we usually got the "Force Closed" error if we didn't get the exceptions right. Everyone has question about "How can I resta...
Share on Facebook0Share on Google+2Tweet about this on TwitterShare on LinkedIn0Share on Reddit0Pin on Pinterest0Share on Tumblr0Email this to someone