I faced a similar problem, I wanted the client to go through an application where the whole screen was supposed to become whiter (as they said: โtransparentโ), except that the button is explained by an overlay speech bubble.
Fortunately for you, your layout is not as complicated as the one I had to work with :)
Now you can get the transparency effect in two ways: either have a white background, or call all setAlpha () methods, or create a translucent white overlay.
If you go overlay, you will need to find a way to display the opaque buttons through the overlay. This can get a little complicated. If you go to the first option, you can just set Alpha (1) to an opaque look so that it appears.
The setAlpha () method is only available from api version 11+, so if you are targeting an earlier version, you may have to make it a little more complicated. An example of setting alpha for pre-honeycomb views:
Layout for your buttons (make them what you want, just make them look like you can skip them):
<LinearLayout android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> <ImageView android:tag="image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/tile"/> <TextView android:tag="text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#FF000000" android:text="button1"/> </LinearLayout>
In your program, when you want to make buttons transparent:
LinearLayout l = (LinearLayout) findViewById(R.id.button1); ((ImageView)l.findViewWithTag("image")).setAlpha(0x7F); ((TextView)l.findViewWithTag("text")).setTextColor(0x7F000000);
When you decide how you want to create a transparency effect, you will need to decide how to display the overlay text / bubble. Most likely, you will want to place this on a separate layer on top of the entire layout to make sure that this does not affect your new view.
One way to achieve this is to change the root layout element to FrameLayout, and then create / display in it. eg:
<FrameLayout background="#FFFF"> <LinearLayout> </LinearLayout> <LinearLayout visibility="gone"> <ImageView /> <TextView /> </LinearLayout> </FrameLayout>
When the introduction is entered, you indicate the position of the hidden overlay view at the position of the displayed table element, change the text to the corresponding line / resource and display the view.
When the input is complete, you reset the alpha values โโof all the buttons and set the overlay visibility again.