I have a button which when you click it, a scale animation occurs on the button (scaling until 0), and then another screen shows up. when i hit back the button that i scaled does not show. Help?
From what I understand, the "back" function programming is not appropriate. If you have used a back button, try programming the visibility of your scaled button in back button. Post your code for "back" function so that it will give a better idea of your need and your problem.
Related
I currently require to design a camera function for android version 4 (Kitkat), but i notice that there is snap picture button and ok button in the camera as picture below:
How to make it disappear and user just touch on screen it can snap the picture without the button, and the picture will directly save without need of pressing ok button.
Anyone can share me the ideas, I very need you guys help because suffer this for long time already, thanks.
so I am trying to implement something like a ripple water effect on an Android app where I can click only on a button and the ripple would affect everything that is currently displayed except the clicked button.
I don't really know how to start, any suggestions?
I have an icon in my application and I made it clickable (When I click the icon, some action is called), but the problem is, you have to be really accurate. On the other hand the menu icon (the 3 dots) has a bigger "range" and when you click little bit outside, it is still working. Is there any way to achieve the same thing at the app icon? Or is there any better way to make a clickable icon in the upper left corner than using app icon?
Add padding to the icon, the more padding you add to it, the more clickable area you ll get!
Try to put a transparent button over your icon. Don't forget to make it unclickable and put enabled to false, so it doesn't intercepts the click intended for the icon.
I'm using justTouched for manipulate easly touches and released in android, cause isTouched method acumulates many touches; but it works as the same in windows? Meaning, one event even when keep pressed? Or do I need another method/invoker/listener?
On desktop builds, Libgdx treats mouse button presses as touches. justTouched acts exactly the same, except that it polls mouse buttons instead of screen taps. And just like how on mobile you can't tell which finger just touched the screen, you can't tell which mouse button was just pressed. If you need to know which mouse button or finger touched down, you need to use an InputProcessor, which gives you far more information than using the Gdx.input convenience methods.
If you don't care which mouse button was just pressed, all you need is:
if (Gdx.input.justTouched()){
//...
}
Based on your comments under your question, you seem to be trying to distinguish which button just touched with || Gdx.input.isButtonPressed(Input.Buttons.LEFT)) which will return true on every frame as long as the left button is held down. And if instead you did && Gdx.input.isButtonPressed(Input.Buttons.LEFT)), then you wouldn't be sure that it's the left button that was just pressed. (Maybe you're holding down the left button and just pressed the right button.) There is no easy way to distinguish which button was pressed unless you are using an InputProcessor.
In my Android app I have a gallery which contains some TextViews. I realized that some users don't understand that they can scroll that gallery although the previous and next TextViews are partially visible. So I put an ImageView with a horizontal arrow under the gallery.
Now the users try to drag the arrow. Is it possible to redirect the touch event from the ImageView to the gallery so that dragging it would scroll the gallery?
Thanks in advance,
Fri
The simplest thing (if you don't mind scrolling one item at a time) is to detect the direction of the touch event on the arrow and then dispatchSetSelected(boolean selected) on the gallery... I believe that will work. after the user does that once, they will probably intuit that they can then just drag the gallery. Of course if you want to measure the touch event speed and do the calculation for how far to scroll based on that, you can do that too... but that seems like a lot of unnecessary trouble.