@@ -561,7 +561,7 @@ private fun RefreshHeader(
561561        horizontalAlignment =  Alignment .CenterHorizontally ,
562562        verticalArrangement =  Arrangement .Top 
563563    ) {
564-         val  rotation by animateRotation()
564+         val  rotation by animateRotation(pullToRefreshState.refreshState  ==   RefreshState . Refreshing )
565565        RefreshIndicator (
566566            modifier =  Modifier .height(heightInfo.first),
567567            pullToRefreshState =  pullToRefreshState,
@@ -633,17 +633,21 @@ private fun RefreshIndicator(
633633}
634634
635635@Composable
636- private  fun  animateRotation (): State <Float > {
637-     val  infiniteTransition =  rememberInfiniteTransition(label =  " rotationAnimation"  )
638-     return  infiniteTransition.animateFloat(
639-         initialValue =  0f ,
640-         targetValue =  360f ,
641-         animationSpec =  infiniteRepeatable(
642-             animation =  tween(800 , easing =  LinearEasing ),
643-             repeatMode =  RepeatMode .Restart 
644-         ),
645-         label =  " rotationValue" 
646-     )
636+ private  fun  animateRotation (isRefreshing :  Boolean ): State <Float > {
637+     return  if  (isRefreshing) {
638+         val  infiniteTransition =  rememberInfiniteTransition(label =  " rotationAnimation"  )
639+         infiniteTransition.animateFloat(
640+             initialValue =  0f ,
641+             targetValue =  360f ,
642+             animationSpec =  infiniteRepeatable(
643+                 animation =  tween(800 , easing =  LinearEasing ),
644+                 repeatMode =  RepeatMode .Restart 
645+             ),
646+             label =  " rotationValue" 
647+         )
648+     } else  {
649+         remember { mutableStateOf(0f ) }
650+     }
647651}
648652
649653private  fun  DrawScope.drawPullingIndicator (
0 commit comments