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
23dec42f
Commit
23dec42f
authored
Feb 16, 2024
by
Alutulu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
cc191e63
db649d67
Pipeline
#2723
failed with stages
Changes
1
Pipelines
1
Show 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 @
23dec42f
...
@@ -11,40 +11,17 @@ import android.hardware.SensorManager
...
@@ -11,40 +11,17 @@ import android.hardware.SensorManager
import
android.util.Log
import
android.util.Log
import
android.widget.EditText
import
android.widget.EditText
import
android.widget.LinearLayout
import
android.widget.LinearLayout
import
android.widget.TextView
import
androidx.appcompat.app.AppCompatActivity
class
galerie
:
Activity
(),
SensorEventListener
{
class
galerie
:
AppCompatActivity
()
{
private
var
mSensorManager
:
SensorManager
?
=
null
public
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
private
var
accelerometer
:
Sensor
?
=
null
private
var
V
:
EditText
?
=
null
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
super
.
onCreate
(
savedInstanceState
)
val
M1
=
LinearLayout
(
this
)
val
l1
=
LinearLayout
(
this
)
M1
.
orientation
=
LinearLayout
.
VERTICAL
l1
.
orientation
=
LinearLayout
.
VERTICAL
V
=
EditText
(
this
)
val
t1
=
TextView
(
this
)
val
C
=
EditText
(
this
)
t1
.
text
=
"Bienvenue sur 2!"
V
!!
.
setText
(
" "
)
l1
.
addView
(
t1
)
C
.
setText
(
"VITESSE"
)
setContentView
(
l1
)
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
())
}
}
}
}
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