private MilestoneManager getHalfKilometerManager ( ) { final Path arrowPath = new Path ( ) ; // a simple arrow towards the right arrowPath . moveTo ( - 5 , - 5 ) ; arrowPath . lineTo ( 5 , 0 ) ; arrowPath . lineTo ( - 5 , 5 ) ; arrowPath . close ( ) ; final Paint backgroundPaint = getFillPaint ( COLOR_BACKGROUND ) ; return new MilestoneManager ( // display an arrow at 500m every 1km new MilestoneMeterDistanceLister ( 500 ) , new MilestonePathDisplayer ( 0 , true , arrowPath , backgroundPaint ) { @ Override protected void draw ( final Canvas pCanvas , final Object pParameter ) { final int halfKilometers = ( int ) Math . round ( ( ( double ) pParameter / 500 ) ) ; if ( halfKilometers % 2 == 0 ) { return ; } super . draw ( pCanvas , pParameter ) ; } } ) ; }
Half - kilometer milestones