Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ElBuenoPeso
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Matis SPINELLI
ElBuenoPeso
Commits
4acd6f2a
Commit
4acd6f2a
authored
Feb 16, 2024
by
Timothé KOBAK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
premiere page mais crash
parent
4e06a022
Pipeline
#2721
canceled with stages
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
141 additions
and
7 deletions
+141
-7
gradle.xml
.idea/gradle.xml
+1
-0
misc.xml
.idea/misc.xml
+0
-1
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+9
-3
MainActivity.kt
app/src/main/java/com/example/leboncoin/MainActivity.kt
+43
-3
ajout.kt
app/src/main/java/com/example/leboncoin/ajout.kt
+20
-0
galerie.kt
app/src/main/java/com/example/leboncoin/galerie.kt
+50
-0
activity_ajout1.xml
app/src/main/res/layout/activity_ajout1.xml
+9
-0
activity_test.xml
app/src/main/res/layout/activity_test.xml
+9
-0
No files found.
.idea/gradle.xml
View file @
4acd6f2a
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"GradleMigrationSettings"
migrationVersion=
"1"
/>
<component
name=
"GradleSettings"
>
<option
name=
"linkedExternalProjectsSettings"
>
<GradleProjectSettings>
...
...
.idea/misc.xml
View file @
4acd6f2a
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ExternalStorageConfigurationManager"
enabled=
"true"
/>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_17"
default=
"true"
project-jdk-name=
"jbr-17"
project-jdk-type=
"JavaSDK"
>
...
...
app/src/main/AndroidManifest.xml
View file @
4acd6f2a
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
>
xmlns:tools=
"http://schemas.android.com/tools"
>
<application
android:allowBackup=
"true"
...
...
@@ -11,10 +11,16 @@
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:theme=
"@style/Theme.LeBonCoin"
tools:targetApi=
"31"
>
tools:targetApi=
"31"
>
<activity
android:name=
".galerie"
android:exported=
"false"
/>
<activity
android:name=
".ajout"
android:exported=
"false"
/>
<activity
android:name=
".MainActivity"
android:exported=
"true"
>
android:exported=
"true"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
...
...
app/src/main/java/com/example/leboncoin/MainActivity.kt
View file @
4acd6f2a
package
com.example.leboncoin
import
android
x.appcompat.app.AppCompatActivity
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
()
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
public
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_main
)
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
app/src/main/java/com/example/leboncoin/ajout.kt
0 → 100644
View file @
4acd6f2a
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
)
}
}
app/src/main/java/com/example/leboncoin/galerie.kt
0 → 100644
View file @
4acd6f2a
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
class
galerie
:
Activity
(),
SensorEventListener
{
private
var
mSensorManager
:
SensorManager
?
=
null
private
var
accelerometer
:
Sensor
?
=
null
private
var
V
:
EditText
?
=
null
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
val
M1
=
LinearLayout
(
this
)
M1
.
orientation
=
LinearLayout
.
VERTICAL
V
=
EditText
(
this
)
val
C
=
EditText
(
this
)
V
!!
.
setText
(
" "
)
C
.
setText
(
"VITESSE"
)
M1
.
addView
(
C
)
M1
.
addView
(
V
)
setContentView
(
M1
)
mSensorManager
=
getSystemService
(
SENSOR_SERVICE
)
as
SensorManager
// on recupere l accelerometre a partir du SensorManager
accelerometer
=
mSensorManager
!!
.
getDefaultSensor
(
Sensor
.
TYPE_ACCELEROMETER
)
// on associe l ecouteur d’ evenements au SensorManager
mSensorManager
!!
.
registerListener
(
this
,
accelerometer
,
SensorManager
.
SENSOR_DELAY_NORMAL
)
}
override
fun
onAccuracyChanged
(
sensor
:
Sensor
,
accuracy
:
Int
)
{
// TODO Auto−generated method stub
}
override
fun
onSensorChanged
(
event
:
SensorEvent
)
{
// TODO Auto−generated method stub
val
gammaX
=
event
.
values
[
0
]
val
gammaY
=
event
.
values
[
1
]
val
gammaZ
=
event
.
values
[
2
]
Log
.
d
(
"Valeurs accelerometre"
,
"$gammaX,$gammaY,$gammaZ"
)
V
!!
.
setText
(
gammaX
.
toString
())
}
}
\ No newline at end of file
app/src/main/res/layout/activity_ajout1.xml
0 → 100644
View file @
4acd6f2a
<?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
app/src/main/res/layout/activity_test.xml
0 → 100644
View file @
4acd6f2a
<?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=
".test"
>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment