Ok, so I have worked the fading out content from within an id
(thanks to https://stackoverflow.com/a/4570977/971392).
I have the following function:
public void switchView(View view) {
LayoutInflater inflater = LayoutInflater.from(getBaseContext());
View to_load = inflater.inflate(R.layout.activity_register, null, false);
RelativeLayout rl = (RelativeLayout) findViewById(R.id.content_login);
Animation fadeOutAnim = AnimationUtils.loadAnimation(LoginActivity.this, R.anim.fadeout);
rl.startAnimation(fadeOutAnim);
//rl.setVisibility(View.GONE);
//rl.removeView(view);
rl.addView(to_load);
}
It does the desired action, IF I comment the rl.startAnimation(fadeOutAnim)
which is there only for the purpose of giving an animation on change view.
With the animation executing, the function changes the view through the rl.addView()
but then applies the fadeOut
and everything disappears.
So, how may I use the fadeout, without it removing my content?