0

I want to achive that I have a transparent background BUT with a picture ! So if got this in the XML file of my layout :

android:background="@drawable/wallpaperpic"

Now I want to transparent it so the background menu (f.ex. widgets or app menu) is seeable but also my drawable/wallpaperpic and the rest of my buttons etc are normal (100%).Hopefully I was able to express my self !

My Background : https://amazingpict.com/wp-content/uploads/2015/04/polygon-texture.jpg

I want to have thisenter image description here

WHERE you also can see my background picture a bit

  • Just to clarify - you're looking to add a background like in the second picture where it shows the "Wikipedia" result? None of the other pictures have a transparent background. – EboMike Jun 11 '15 at 22:14
  • Oh wait, you want to show something on top of the system menu, i.e. the stock Android launcher? – EboMike Jun 11 '15 at 22:14
  • Thats right. Transparent background with a wallpaper. That was the fastest which I founded ^^ – Chuck Norriz Jun 11 '15 at 22:15
  • In that case, you're probably looking for this? http://stackoverflow.com/questions/18341922/android-launching-activity-on-top-of-other-apps – EboMike Jun 11 '15 at 22:16
  • Exactly thats right ! – Chuck Norriz Jun 11 '15 at 22:17

5 Answers5

0

Try to set the alpha property of the view, like:

yourView.serAlpha(10);
Kamila Brito
  • 198
  • 8
  • I allready tried that but this makes firstly the view completly transparent and the background is going to be white . So thats not a workng solution :( – Chuck Norriz Jun 11 '15 at 21:59
0

If, as I'm guessing now, you have two layouts, one within the other, where the parent layout has the background, you can do this in the child layout:

android:background="@null"

This way, you can see the background, and your elements are intact.

Benyamin Noori
  • 860
  • 1
  • 8
  • 24
  • Ive got only one layout which has a backgroung image.In this layout I want to transparent the wallpaper so you can see the android menu of the user a bit – Chuck Norriz Jun 11 '15 at 22:04
0

Option 1 is to convert your image to a PNG and add an alpha channel.

Option 2 (which I would recommend) is to have a separate view that acts as your background, and set the alpha property for this view only. You can use a FrameLayout to put this background view underneath your other controls.

EboMike
  • 76,846
  • 14
  • 164
  • 167
0

In my opinion use TintableBackgroundView.

TintableBackgroundView.

feWRyee
  • 1
  • 2
0

If you launch your activity the normal way, the system will not render anything behind it (i.e. the launcher will be completely gone - it could even remove it from memory).

You'll need to implement your activity as an alert window. This answer has details on how to implement it.

Community
  • 1
  • 1
EboMike
  • 76,846
  • 14
  • 164
  • 167