I have a condition that says if it's a textview then use a relative layout to hold it, however, if it is a youtubeplayersupportfragment, then use a linear layout. The reasoning behind this is because the youtube player api "doesn't allow view overlays" -_-*. Anyway, I enjoy having the view overlay in any other case besides the youtubeplayersupportfragment, and I just want to use weighting in the case of the youtubeplayer, so that it will comply with the terms of service, and balance the views so that none are overlaying.
My real question is: is it possible to efficiently interchange parent layouts holding items without causing too much overhead? I understand that this is a very specific case, so there probably is no way to do this, and I will probably end up being forced to always use a linear layout to comply with TOS :(
Please help a new androiddev out!
Also, is there a way to force it so that there is no overlay in a relative layout?
edit:
Ok so, here's my layout so far. Don't mind the surfaceview, it's helping a youtube glitch...
I'd like to change the HackyViewPager, to delete the layout_above parameter when there is a youtube fragment loaded into the viewpager. Is there a way to delete a parameter like that? If there is not, then is there a way to say 'Layout_above="bottom of the screen"?'
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="${packageName}.${activityClass}"
android:background="#000000"
android:orientation="vertical">
<asdfsdf.adfaf.asfdfa.HackyViewPager
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/pager"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="false"
android:layout_above="@id/popupMenuButton"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"/>
<SurfaceView
android:layout_width="0px"
android:layout_height="0px"
android:visibility="gone"
android:id="@+id/surfaceView" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/popupMenuButton"
android:layout_gravity="end"
style="?android:attr/borderlessButtonStyle"
android:src="@drawable/popupmenubutton"
android:background="@null"
android:onClick="showPopupMenu"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>