Deux bouttons qui ne s'affiche pas

navigation
Pierre BALLANDRAS 2 years ago
parent 6e85f74a67
commit 08c54d58ab

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<targetSelectedWithDropDown>
<Target>
<type value="QUICK_BOOT_TARGET" />
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="/local/avd/Nexus_6_API_33.avd" />
</Key>
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2023-03-17T16:17:39.647026Z" />
</component>
</project>

@ -2,9 +2,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-feature android:name="android.hardware.camera"
android:required="true" /> <!-- demande a l'utilisateur l'accés à la caméra, le require true permet de dire que la caméra est essentiel a l'appli-->
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"

@ -4,15 +4,25 @@ import android.content.Intent
import android.graphics.Bitmap
import android.os.Bundle
import android.os.PersistableBundle
import android.widget.Button
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) {
super.onCreate(savedInstanceState, persistentState)
throw Exception("La")
setContentView(R.layout.main_activity)
val game = findViewById<Button>(R.id.button)
game.setOnClickListener{
findViewById<TextView>(R.id.textView).text = "C'est bon"
}
}
// override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
// if (requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK) {
// val imageBitmap = data.extras.get("data") as Bitmap

@ -1,5 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent">
<LinearLayout
android:layout_width="409dp"
android:layout_height="729dp"
android:orientation="vertical"
android:gravity="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/buttonGame" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/buttonScore" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/test" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -1,3 +1,6 @@
<resources>
<string name="app_name">Pierre&amp;Pierre</string>
<string name="buttonGame">Jouer</string>
<string name="buttonScore">Score</string>
<string name="test">Test</string>
</resources>
Loading…
Cancel
Save