I am writing an application that runs on Android 4.0.3 that uses video output via HDMI for display.
I had a tinted transparent TextView working on top of the VideoView, but on a series of seemingly unrelated changes, I broke it and cannot make it work again.
I used SetBackgroundColor, i.e.
myTextView.setBackgroundColor( Color.argb ( 128, 128, 0, 0 ) );
Symptom TextView displays a solid background color (RGB 128.0.0) and lack of transparency. If I set the alpha value between 0, the background will become completely transparent, but I can still highlight the background color behind the VideoView in the outline of the text inside the TextView. When I set the alpha somehow above 10, for example, the background becomes a solid color, i.e. The example above would be RGB (128.0.0).
I searched a lot of things like setAlpha(float) , setBackgroundColor(Color) , dynamically creating views in different orders, creating and arranging views in XML, bringToFront() , getBackground().setAlpha( int ) , android:background="@android:color/transparent" all without further success.
I created another simple application with everything that was deleted, to try and find out what is happening, but will fail.
XML layout
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/frame" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" > <VideoView android:id="@+id/videoScreen" android:layout_height="fill_parent" android:layout_width="fill_parent" > </VideoView> <TextView android:id="@+id/textScreen" android:layout_width="300sp" android:layout_height="fill_parent" android:background="#80800000" android:text="@string/hello_world" android:lines="400" > </TextView> </FrameLayout>
Simple video review
final MediaController mediaController = new MediaController( getWindow().getContext() ); videoView = ( VideoView )findViewById( R.id.videoScreen ); mediaController.setAnchorView( videoView ); videoView.setMediaController( mediaController ); videoView.setVideoPath( "/mnt/extsd/test-movie.mov" ); videoView.start();
If I understood correctly, this should lead to a red tinted translucent TextView on the running VideoView, but I can not get it to work.
If I delete the VideoView and place the ImageView with the image, then the highlight color and background color work . I suspect something unusual in the TextView over the VideoView.
Does anyone have any suggestions what can I do wrong? or check something?
Is there something obvious that I'm missing?
A short working example of a TextView using the background color Color.argb (128, 128, 0, 0) over a VideoView would be appreciated if anyone has one.