clean interface and code
This commit is contained in:
@@ -89,7 +89,6 @@ class MainActivity : ComponentActivity() {
|
|||||||
map.overlays.add(marker)
|
map.overlays.add(marker)
|
||||||
map.invalidate()
|
map.invalidate()
|
||||||
busStopList.add(BusStop(marker))
|
busStopList.add(BusStop(marker))
|
||||||
Log.i("marker", busStopList.toString())
|
|
||||||
}
|
}
|
||||||
val removeMarkButton = findViewById<Button>(R.id.removeMark)
|
val removeMarkButton = findViewById<Button>(R.id.removeMark)
|
||||||
removeMarkButton.setOnClickListener{
|
removeMarkButton.setOnClickListener{
|
||||||
@@ -102,16 +101,9 @@ class MainActivity : ComponentActivity() {
|
|||||||
}
|
}
|
||||||
val saveMarkButton = findViewById<Button>(R.id.saveMark)
|
val saveMarkButton = findViewById<Button>(R.id.saveMark)
|
||||||
saveMarkButton.setOnClickListener{
|
saveMarkButton.setOnClickListener{
|
||||||
val db = dbHelper.writableDatabase
|
|
||||||
var stringList: ArrayList<String> = ArrayList<String>()
|
var stringList: ArrayList<String> = ArrayList<String>()
|
||||||
busStopList.forEach {
|
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())
|
stringList.add(it.toString())
|
||||||
//val newRowId = db?.insert(StopContract.StopEntry.TABLE_NAME, null, values)
|
|
||||||
}
|
}
|
||||||
if(busStopList.size < 1){
|
if(busStopList.size < 1){
|
||||||
val alert = AlertDialog.Builder(this).setTitle("Aucun point !").setMessage("Il faut au moins 1 point pour continuer !")
|
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)
|
val mapIntent = Intent(Intent.ACTION_VIEW, mapIntentUri)
|
||||||
mapIntent.setPackage("com.google.android.apps.maps")
|
mapIntent.setPackage("com.google.android.apps.maps")
|
||||||
startActivity(mapIntent)
|
startActivity(mapIntent)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val rotationGestureOverlay = RotationGestureOverlay(map)
|
val rotationGestureOverlay = RotationGestureOverlay(map)
|
||||||
@@ -181,13 +172,6 @@ class MainActivity : ComponentActivity() {
|
|||||||
mapController.animateTo(GeoPoint(latitude, longitude))
|
mapController.animateTo(GeoPoint(latitude, longitude))
|
||||||
|
|
||||||
findViewById<TextView>(R.id.accuracy).text = "${location.accuracy} %"
|
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()
|
locationOverlay.enableMyLocation()
|
||||||
|
|||||||
@@ -59,34 +59,6 @@
|
|||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text=""/>
|
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>
|
</TableLayout>
|
||||||
<org.osmdroid.views.MapView
|
<org.osmdroid.views.MapView
|
||||||
|
|||||||
Reference in New Issue
Block a user