android-DecoView-charting icon indicating copy to clipboard operation
android-DecoView-charting copied to clipboard

Bug refreshing UI

Open severinewillez opened this issue 6 years ago • 0 comments

Hello, what is the best way to update the series positions manually? I have to update them very regularly but the bars series stop very quickly to move forward (Screen seems blocked). Should not we stop one event before starting another? Here is the code that creates the events, this method is called every second between 50 and 100 times.

`override fun updateGetCount(progress: Int, total: Int, percent: Float) {

    Timber.i("SyncService: $progress : $percent %")
    mPercent = percent.toInt()

    if (total != 0) {
        when {
            percent <= 15 -> {
                mArcView.addEvent(DecoEvent.Builder(percent).setIndex(mSeries1Index).setDuration(1).build())
                mArcView.addEvent(DecoEvent.Builder(percent).setIndex(mSeries2Index).setDuration(1).build())
                mArcView.addEvent(DecoEvent.Builder(percent).setIndex(mSeries3Index).setDuration(1).build())
                mArcView.addEvent(DecoEvent.Builder(percent).setIndex(mSeries4Index).setDuration(1).build())
            }
            percent <= 25 -> {
                mArcView.addEvent(DecoEvent.Builder(percent).setIndex(mSeries2Index).setDuration(1).build())
                mArcView.addEvent(DecoEvent.Builder(percent).setIndex(mSeries3Index).setDuration(1).build())
                mArcView.addEvent(DecoEvent.Builder(percent).setIndex(mSeries4Index).setDuration(1).build())
            }
            percent <= 70 -> {
                mArcView.addEvent(DecoEvent.Builder(percent).setIndex(mSeries3Index).setDuration(1).build())
                mArcView.addEvent(DecoEvent.Builder(percent).setIndex(mSeries4Index).setDuration(1).build())
            }
            else -> {
                mArcView.addEvent(DecoEvent.Builder(percent).setIndex(mSeries4Index).setDuration(1).build())
            }
        }
    }
}`

severinewillez avatar Jun 28 '18 12:06 severinewillez