If a view is already scheduled to be repainted, any additional calls to scheduleRepaint() will be ignored. This causes this code sequence behave unexpected:
textlbl.setText("My new text");
bgView.scheduleRepaint();
textLbl.scheduleRepaint();
The first setText command will insert the TextLabelView into the dirty queue to schedule repaint in the future. When scheduleRepaint is called on the background view (bgView), this view is appended to the queue. The last call to textLbl have no effect, since the display system ignores it.
Solution
scheduleRepaint should not ignore the request if the view already exists in the dirty queue. It should instead move the view to the end of the queue. This will ensure the view painted as the last, thereby rendering it visible.
If a view is already scheduled to be repainted, any additional calls to
scheduleRepaint()will be ignored. This causes this code sequence behave unexpected:textlbl.setText("My new text"); bgView.scheduleRepaint(); textLbl.scheduleRepaint();The first
setTextcommand will insert theTextLabelViewinto the dirty queue to schedule repaint in the future. WhenscheduleRepaintis called on the background view (bgView), this view is appended to the queue. The last call totextLblhave no effect, since the display system ignores it.Solution
scheduleRepaintshould not ignore the request if the view already exists in the dirty queue. It should instead move the view to the end of the queue. This will ensure the view painted as the last, thereby rendering it visible.