Skip to content

Instantly share code, notes, and snippets.

@alexcohn
Last active August 17, 2019 16:40
Show Gist options
  • Save alexcohn/e1ed78a734f5cfe01a2616060c26b5ce to your computer and use it in GitHub Desktop.
Save alexcohn/e1ed78a734f5cfe01a2616060c26b5ce to your computer and use it in GitHub Desktop.
To help with https://stackoverflow.com/q/57523822/192373 how texture view can hide behind the activity layout
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.example.android.camera2basic.AutoFitTextureView
android:id="@+id/texture"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<RelativeLayout
android:background="@android:color/black"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- usual content of the Activity, e.g. -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/txt" />
</RelativeLayout>
</FrameLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment