AndroidViewAnimations
AndroidViewAnimations copied to clipboard
SlideOutUp makes view transparent
So i have this framelayout with to LinearLayout. The first had the effect of Slide OutUp/InDown based on the click of an button on ActionBar. The problem is that when i call the Activity the last line called at the onCreate method is to apply the SlideOutUp on the DropdownMenu. But if i touch the area where this LinearLayout will SlidIn (to be visible) i can active the Spinner that were inside.
So why this is happening?
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fab="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/DropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
(other widgets like spinners ...)
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
(other widgets ...)
</LinearLayout>
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_layout);
ButterKnife.inject(this);
setupListeners();
toggleSearchBox();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
echo.debug("[onOptionsItemSelected] > " + id);
switch (id) {
case R.id.action_searchbox:{
toggleSearchBox();
break;
}
case R.id.action_reload:{
this.refreshHistoricosEmAberto();
break;
}
}
return super.onOptionsItemSelected(item);
}
public int llSearchFilterBoxStatus = 1;
public void toggleSearchBox(){
if (llSearchFilterBoxStatus == 0) {
llSearchFilterBoxStatus = 1;
YoYo.with(Techniques.SlideInDown).duration(350).playOn(llSearchFilterBox);
} else {
llSearchFilterBoxStatus = 0;
YoYo.with(Techniques.SlideOutUp).duration(350).playOn(llSearchFilterBox);
}
}
public void Slide() { try { new Handler().postDelayed(new Runnable() { @Override public void run() { YoYo.with(Techniques.SlideInRight) .duration(1000) .playOn(findViewById(R.id.ll_activity_premium_calc)); } }, 100); } catch (Exception ex) { } }