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
db649d67
Commit
db649d67
authored
Feb 16, 2024
by
Timothé KOBAK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
premiere page mais crash
parent
4acd6f2a
Pipeline
#2722
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
34 deletions
+11
-34
galerie.kt
app/src/main/java/com/example/leboncoin/galerie.kt
+11
-34
No files found.
app/src/main/java/com/example/leboncoin/galerie.kt
View file @
db649d67
...
...
@@ -11,40 +11,17 @@ 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
:
Activity
(),
SensorEventListener
{
private
var
mSensorManager
:
SensorManager
?
=
null
private
var
accelerometer
:
Sensor
?
=
null
private
var
V
:
EditText
?
=
null
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
class
galerie
:
AppCompatActivity
()
{
public
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
)
val
l1
=
LinearLayout
(
this
)
l1
.
orientation
=
LinearLayout
.
VERTICAL
val
t1
=
TextView
(
this
)
t1
.
text
=
"Bienvenue sur 2!"
l1
.
addView
(
t1
)
setContentView
(
l1
)
}
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
}
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