clean interface and code

This commit is contained in:
clement
2024-07-09 17:59:34 +02:00
parent 26c6061a8f
commit 116a2a5a4a
2 changed files with 0 additions and 44 deletions

View File

@@ -89,7 +89,6 @@ class MainActivity : ComponentActivity() {
map.overlays.add(marker)
map.invalidate()
busStopList.add(BusStop(marker))
Log.i("marker", busStopList.toString())
}
val removeMarkButton = findViewById<Button>(R.id.removeMark)
removeMarkButton.setOnClickListener{
@@ -102,16 +101,9 @@ class MainActivity : ComponentActivity() {
}
val saveMarkButton = findViewById<Button>(R.id.saveMark)
saveMarkButton.setOnClickListener{
val db = dbHelper.writableDatabase
var stringList: ArrayList<String> = ArrayList<String>()
busStopList.forEach {
val values = ContentValues().apply {
put(StopContract.StopEntry.LATITUDE, it.marker.position.latitude)
put(StopContract.StopEntry.LONGITUDE, it.marker.position.longitude)
put(StopContract.StopEntry.ORDER, busStopList.indexOf(it))
}
stringList.add(it.toString())
//val newRowId = db?.insert(StopContract.StopEntry.TABLE_NAME, null, values)
}
if(busStopList.size < 1){
val alert = AlertDialog.Builder(this).setTitle("Aucun point !").setMessage("Il faut au moins 1 point pour continuer !")
@@ -154,7 +146,6 @@ class MainActivity : ComponentActivity() {
val mapIntent = Intent(Intent.ACTION_VIEW, mapIntentUri)
mapIntent.setPackage("com.google.android.apps.maps")
startActivity(mapIntent)
}
val rotationGestureOverlay = RotationGestureOverlay(map)
@@ -181,13 +172,6 @@ class MainActivity : ComponentActivity() {
mapController.animateTo(GeoPoint(latitude, longitude))
findViewById<TextView>(R.id.accuracy).text = "${location.accuracy} %"
findViewById<TextView>(R.id.position).text = "$latitude $longitude"
findViewById<TextView>(R.id.speed).text = "${location.speed} m/s"
findViewById<TextView>(R.id.speed_accuracy).text =
"${location.speedAccuracyMetersPerSecond} %"
Log.i("Position", "$latitude $longitude")
Log.i("Accuracy Chosen", "${location.provider}")
}
}
locationOverlay.enableMyLocation()

View File

@@ -59,34 +59,6 @@
android:textColor="@color/black"
android:layout_height="wrap_content"
android:text=""/>
<TextView
android:id="@+id/position"
android:layout_width="150dp"
android:textColor="@color/black"
android:layout_height="wrap_content"
android:text=""/>
<TextView
android:layout_width="150dp"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:text="Speed"/>
<TextView
android:id="@+id/speed"
android:layout_width="150dp"
android:textColor="@color/black"
android:layout_height="wrap_content"
android:text=""/>
<TextView
android:layout_width="150dp"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:text="Speed Accuracy Meter Second"/>
<TextView
android:id="@+id/speed_accuracy"
android:layout_width="150dp"
android:textColor="@color/black"
android:layout_height="wrap_content"
android:text=""/>
</TableLayout>
<org.osmdroid.views.MapView