Commit f784b1f2 authored by m-spi's avatar m-spi

Reset Done

parent 132ef5d7
package com.example.leboncoin
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.example.leboncoin", appContext.packageName)
}
}
\ No newline at end of file
package com.example.leboncoin
import android.content.Intent
import android.os.Bundle
import android.widget.Button
import android.widget.EditText
import android.widget.LinearLayout
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
class MainActivity : AppCompatActivity() {
public override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val l1 = LinearLayout(this)
l1.orientation = LinearLayout.VERTICAL
val t1 = TextView(this)
t1.text = "Bienvenue sur LeBonCoin!"
l1.addView(t1)
val t = EditText(this)
val b = Button(this)
b.text = "Acceder à la galerie"
b.height = 200
b.setOnClickListener {
val lancementSecondeActivite = Intent(
this@MainActivity,
galerie::class.java
)
startActivity(lancementSecondeActivite)
}
val c = Button(this)
c.text = "Ajouter un truc"
c.height = 200
c.setOnClickListener {
val lancementTroisiemeActivite = Intent(
this@MainActivity,
ajout::class.java
)
startActivity(lancementTroisiemeActivite)
}
l1.addView(t)
l1.addView(b)
l1.addView(c)
setContentView(l1)
}
}
\ No newline at end of file
package com.example.leboncoin
import android.hardware.Sensor
import android.hardware.SensorManager
import android.os.Bundle
import android.widget.LinearLayout
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
class ajout : AppCompatActivity() {
public override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val l1 = LinearLayout(this)
l1.orientation = LinearLayout.VERTICAL
val t1 = TextView(this)
t1.text = "Bienvenue sur LeBonCoin!"
l1.addView(t1)
setContentView(l1)
}
}
package com.example.leboncoin
import android.os.Bundle
import android.app.Activity
import android.hardware.Sensor
import android.hardware.SensorEvent
import android.hardware.SensorEventListener
import android.hardware.SensorManager
import android.util.Log
import android.widget.EditText
import android.widget.LinearLayout
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
class galerie : AppCompatActivity() {
public override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val l1 = LinearLayout(this)
l1.orientation = LinearLayout.VERTICAL
val t1 = TextView(this)
t1.text = "Bienvenue sur 2!"
l1.addView(t1)
setContentView(l1)
}
}
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ajout1">
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
package com.example.leboncoin
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment