From 84bc26db6ab3f711456906b1e24086c536cba6d7 Mon Sep 17 00:00:00 2001 From: Patrick FELIX-VIMALARATNAM Date: Tue, 1 Apr 2025 21:36:46 +0200 Subject: [PATCH] Add DEV4.5/exo2_controle_2022 --- DEV4.5/exo2_controle_2022 | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 DEV4.5/exo2_controle_2022 diff --git a/DEV4.5/exo2_controle_2022 b/DEV4.5/exo2_controle_2022 new file mode 100644 index 0000000..56c93be --- /dev/null +++ b/DEV4.5/exo2_controle_2022 @@ -0,0 +1,38 @@ +Fichier CustomView.java + +package com.example.organisation; + +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.util.AttributeSet; +import android.view.View; + +public class CustomView extends View { + private Paint paint; + + public CustomView(Context context, AttributeSet attrs) { + super(context, attrs); + paint = new Paint(); + paint.setColor(0xFFFFBB33); // Couleur (255, 187, 51) + } + + @Override + protected void onDraw(Canvas canvas) { + super.onDraw(canvas); + canvas.drawRect(0, 0, getWidth(), getHeight(), paint); + } +} + +Modification de activity_main.xml +(Remplacez les View par CustomView) + + + + \ No newline at end of file