Solved

How to move a clickable button across the screen

Posted on 2014-10-15
3
219 Views
Last Modified: 2014-11-13
I'm looking for a simple way or tutorial for making a simple android activity that has a clickable button that slowly moves across the x axis of the screen and remains clickable no matter where it is. I want my onClick method to write to logcat the x,y coordinates of the button each time it is clicked. That's all.

Thanks.
0
Comment
Question by:BobHavertyComh
3 Comments
 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
Homework?
0
 
LVL 9

Author Comment

by:BobHavertyComh
Comment Utility
No.
0
 
LVL 16

Accepted Solution

by:
Chris Harte earned 500 total points
Comment Utility
You are going to have to use an animation of a bitmap on a This_Surface not a button. An

onTouch (View v, MotionEvent m)

will capture the location of the press to a Point variable. Not a huge project but not straight forward either.
Here are some tutorials that will get you started, in particular videos 62, 68 and 70.

https://buckysroom.org/videos.php?cat=6
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction Everyone is using a smartphone these days. Contacts, messages, applications, documents, bookmarks, pictures, videos and other stuff which you created and are present only on your device come under the umbrella called “Personal Data”.…
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now