I have one Animation, which causes the view to shift from the screen to the right, this works as expected with the following code:
Animation outtoRight = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, +1.0f,
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f
);
outtoRight.setDuration(500);
outtoRight.setInterpolator(new AccelerateInterpolator());
outtoRight.setFillAfter(true);
This means that the view to which I am applying this animation will exit the screen perfectly. Of course, I have the opposite. But my question is, how can I display the view on the screen so that I can insert it without applying this animation to it at least once?
I played with negative fields and such, but I cannot find the correct properties for my view to be off screen at startup.
Just to clarify, I can hide it from the very beginning with a different animation, but I see that it goes away, even if it is for a split second. There must be a way so that he simply was not there at the beginning and allowed me to push it later.
source
share