So yes, I know how to make my Activity look transparent (http://stackoverflow.com/questions/2176922/how-to-create-transparent-activity-in-android), but I want the user being able to interact with what ever screen they are (for example YouTube), like done in SwipePad. Now I can make it transparent, but the user can't do anything before exiting my activity.
I know this is possible as it's already done in SwipePad, but how?
Well, the thing I was looking wasn't a transparent activity - it was a system overlay. More info here: Creating a system overlay window (always on top)
I think you can take a look at FrameLayout or SurfaceView.
There's a high chance SurfaceView is the answer.
Related
just a simple question (hopefully):
Is there any easy way to make a simple translucent screen overlay on android? Just a solid color would work perfectly for starters. I would wager that this wouldnt be started as an activity but run as a service since the overlay should display over everything always until disabled, whether or not the application that hosts this overlay is running/paused/stoped.
It's easy to make an overlay for a specific activity/fragment, but I'd want this overlay to appear over the entire screen regardless of what's on screen (except maybe error dialogs, those seem to take presidence over anything).
Edit: To add more information, apps like "twilight" and "screen filter" seem to be able to do this sort of thing, whereas they are able to display a color at a custom transparency over the entire screen whether or not the app is running.
Yeah, it's possible to implement entire screen overlay using SYSTEM_ALERT_WINDOW permission and WindowManager, that's how Facebook chat heads works. Basically, you need to add your View to WindowManager instance, search WindowManager for more information.
I have seen apps like Gamekiller and Scramble Cheat that shows partially over another app like a shadow and the touch events over them actually works over the background app.
NO don't use transparent background use a service like this example it explains it well and could take you in the right direction.
http://www.piwai.info/chatheads-basics/
Or you could use standout.
https://github.com/pingpongboss/StandOut
I haven't tried standout yet but it looks good.
You can add own view to screen (WindowManager.addView). But in need permission SYSTEM_ALERT_WINDOW.
Or, better, create custom dialog with custom LayoutParams. Must important - set type to TYPE_PHONE or TYPE_SYSTEM_ALERT.
It display over other app.
I want to create a pop-up window (with black transparent background around it) that would appear above the application activity screen (by clicking on a button). This pop-up would contain a video player, a list of videos to be played and some other elements.
This pop-up has to be a fragment since I need to re-use it from other app fragments.
So my question is : what is the best way to achieve that? I personally see 2 options :
1) adding the pop-up as a fragment on the layout and to show + activate it whenever I need. But in that case, how can I put a black transparent background around it that would fill the whole screen?
2) using DialogFragment but it seems that this class is not very well-designed for this kind of stuff.
What do you think?
Thanks in advance.
DialogFragments are the suggested way to launch Dialog views from within a Fragment, so this is the solution I would suggest for you.
You can do pretty much anything you need within the DialogFragment. You will be in full control of the UI using this method.
Here is a SO discussion of the same point, with good info: Android DialogFragment vs Dialog
After seeing the last screenshots of new foursquare application and their balloon like cartoon instructions, I'd like to create some of these in my application.
I found a similar question for iPhone
Small popup for instructions... How?
Here is another screenshot of foursquare app:
I'd like to know how I could achieve that with Android.
Thanks in advance for any help.
UPDATE: This is what I could get so far but adding some buttons with a custom drawn background and layering them with a FrameLayout:
But I still couldn't get the triangle effect. Maybe there is something I can do with my custom background shape?
UPDATE2
After checking your suggestions, I decided to go with Aaron C idea and added an image with an arrow on it. This is my current result:
Thank you Snailer, QuickAction API project seems very much promissing. I'll check it out when implementing more features in my app.
Now, I just need to get the right color or maybe I could just let it this way. It seems nice too.
And, so, to summarize what I did:
Got my initial xml layout inside a FrameView.
As I'm using a frameview, everything I put in here will be piled one over the other. That's how I could add things to the layout.
In that framelayout, I put 2 relativelayouts whith an image with the triangle and a button to create the two upper popups. In the bottom I put a button only.
That's it. I hope it helps somebody.
Thank you very much again for all your help!
That sounds like a neat thing to implement. There might be a built-in Android variation on AlertDialog that achieves this, but if not here is how I would go about implementing it:
Create a new Activity whose background is black with a very high (low?) alpha color value. This will allow you to see through it to the previous Activity in the stack. Then, add your alert at whatever coordinates you like using a relative layout with padding values.
You might also want to add a touch listener that exits the Activity if the user touches the balloon (or maybe anywhere in the screen).
If you want to be fancy with coordinate placement of the balloon, you can pass this information into the new Activity using the Activity's launch Intent with the putExtra() methods.
It's probably achieved through skinning a toast.
The developer documentation shows a skinned toast in "Creating a custom toast view" at http://developer.android.com/guide/topics/ui/notifiers/toasts.html
You may want to look at the QuickAction API. It acheives this by using PopupWindow, skinned, positioned, and animated.
I've seen some android apps do this, so I know it can be done, I'm just baffled as to how. I can't think of how it would be done. Think of what I'm talking about as similar to the recently open applications view. When you hold down the home key the Recently viewed applications pops up. It doesn't exit your current activity, it creates something that runs on top of it. This can be accessed in any activity no matter what. I want to know how to make something similar but through touching a certain part of the screen, or making a gesture on the screen. Can anyone point me in the right direction?
I'm guessing that you're talking about an activity that has transparent view areas, thus permitting view to whatever is underneath it.
How do I create a transparent Activity on Android?
Activity should be transparent, but has black background