android - Best way to adjust multiple displayed values and send to external device - Stack Overflow

We have coded an AndroidKotlin application that can display and transmit multiple independently adjust

We have coded an Android/Kotlin application that can display and transmit multiple independently adjustable values on one Android screen. This is done by calling one function for each independently adjustable value which both uses "remember" and "mutableIntStateOf".

Because everything is in one function the coding pattern appears unstructured. We would like to correct this by splitting the current coding pattern into different functions. One for setting the value and another for sending the value to an externally connected device.

However, we have found it difficult to send the set value. Specifically, we have found it difficult to make the newest value in the setting function appear in the sending function.

We are considering using emit in the setting function to update a 3rd function which collects the newest values. Further, we are considering the sending function to stop any sending. But rather emit which value to send to this 3rd function which will then send the data to the externally connected device.

It is this last step we are currently working on. We have been unsuccessful so far. And the code is looking overly complex. So, at this point, I am asking this question to determine if our approach is reasonable. Or if Kotlin offers other more succinct ways to reach our goals.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744310210a4567910.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信