android - How to update a view in every specific time of frame -
currently using recursive invalidate() calls , don't know if code run at fixed rate in every phone. below can see code here. handler approach better , reliable one? how can make view update speed fixed in every phone?
@override protected void ondraw(canvas canvas) { super.ondraw(canvas); if(action){ checkcollisiondetection(); rotateangle = rotatereverse ? rotateangle - levelrotatespeeds[level-1] : rotateangle + levelrotatespeeds[level-1]; canvas.rotate(rotateangle,coordinateutils.centerx,coordinateutils.centery); invalidate(); //this recursive approach }else canvas.rotate(rotateangle,coordinateutils.centerx,coordinateutils.centery); canvas.drawroundrect(rect,markerroundsize,markerroundsize,paint);
}
Comments
Post a Comment