title: How to emit/collect with Kotlin flow while a condition is true
body: <p>I am learning about Kotlin Flows and am wondering how to deal with following scenario in Android:</p>
  <p>I have some event coming from my Fragment that will trigger a boolean value, which can be observed through a StateFlow. (The value is true while the user is pressing on the screen).</p>
  <p>While the user is pressing on the screen, there can be some input from the camera feed to an OCR processing pipeline. For each processing result, there should be a sound played, and also I want to collect the results of this processing pipelines from the time period, giving back a final result when the user lets go of the press.</p>
  <p>So approximately, the event flow is: user does a long press on the screen and holds the camera onto multiple things -&gt; he gets some results -&gt;  each result triggers some further UI event -&gt; user lets go -&gt; there is a final UI feedback event when all results are evaluated together</p>
  <p>Is there any nice way to do this with Kotlin Flows?</p>