i'm placing glsurfaceview on top of output camera , drawing onto it. have regular layout containing surfaceview , textview:
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/relativelayout1" android:layout_width="fill_parent" android:layout_height="fill_parent" > <surfaceview android:id="@+id/camerapreview" android:layout_width="fill_parent" android:layout_height="fill_parent" /> <textview android:id="@+id/nearest_place_label" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:layout_centerhorizontal="true" android:textcolor="#000" android:textsize="30sp" android:text="@string/empty" /> </relativelayout>
then programmatically add glsurfaceview:
public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_bigarrow); //... camerapreview = (surfaceview) findviewbyid(r.id.camerapreview); mglview = new myglsurfaceview(this); addcontentview(mglview, new layoutparams(layoutparams.match_parent, layoutparams.match_parent)); previewholder = camerapreview.getholder(); previewholder.addcallback(surfacecallback); previewholder.settype(surfaceholder.surface_type_push_buffers); nearestpublabel = (textview) findviewbyid(r.id.nearest_place_label); nearestpublabel.settext(r.string.bigarrow_searching); nearestpublabel.setvisibility(view.visible);//clutching @ straws }
the glsurfaceview transparent, apart small area of screen, , can see camera preview beneath it. textview isn't visible. when had set regular views, textview visible.
i switched loading glsurfaceview xml rather using addcontentview
, , textview visible. doesn't explain wrong previous approach, i'm happy now.
Comments
Post a Comment