What Clean Master app does is that it put a widget on home screen and when user tap it , it cleans RAM and show an animation like this on homescreen(on top of homescreen) -
and i also want to do this ....
What i have done till now is that i have created a widget on homescreen and when user taps i received it inside an AppWidgetProvider class . shown here
I also think it shows this animation by using this feature - WindowManager.LayoutParams.TYPE_SYSTEM_ALERT , like what messenger did by overlaying chatheads on top of screen. This can be done like this - here.
But i am still confused on what would be the best approach for doing this.
Any help would be appreciated ! Thanks in advance.
It is possible to create Activities with transparent backgrounds. These activities will appear over the homescreen but will still show the homescreen behind it. When the App Widget receives a broadcast, it can create a PendingIntent to start this transparent activity, which will then be displayed over the fullscreen.
Related
I searched this topic and couldn't find anything on it.
Is there a way to make interactive icons on the home screen?
for example there is "clean master" that after you click an icon of it, it make an animation. Also there is this facebook thing where you get a message and an icon with the profile picture of the one that messaged you pops up.
I can't figure out or find a way to implement this kind of stuff..
I would be happy if any one could give me some kind of direction..
Thanks in advance.
for example there is "clean master" that after you click an icon of it,
it make an animation.
The icon doesn't animate. When you click on it, a new transparent Activity opens which the icon at the same position where the original icon is. The animations happens entirely on the activity.
The activity is transparent so you get a feel that the icon itself is animating. If you notice carefully, you can find the navigation bar coming up if you tap somewhere while its animating.
Also there is this facebook thing where you get a message and an icon
with the profile picture of the one that messaged you pops up.
It is know as Chat Heads. You ca create your own, but it an take some time and is a bit involving. If you are a beginner and/or you are in a hurry, you can use this library. I have used it and it works perfectly.
The general answer if you want activity on the home screen is to implement a widget.
http://developer.android.com/design/patterns/widgets.html
I'm working on a lockscreen widget(not trying to be specific here, but Nexus 7 ) . The widget has a button which would trigger an activity.When the user clicks the button, the unlock slide symbol get's highlighted hinting the user has to slide-unlock his screen before he wants to see the button's activity. Since now, the device is locked,is there a way to bypass this and just display the activity on top of the lock screen? (not in the case of pin/pattern obviously, but only just slide)
Was searching a lot for a way to do it. We need to use flags in while giving an intent to the widget button. More information here.
Android Lock Screen Widget
I want to create a custom launcher so that, I'll have list of app icons on the right side of the screen, and when the user clicks on an app icon, it'll open the application on the left side of the home screen (this is the part that I still miss).
Is that doable? if so, where should I start? any links or resources of suggestions?
Thanks in advance.
is it possible to get touch access of launcher while showing activity?
while activity covering only quarter of screen area only.
as i said make an activity layout which cover quarter area of screen, I added flag for activity getWindow().setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE, PixelFormat.TRANSLUCENT);
it works :) to get access of launcher screen, even my activity is open. I notice another one thing i m not able to get click event on launcher, nor getting focus from my activity to launcher, it's just giving me touch event on launcher.
any one have idea over this, how can i get focus from my activity to launcher or any open application.
I want to create a button which will be shown on top of all apps.
something like this
as you can see, there is a button at top left corner. it can receive touch events and touch events can be received outside it by other apps.
I tried to use Theme.Translucent.NoTitleBar to my activity but it does not helped. I also set size to my button to [100, 100] but other activity behind it can not receive touch events. I think that the problem is in activity's window. it's size does not equel activity's size.
any help please
UPD
solved
hatcyl in Create a UI or a widget that sees on top of all Application in Android? says:
If you want something to be clickable, you can display it on top of
anything except the lockscreen.
You would to use a service and WindowManager to show a button on every App.