Add button for testing Google Maps
This commit is contained in:
2
.idea/deploymentTargetSelector.xml
generated
2
.idea/deploymentTargetSelector.xml
generated
@@ -4,7 +4,7 @@
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
<DropdownSelection timestamp="2024-06-20T09:28:45.422751100Z">
|
||||
<DropdownSelection timestamp="2024-06-22T18:56:13.559252900Z">
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="PhysicalDevice" identifier="serial=y5v4t4fiif555tnb" />
|
||||
|
||||
@@ -2,9 +2,11 @@ package com.example.busroute
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.location.Location
|
||||
import android.location.LocationManager
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.os.Looper
|
||||
import android.preference.PreferenceManager
|
||||
@@ -74,6 +76,14 @@ class MainActivity : ComponentActivity() {
|
||||
map.overlays.add(marker)
|
||||
map.invalidate()
|
||||
}
|
||||
val mapsButton = findViewById<Button>(R.id.maps)
|
||||
mapsButton.setOnClickListener{
|
||||
val mapIntentUri =
|
||||
Uri.parse("google.navigation:q=Moutier,+France&waypoints=Cevins%7CAigueblanche")
|
||||
val mapIntent = Intent(Intent.ACTION_VIEW, mapIntentUri)
|
||||
mapIntent.setPackage("com.google.android.apps.maps")
|
||||
startActivity(mapIntent)
|
||||
}
|
||||
|
||||
val rotationGestureOverlay = RotationGestureOverlay(map)
|
||||
rotationGestureOverlay.isEnabled
|
||||
|
||||
@@ -6,22 +6,30 @@
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<RelativeLayout tools:ignore="UselessParent">
|
||||
<Button
|
||||
android:id="@+id/addMark"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="50dp"
|
||||
android:backgroundTint="@color/white"
|
||||
android:textColor="@color/black"
|
||||
android:clickable="true"
|
||||
android:text="Add marker" />
|
||||
<TableLayout
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="55dp"
|
||||
android:background="@color/white"
|
||||
android:elevation="500dp">
|
||||
<Button
|
||||
android:id="@+id/addMark"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/white"
|
||||
android:focusable="true"
|
||||
android:textColor="@color/black"
|
||||
android:clickable="true"
|
||||
android:text="Add marker" />
|
||||
<Button
|
||||
android:id="@+id/maps"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/white"
|
||||
android:focusable="true"
|
||||
android:textColor="@color/black"
|
||||
android:clickable="true"
|
||||
android:text="Test Google Maps" />
|
||||
<TextView
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
Reference in New Issue
Block a user