Skip to content

Commit afc392c

Browse files
pekingmehunterstich
authored andcommitted
[LoadingIndicator] Fixed the issue that animation doesn't resume when window becomes visible.
PiperOrigin-RevId: 698794935
1 parent bf2bc10 commit afc392c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/java/com/google/android/material/loadingindicator/LoadingIndicator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ protected void onVisibilityChanged(@NonNull View changedView, int visibility) {
137137
@Override
138138
protected void onWindowVisibilityChanged(int visibility) {
139139
super.onWindowVisibilityChanged(visibility);
140-
drawable.setVisible(visibleToUser(), /* restart= */ false, /* animate= */ false);
140+
drawable.setVisible(
141+
visibleToUser(), /* restart= */ false, /* animate= */ visibility == VISIBLE);
141142
}
142143

143144
@Override

0 commit comments

Comments
 (0)