actually i want to perfom action after complete 1 segment and also get event for all complete segment from one screen
private void initDrawingTimer() {
drawingTimer = new DrawingTimer();
drawingTimer.setListener(new DrawingTimer.Listener() {
@Override
public void onTick(int currentTicks, int totalTicks) {
int segmentWidth = getSegmentWidth();
currentSegmentProgressInPx = currentTicks * segmentWidth / totalTicks;
if (totalTicks <= currentTicks) {
lastCompletedSegment++;
currentSegmentProgressInPx = 0;
}
invalidate();
}
});
I see in this condition i can write code for start next segment. for this i use eventbus and post event for start next segment in this condition. and also check if last completed segment and segment count equal that it means all segment of one screen are completed and in this condition post event for start next fragment .
if (totalTicks <= currentTicks) {
lastCompletedSegment++;
currentSegmentProgressInPx = 0;
}
but i found issue that this condition call not only one time but 2- 3 time .so my question is why its happen this condition becomes true means segment completed.but because 2-3 time this condition call - event also post for not one time and multiple time
so any suggestion for manage it?
hello...
actually i want to perfom action after complete 1 segment and also get event for all complete segment from one screen
I see in this condition i can write code for start next segment. for this i use eventbus and post event for start next segment in this condition. and also check if last completed segment and segment count equal that it means all segment of one screen are completed and in this condition post event for start next fragment .
if (totalTicks <= currentTicks) { lastCompletedSegment++; currentSegmentProgressInPx = 0; } but i found issue that this condition call not only one time but 2- 3 time .so my question is why its happen this condition becomes true means segment completed.but because 2-3 time this condition call - event also post for not one time and multiple time so any suggestion for manage it?