package com.codigoparallevar.minicards; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.util.Log; import android.view.View; import com.codigoparallevar.minicards.parts.Part; import com.codigoparallevar.minicards.parts.Placeholder; import com.codigoparallevar.minicards.parts.buttons.RoundButton; import java.util.LinkedList; import java.util.List; class DrawView extends View { Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); List parts = new LinkedList<>(); public DrawView(Context context) { super(context); paint.setColor(Color.RED); parts.add(new RoundButton(500, 1200, 80, 100)); } @Override public void onDraw(Canvas canvas){ long time = System.currentTimeMillis(); for (Part part : parts){ part.draw(canvas); } Log.d("Render time", System.currentTimeMillis() - time + "ms"); } }