question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fadeIn blinks when entering

See original GitHub issue

I’m using a tween AnimationSpec so that I can slow the transition down to highlight the problem, but it also occurs with the other AnimationSpecs. The other EnterTransitions work fine (slideIn, etc…).

test

(The GIF has some artifacting from ffmpeg)

fun main() {
  val visible = mutableStateOf(true)

  GlobalScope.launch {
    while(true) {
      delay(2500)
      visible.value = false
      delay(2500)
      visible.value = true
    }
  }

  Window(
      title = "Test"
  ) {
    MaterialTheme {
      Box(
          modifier = Modifier.fillMaxSize()
      ) {
        Test(visible)
      }
    }
  }
}

@ExperimentalAnimationApi
@Composable
fun Test(visible: State<Boolean>) {
  AnimatedVisibility(
      visible = visible.value,
      initiallyVisible = !visible.value,
      enter = fadeIn(
          animationSpec = tween(durationMillis = 1500)
      ),
      exit = fadeOut(
          animationSpec = tween(durationMillis = 1500)
      )
  ) {
    Surface(
        modifier = Modifier.fillMaxSize()
    ) {
      Text(
          "Test",
          modifier = Modifier.fillMaxSize(),
          textAlign = TextAlign.Center
      )
    }
  }
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

0reactions
akurasovcommented, Sep 17, 2021

Retested on MacOs. Works fine. Closing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to stop fadeIn() blinking? - jquery
Currently I have a simple div that I want to have fade in on mouseover of another div, but it would blink 3...
Read more >
Fade in animation seems to be causing a blinking effect at ...
When you first load the page in Chrome, the hero content flashes. It shows then disappears and then fades in. The effect should...
Read more >
Weird blinking in jQuery fade effect
I found a tutorial online, but when i change between the pages insted of having a nice fade effect, the page fades and...
Read more >
Blink text using jQuery
jQuery Practical Exercises with Solution: Blink text using jQuery. ... $('.blink').fadeIn(500); } setInterval(blink_text, 1000); ...
Read more >
How to Make Text Blink in JavaScript?
Make Text Blink in JavaScript · Smooth Blink text using CSS · Blink text using jQuery fadeout() & fadein() function · Blink text...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found