Next I want to make this layout (from outer div id) below anchor at the bottom of the screen. But notice the following he is 0dp of height purposely, I do not want it to appear unless I click the button. So then everything works fine ...
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FF8800"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="osval.com.searchpeople.teste_act"
tools:showIn="@layout/app_bar_teste_act">
<RelativeLayout
android:id="@+id/div_externa"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="#FF555555"
android:orientation="horizontal"
android:animateLayoutChanges="true"></RelativeLayout>
</RelativeLayout>
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
runOnUiThread(new Runnable() {
@Override
public void run() {
RelativeLayout rl = (RelativeLayout) findViewById(R.id.div_externa);
LayoutTransition lrl = rl.getLayoutTransition();
switch (lock){
case "Fechado" :
lrl.enableTransitionType(LayoutTransition.CHANGING);
rl.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,
RelativeLayout.LayoutParams.MATCH_PARENT));
lock = "Aberto";
break;
case "Aberto" :
rl.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, 0));
lock = "Fechado";
break;
default:
break;
}
}
});
}
});
All this is "inside" the NavigationDrawer Default Layout created by android studio