Hello everyone, recently I received feedback from a client, that the application that I built has a lot of bugs, so that users cannot fully use the application.
At first, I thought it only needed a slight adjustment to the mechanism for access permissions to storage, and after the storage-related bugs were fixed, it turned out that there were many more that were affected, one of which was related to UI rendering.
After I did a long investigation, I found that my ui parts were not working as they should, i.e. UI which was executed inside interface class callback and Recyclerview which was executed inside Fragment class.
I've been doing google fu for quite a while, but only found 1 solution for those 2 rendering problems.
UI Solution inside Callback
You need to wrap it using the following method
runOnUiThread {
// your ui code
}
Meanwhile, for the recyclerview case I found the solution independently by trial n error, this method is quite tricky, because I saw an anomaly in the recyclerview behavior, when I scrolled through the blank recyclerview, the data UI immediately appeared. Then that way I can do it programmatically.
Recyclerview Rendering Solution
//fixing bug rendering on sdk 33 | android 13 | teramisu
parentView.rvTopic.smoothScrollToPosition(0)
Good luck!