Fixed a transformation error when fading in views

Views could still be stuck in a old translation and
therefore the whole view looked weird.

Change-Id: I48a8f8824d8e5bdb0913a24783967a36c34797a8
This commit is contained in:
Selim Cinek
2016-02-11 18:07:43 -08:00
parent a40915077f
commit 6f4fcdc4e6

View File

@@ -293,14 +293,19 @@ public class TransformState {
mTransformedView.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
mTransformedView.setAlpha(visible ? 1.0f : 0.0f);
if (visible) {
mTransformedView.setTranslationX(0);
mTransformedView.setTranslationY(0);
mTransformedView.setScaleX(1.0f);
mTransformedView.setScaleY(1.0f);
resetTransformedView();
}
}
public void prepareFadeIn() {
resetTransformedView();
}
private void resetTransformedView() {
mTransformedView.setTranslationX(0);
mTransformedView.setTranslationY(0);
mTransformedView.setScaleX(1.0f);
mTransformedView.setScaleY(1.0f);
}
public static TransformState obtain() {