Android Question button onclick Long Click

sultan87

Active Member
Licensed User
Longtime User
hello,
I have a button with onclick events and Long Click events
in the click event, I increments a counter 1 by 1 and I view this counter each time I click on the button
I wish by holding down the button, rotate the counter and display it as I did not release the button
how to do?
best regards
 

sorex

Expert
Licensed User
Longtime User
one option is using a timer that checks a variable set by the long press event.

if the variable has the right value rotate your view.
 
Upvote 0

sultan87

Active Member
Licensed User
Longtime User
hello,
I have a button with onclick events and Long Click events
in the click event, I increments a counter 1 by 1 and I view this counter each time I click on the button
I wish by holding down the button, rotate the counter and display it as I did not release the button
how to do?
best regards
one option is using a timer that checks a variable set by the long press event.

if the variable has the right value rotate your view.
thank's for your response
click the event furthered my counter 1 by 1 to refine.
you always releasing and clicker again
what I want is by a long press to turn the meter display for each increment and stop if releases the button
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
I don't understand exactly what you want to do.
What do you mean with onclick events, do you mean Click events, what are these supposed to do ?
Then you speak of LongClick events, and if I understand well you want to increase a counter as long as the button is pressed after a long click.
You could do this in the Touch event with Timers.
A first Timer checks between Click and LongClick and a second Timer manages the counter.
 
Upvote 0
Top