0
Next I want to make this layout (id div_external) below is anchored at the bottom of the screen. But look at the next one it’s at 0dp height on purpose, I don’t want it to appear unless I click the button. Until then everything well works perfectly...
<?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 Standard Layout created by android studio
then ... I have already set the attribute android:layout_alignParentBottom="true" however when clicking the button it simply ignores and goes up
– Osvaldo Pereira
It may be because you are moving in height (especially because you are setting for match_parent, which occupies all available space within the parent). Try changing to the code I suggested.
– Márcio Oliveira
but the idea is to make it look like the menu of UBER you know ? that goes from bottom to top and when closing it goes from top to bottom
– Osvaldo Pereira
I also don’t understand why you’re using a runnable.
– Márcio Oliveira
I have removed the runnable , is why I was using the button to test a server response and needed it there hehe,
– Osvaldo Pereira
and using setVisibility the layout simply appears or simply disappears by clicking the button
– Osvaldo Pereira
I kind of want the Snackbar effect, which comes by default when creating a Navigationdrawer Activity, only without the close timer alone
– Osvaldo Pereira
The Uber menu to use a shared element transition effect where the menu is clicked on a second Activity when clicking the first Activity button and the elements that are "equal" between the activities make a transition animation that gives the impression of just moving in the same Activity. It is not difficult to implement: https://developer.android.com/training/material/animations.html?hl=pt-br#Transitions
– Márcio Oliveira
OK Márcio, I will read what you sent there and soon I send an answer if I could or not , thank you for the attention
– Osvaldo Pereira
Good Marcio, it was a little more time consuming than I imagined , but in fact it is quite simple , I used only an Immature Object worked perfectly , but with this I showed me doing another effect that was much more interesting in the app , Thanks anyway !!!!
– Osvaldo Pereira
Ball show!!!
– Márcio Oliveira