diff --git a/Controle_Blanc/EX01_Tabulation/.gitignore b/Controle_Blanc/EX01_Tabulation/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/Controle_Blanc/EX01_Tabulation/.idea/.gitignore b/Controle_Blanc/EX01_Tabulation/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/Controle_Blanc/EX01_Tabulation/.idea/.name b/Controle_Blanc/EX01_Tabulation/.idea/.name new file mode 100644 index 0000000..371c86d --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/.idea/.name @@ -0,0 +1 @@ +Tabulation \ No newline at end of file diff --git a/Controle_Blanc/EX01_Tabulation/.idea/compiler.xml b/Controle_Blanc/EX01_Tabulation/.idea/compiler.xml new file mode 100644 index 0000000..b589d56 --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Controle_Blanc/EX01_Tabulation/.idea/deploymentTargetDropDown.xml b/Controle_Blanc/EX01_Tabulation/.idea/deploymentTargetDropDown.xml new file mode 100644 index 0000000..baa765f --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/.idea/deploymentTargetDropDown.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Controle_Blanc/EX01_Tabulation/.idea/gradle.xml b/Controle_Blanc/EX01_Tabulation/.idea/gradle.xml new file mode 100644 index 0000000..0897082 --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/Controle_Blanc/EX01_Tabulation/.idea/migrations.xml b/Controle_Blanc/EX01_Tabulation/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/Controle_Blanc/EX01_Tabulation/.idea/misc.xml b/Controle_Blanc/EX01_Tabulation/.idea/misc.xml new file mode 100644 index 0000000..8978d23 --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/Controle_Blanc/EX01_Tabulation/.idea/vcs.xml b/Controle_Blanc/EX01_Tabulation/.idea/vcs.xml new file mode 100644 index 0000000..b2bdec2 --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Controle_Blanc/EX01_Tabulation/app/.gitignore b/Controle_Blanc/EX01_Tabulation/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/Controle_Blanc/EX01_Tabulation/app/build.gradle.kts b/Controle_Blanc/EX01_Tabulation/app/build.gradle.kts new file mode 100644 index 0000000..2b69354 --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/app/build.gradle.kts @@ -0,0 +1,40 @@ +plugins { + alias(libs.plugins.androidApplication) +} + +android { + namespace = "com.example.tabulation" + compileSdk = 34 + + defaultConfig { + applicationId = "com.example.tabulation" + minSdk = 19 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation(libs.appcompat) + implementation(libs.material) + implementation(libs.activity) + implementation(libs.constraintlayout) + testImplementation(libs.junit) + androidTestImplementation(libs.ext.junit) + androidTestImplementation(libs.espresso.core) +} \ No newline at end of file diff --git a/Controle_Blanc/EX01_Tabulation/app/proguard-rules.pro b/Controle_Blanc/EX01_Tabulation/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/Controle_Blanc/EX01_Tabulation/app/src/androidTest/java/com/example/tabulation/ExampleInstrumentedTest.java b/Controle_Blanc/EX01_Tabulation/app/src/androidTest/java/com/example/tabulation/ExampleInstrumentedTest.java new file mode 100644 index 0000000..3680b74 --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/app/src/androidTest/java/com/example/tabulation/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.tabulation; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("com.example.tabulation", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/AndroidManifest.xml b/Controle_Blanc/EX01_Tabulation/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..f6240dd --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/app/src/main/AndroidManifest.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/java/com/example/tabulation/Carre.java b/Controle_Blanc/EX01_Tabulation/app/src/main/java/com/example/tabulation/Carre.java new file mode 100644 index 0000000..51cc0ac --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/app/src/main/java/com/example/tabulation/Carre.java @@ -0,0 +1,25 @@ +package com.example.tabulation; + +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.util.AttributeSet; +import android.view.View; + +public class Carre extends View { + + private Paint pinceau; + + public Carre(Context context, AttributeSet attrs) { + super(context, attrs); + this.pinceau = new Paint(); + } + + @Override + protected void onDraw(Canvas canvas) { + super.onDraw(canvas); + + this.pinceau.setColor(0x77000000); + canvas.drawRect(getPaddingLeft(), getPaddingTop(), getWidth() - getPaddingRight(), getHeight() - getPaddingBottom(), this.pinceau); + } +} diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/java/com/example/tabulation/MainActivity.java b/Controle_Blanc/EX01_Tabulation/app/src/main/java/com/example/tabulation/MainActivity.java new file mode 100644 index 0000000..af001e7 --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/app/src/main/java/com/example/tabulation/MainActivity.java @@ -0,0 +1,28 @@ +package com.example.tabulation; + +import android.os.Bundle; +import android.view.View; +import android.widget.TextView; + +import androidx.activity.EdgeToEdge; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.graphics.Insets; +import androidx.core.view.ViewCompat; +import androidx.core.view.WindowInsetsCompat; + +public class MainActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + EdgeToEdge.enable(this); + //setContentView(R.layout.activity_main); + //setContentView(R.layout.q2c); + + setContentView(R.layout.q3c); + View couleur = findViewById(R.id.couleur); + TextView rouge = findViewById(R.id.rouge); + TextView vert = findViewById(R.id.vert); + TextView bleu = findViewById(R.id.bleu); + } +} \ No newline at end of file diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/java/com/example/tabulation/Q3.java b/Controle_Blanc/EX01_Tabulation/app/src/main/java/com/example/tabulation/Q3.java new file mode 100644 index 0000000..148e3fd --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/app/src/main/java/com/example/tabulation/Q3.java @@ -0,0 +1,54 @@ +package com.example.tabulation; + +import android.util.Log; +import android.view.KeyEvent; +import android.view.View; +import android.widget.TextView; + +public class Q3 implements TextView.OnEditorActionListener { + + private final TextView rouge; + private final TextView vert; + private final TextView bleu; + private String ancienRouge; + private String ancienVert; + private String ancienBleu; + + public Q3(View couleur, TextView rouge, TextView vert, TextView bleu){ + this.couleur = couleur; + this.rouge = rouge; + this.vert = vert; + this.bleu = bleu; + this.ancienRouge = (String) rouge.getText(); + this.ancienVert = (String) vert.getText(); + this.ancienBleu = (String) bleu.getText(); + } + + @Override + public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) { + Log.v("test","entrer"); + TextView source = (TextView) textView; + String texteSource = String.valueOf(source.getText()); + if (source.getId() == this.degreC.getId()){ + degreF.setText(Evenement.convertionCToF(texteSource)); + return true; + } + if (source.getId() == this.degreF.getId()){ + degreC.setText(Evenement.convertionFToC(texteSource)); + return true; + } + return false; + } + + private static String convertionCToF(String c){ + double cDouble = Double.parseDouble(c); + double fDouble = cDouble*9d/5d + 32d; + return fDouble+""; + } + + private static String convertionFToC(String f){ + double fDouble = Double.parseDouble(f); + double cDouble = ((fDouble-32d)*5d)/9d; + return cDouble+""; + } +} diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/java/com/example/tabulation/Q3ChangerCouleur.java b/Controle_Blanc/EX01_Tabulation/app/src/main/java/com/example/tabulation/Q3ChangerCouleur.java new file mode 100644 index 0000000..8f1d930 --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/app/src/main/java/com/example/tabulation/Q3ChangerCouleur.java @@ -0,0 +1,20 @@ +package com.example.tabulation; + +import android.graphics.Color; +import android.view.View; + +public class Q3ChangerCouleur { + private final View couleur; + private int rouge; + private int vert; + private int bleu; + + public Q3ChangerCouleur(View couleur){ + this.couleur = couleur; + } + + private void updateColor() { + int color = Color.rgb(this.rouge, this.vert, this.bleu); + this.couleur.setBackgroundColor(color); + } +} diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Controle_Blanc/EX01_Tabulation/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/res/drawable/ic_launcher_background.xml b/Controle_Blanc/EX01_Tabulation/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/res/layout/activity_main.xml b/Controle_Blanc/EX01_Tabulation/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..658ca94 --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/res/layout/q2c.xml b/Controle_Blanc/EX01_Tabulation/app/src/main/res/layout/q2c.xml new file mode 100644 index 0000000..20c049e --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/app/src/main/res/layout/q2c.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/res/layout/q3c.xml b/Controle_Blanc/EX01_Tabulation/app/src/main/res/layout/q3c.xml new file mode 100644 index 0000000..40309af --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/app/src/main/res/layout/q3c.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/Controle_Blanc/EX01_Tabulation/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/res/values-night/themes.xml b/Controle_Blanc/EX01_Tabulation/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..7db752d --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/app/src/main/res/values-night/themes.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/res/values/colors.xml b/Controle_Blanc/EX01_Tabulation/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..c8524cd --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/app/src/main/res/values/colors.xml @@ -0,0 +1,5 @@ + + + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/res/values/strings.xml b/Controle_Blanc/EX01_Tabulation/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..b56ba9f --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + Tabulation + \ No newline at end of file diff --git a/Controle_Blanc/EX01_Tabulation/app/src/main/res/values/themes.xml b/Controle_Blanc/EX01_Tabulation/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..3590c44 --- /dev/null +++ b/Controle_Blanc/EX01_Tabulation/app/src/main/res/values/themes.xml @@ -0,0 +1,9 @@ + + + + +