Creating launcher animations in android - java

I am thinking about making a launcher for android, i dont know if i'll market it. But i'm thinking like my phone is in landscape mode, and i see 4 rows of buttons, and 4 buttons on each row. Kind of like a grid with buttons. And then, once i click a button, i want the buttons splitted in the middle and moved from each other, with an animation. And then a second screen comes in from the back. How can i do this? I thought of creating two layouts holding 4 buttons each, and once i click one, it should move the layouts from each other and the second blank screen would kind of fly in from the back, like if it was behind the buttons. How can i create these animations? Please help me and thanks so much!

You can add a middle row with width initially as 0dp, and then when opening an Activity you could animate its width, and for the second screen you can use a simple zoomIn animation with overridePendingTransition() after startActivity()

Related

How to have buttons permanently showing (even after activity change)

I am wondering if there is a way to have my 3 buttons shown permanently while I am changing activity. I have slide animations on the app when changing activity and it looks very odd that the buttons are sliding too. Below is what it looks like.
Thanks in advance.

Eclipse android widget moving

I am designing my activity screen using eclipse but whenever I move an object e.g. a button it snaps around and I find it hard to position things where i want them.
Is there some setting I can change as as soon as I add a second button it snaps the other button to another position it is so annoying!
Also if I have an image button why can't i resize this, even with a normal button if i try to make it larger it just fits to the text and wont make the button bigger or it just flicks to a random place on the activity?
thanks
Probably you're trying to place components freely in the View but you're not considering the LayoutManager behavior. If you try to position your component in a LinearLayout, for example, the components will be placed following its rules, and these components will not stay where you drop them.
Try to understand better how the layouts works on Android. But for now, the AbsoluteLayout or RelativeLayout may be what you're looking for.
About the components size, you'll need to understand better how to use layout properties for these components. See the question How to size buttons for more information.

Android Button background Image changes back to state in XML

I have a simple soundboard which uses Buttons to represent the sounds. When a sound button is clicked. The background image is changed using the view.
Button butt = (Button)view;
butt.setBackgroundResource(buttons_on[media]);
buttons_on is a int[] representing the drawables of the buttons.
This all works perfect, but I also use a FragmentActivity to create a paged App. The App has 4 different pages which you can swipe through. When I change a button using the above code and swipe two pages to the right and than swipe back. The image of the button has changed back to it's default defined in the page.xml.
How can I prevent this behavior?
change the Buttons to ImageButtons and setting the src?
somehow prevent the page from reloading
Instead of doing that you should look at how to use a StateListDrawable. It will simplify your approach.

Having activity greyed out and having two buttons to select

Is there any way I can make two buttons appear up and have the main UI greyed out without calling the pause method in android? sort of like robo defender. thanks!
I'm unfamiliar with Robo Defender, but a common way to do this sort of this is with an overlay. You can put a view over your activity with an opacity of ~30%. This view can have a grey image that cover everything but your buttons.

Cant use capacitive buttons while touching the screen

I'm having issues while coding for my Evo. While touching the screen, the Evo interprets me touching the buttons as another press on the screen instead of a onKeyDown, onBackPressed, etc. (It actually sets the MotionEvent pointer count to 2, and I can get the co-ords that I'm touching that are off the main screen, for example, 830*190 when touching the back button.)
Short of coding in the locations of the buttons (which would be different for every phone with capacitive buttons, if they all have the same issue), is there any way to get around this? Does anyone else have this issue with a different capacitive buttoned device?
On the Evo, the area where the buttons are uses the same capacitive touch sensor as the screen. You can test this by loading up a webpage and scrolling until your finger is in the buttons region. Instead of pressing those buttons, you just continue to scroll around on the webpage, because as far as the phone is concerned you're still touching the "screen".

Categories