I wanted to take screen shots from the android screen with a floating button.
I made the floating button and it takes screen shots and everything works well but there are two questions
1. How can my app take screenshot in a way that the floating button gets hidden then appears after the screen shot has been taken in order not to bother the user
2. When you press the volume down and power key to take screenshot, it has a great animation. How can i add that animation?
Get your button's view, and just before taking the screenshot, hide it and unhide it after you are done taking the screenshot in the floating button's onClick method.
findViewById(R.id.floating_button).setVisibility(View.INVISIBLE);
// Take screenshot here
findViewById(R.id.floating_button).setVisibility(View.VISIBLE);
Add it in your java file
View b = findViewById(R.id.button);
b.setVisibility(View.GONE);
This is how the system does the animation. You should be able to re-use most of the code you find here:
http://androidxref.com/5.1.1_r6/xref/frameworks/base/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java#388
Animations:
http://androidxref.com/5.1.1_r6/xref/frameworks/base/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java#540
Related
I'm making custom camera app and I need to create a camera buttons like picture, video and time laps button as similar to instagram camera. I can create a design similar to these buttons but problem is that I can't move them like that.
If you see in Instagram as shown in picture By default its show picture button but I want to change it when someone swipe finger on it.
Here is image of instagram camera
As you can see in image when user swipe on white ball it moved to next BOOMERANG and so on and back and forth.
Or if user click on any text which is at the bottom of screen it scroll set in the middle right above the arrow.
I want similar functionality But I don't know how to achieve this because I'm new in android. Can you please let me know what I need to read for this.
Thanks.
![Adding buttons on top of the default call screen of android][1]
http://i.stack.imgur.com/SJ8Pc.jpg
As shown in the below image, there are two buttons one is Live video button and the other is Picture share button, how to add those button on top of the default android call screen while making call.
Thanks,
Android F
I believe the way to do this is to draw views on top of the dialer activity. This is similar, in implementation, to the Facebook home chatHead feature. Have a look at this article, which shows how to draw any view: http://www.piwai.info/chatheads-basics/
In your case, your view would be a LinearLayout containing two buttons.
I'm working on an app which presents users with four buttons and a timer. The users then tap as fast as they can, each user on his own button, and the one with the most taps at the end wins.
I can't use onClick here, because it locks up the UI thread until the button is released, effectively blocking other button presses. I have searched around for a bit and found that I could use onTouch, but it doesn't work the way I want it to. If a user has touched and is still holding a button, any subsequent touches on other buttons will behave as though this first button was pressed.
Someone suggested the use of an image, transparent and stretched across the entire visible UI. One could then read any touches on this imageview and assign a touch to a particular button based on the coordinates of the press. (I guess I would take a screenshot of my UI with the four buttons visible, open it in paint and write down the coordinates of the borders for each button, then use those coordinates in the code to figure out which button the user was trying to press.)
Can anyone help me with this method of work, give me a quick example, or link to where I can learn how to do it and implement it in my app? It would be much appreciated.
TL;DR: How to use an image, transparent and stretched across the entire visible UI and read the coordinates of each press (even if multiple at once)?
in my app i am trying to get the following designs.
Above is the first image
Above is the second image
When the activity is opened the first image is shown, currently i have shown it as an tab bar but i am not able to place an red colored rounded imageview near the Why? button. According to my app the number in the rounded image view must get changed often.
When the next Why? button is clicked i want to show the UI as in second image with another three buttons over it.
In ios apps, this design can be made by the help of UISegmentControl. In android apps how to implement this.....
This is the nice tutorial about Tab activity and also put badge inside it
see below link
Click Here
I have 5 buttons on my activity. When a user touches any of them, the button will play an animation which is roughly twice the size of the button itself. When the active button grows/animates, it will overlap the non-active buttons...and sometimes be hidden behind (usually on the edges)
Is there a way I can dynamically adjust something similar to z-index for the button in animation? I already have the logic set up, just don't know the name of a function/if it exists to do this.
Thanks!
Try using bringChildToFront() on the surrounding Layout.