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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user