Key solution : Traffic sign
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link].*;
import [Link];
import [Link];
public class MainActivity extends AppCompatActivity {
TrafficView tView;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
tView = new TrafficView(this);
setContentView(tView);
}
}
class TrafficView extends View
{ public TrafficView(Context context)
{ super(context); }
@Override
protected void onDraw (Canvas canvas)
{
[Link](canvas);
RectF oval1 = new RectF(100, 100, 350,350);
RectF oval2 = new RectF(100, 350, 350,600);
RectF oval3 = new RectF(100, 600, 350,850);
RectF rect1 = new RectF(50,50,400,900);
RectF rect2 = new RectF(200,900,250,1500);
Paint paint = new Paint();
[Link]([Link]);
Paint p1 = new Paint();
[Link]([Link]);
Paint p2 = new Paint();
[Link]([Link]);
Paint p3 = new Paint();
[Link]([Link]);
[Link]("Parent", 30, 50, p1);
[Link]("Parent", 30, 50, p2);
[Link]("Parent", 30, 50, p3);
[Link]("Parent", 30, 50, paint);
[Link](rect2, paint);
[Link](rect1, paint);
[Link](oval1, p1);
[Link](oval2, p2);
[Link](oval3, p3);
}
}