Create an Overlay on top of everything - java

I am new to programming and have only made a few small apps for fun. I am trying to find out how to make an overlay on top of EVERYTHING on my Samsung S8 device (API version 26+).
What I want is to create something like the "Blue light filter" that already exists, however I want to change that filter to make it whatever I want. I am pretty sure I would know how to customise it and stuff like that. Currently the filter is orangey, what if I wanted to make it purple or black?
So my main issue is: I have no idea how to make an image, or a piece of text or anything, always be on top of everything that I do. I want to open up the app, change the filter colour, and for that filter to always be on, on top of any other app. I want to be able to minimise that app and for that filter to always stay. Can I call it a System Overlay or something like that?

Related

How to make an icon appear invisible without using a clear picture

I am making a program but the default Java icon looks really ugly, i want it so that the icon is clear without using any clear pictures, I'm using this code
f.setIconImage(new ImageIcon("pic.png").getImage());
so is there a way to do it? Or do i have to stick with a clear image?

Java - Image Opacity

I have been making a video using pure Java. I would like to put in a pop-up menu for players when every they hit ESC. I have the menu setup but it looks really quite ugly. I would like to make the menu blur the image behind it.
For example on the new iOS 7 on Apple devises a lot of the things like the dock blur to whatever is behind it. There is an example of what I am trying to achieve below!
The simplest solution would be to use something JXLayer, as it will allow you to apply filter effects to the components that it covers.
For example.

AndEngine Image on part of a sprite

I'm working on a game which integrates Facebook. In a certain scene, the user can choose an opponent from the list of Facebook friends who have installed the game.
I want to create this menu of friends, I know how to create the list, I know how to get the friends who have the app installed, and how to get their info. What I don't know, is how to create a sprite, which would have, for example, the user's profile image on the left, his name and score on the right, and to have this whole thing act as a sprite (or a SpriteButton)
Can anyone point me to the right direction?
Since I obtain the info from Facebook, I can't, obviously, have the Sprites pre-made.
Any help would be great!
You shouldn't use AndEngine entities for this, as there is nothing ready to suit your needs (You'll have to make this on your own).
Instead, use the regular android dialogs. You can use your own layout which consists the profile picture and any other text you want.

Custom Button from 9patches WITHOUT XML

I would like to create a custom Android button from 9patches, but without using any XML. I know, it sounds dumb, but the reason is that for some reason my IDE (NetBeans) messes up the whole XML beyond belief. The R.java doesn't get generated half the time (the fixes didn't work for me), and I get random errors, even if I just copy and paste XML from tutorials.
This is how I plan to create the Button:
The button has a setBackgroundDrawable() method
I need to suply this method with a StateListDrawable
Which I need to build up from NinePatchDrawables
So first I need to create the 9patches, then a StateListDrawable from them, and simply pass the StateListDrawable as background for my Button's setBackgroundDrawable() method.
I can't start the 9patches, because I can't find out how the constructors work.
Wouldn't it make more sense for you to invest your time in either:
fixing NetBeans, or
switching to some different editor/IDE?
Trying to do Android development without XML is akin to trying to fly without wings. It's possible, but rockets tend to crash and burn in the end.
Regardless, you do not need to directly work with NinePatchDrawable to use nine-patch PNG files. Android will handle that part for you.
Instead, create an instance of StateListDrawable and call addState() for each one of your states. To get the Drawable for the state, use getResources().getDrawable(R.drawable.this_is_one_of_your_nine_patch_images) from your Activity. Android will detect that this is a nine-patch and will do the right thing.

Customizing an image gallery in android

I swear, this control has been the bane of my existance this week. Just FYI, I have pretty basic OO/Java skills, I've mainly been using xml to create layouts, but I need to use the gallery control. I've finally got the sample code working from the sdk, but one thing remains a mystery despite looking here, googling elsewhere, etc., there seems to be no clear answer on how you exactly manipulate the attributes of individual images within the gallery. I keep looking for an example of a template that I could implement, but see nothing. Really, I'm not looking for anything fancy, I just want the images to scale properly within a fixed height gallery control, and surround each image with a 1dip light border, and keep each of them about 4dip apart from one another, that's about it. But for the life of me I'm just not seeing how to make these customizations, and I'm starting to tear my hair out! :-/ Any help or reference to how to do this with some actual examples would be priceless!
Yeah, just to continue on your own answer.
The getView() method of the adapter is the place where you'll do anything you want with the images, i.e. set up borders, layout params, lazy loading, etc.
As long as the method returns the View you've made changes to, it should work just fine.

Categories