Skip to content
Snippets Groups Projects
Commit c1e9cd33 authored by benjamin.sitbon's avatar benjamin.sitbon
Browse files

rendu

parent 17845d52
No related branches found
No related tags found
No related merge requests found
Showing
with 777 additions and 0 deletions
package com.example.randotracker.database
import androidx.room.Entity
import androidx.room.PrimaryKey
import com.example.randotracker.service.Polyline
@Entity(tableName = "rando_table")
data class RandoTable(
var title:String,
var distanceInMeters: Int = 0,
var timeInMillis: Long = 0L,
var index: Int
) {
@PrimaryKey(autoGenerate = true)
var id: Int? = null
}
package com.example.randotracker.database
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import androidx.room.TypeConverter
import com.example.randotracker.service.Polyline
import com.google.android.gms.maps.model.LatLng
class Converters {
@TypeConverter
fun toPolyline(listLocation:String): MutableList<LatLng>{
var poly: MutableList<LatLng> = mutableListOf()
var list = listLocation.split(" ")
var count: Boolean = true
var lat:Double = 0.0
var long:Double = 0.0
for(location in list){
if(count){
lat = location.toDouble()
count = false
}
else{
long = location.toDouble()
poly.add(LatLng(lat,long))
count = true
}
}
return poly
}
@TypeConverter
fun fromPolyline(poly:List<LatLng>): String {
var ret : String = ""
for(location in poly){
ret += location.latitude.toString()
ret += " "
ret += location.longitude.toString()
}
return ret
}
}
\ No newline at end of file
package com.example.randotracker.dialog
import android.app.AlertDialog
import android.app.Dialog
import android.content.Context
import android.content.DialogInterface
import android.graphics.Bitmap
import android.graphics.Canvas
import android.os.Bundle
import android.util.Log
import android.view.View
import android.widget.EditText
import android.widget.LinearLayout
import androidx.core.content.ContextCompat
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.Fragment
import com.example.randotracker.R
import com.google.android.gms.maps.GoogleMap
import com.google.android.gms.maps.MapFragment
import com.google.android.gms.maps.model.BitmapDescriptor
import com.google.android.gms.maps.model.BitmapDescriptorFactory
import com.google.android.gms.maps.model.LatLng
import com.google.android.gms.maps.model.MarkerOptions
import com.example.randotracker.fragments.MapFragment.Companion.mapa
import com.example.randotracker.fragments.MapFragment.Companion.markerPos
class markerDialog: DialogFragment() {
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
return activity?.let {
val builder = AlertDialog.Builder(it)
val inflater = requireActivity().layoutInflater;
val inf = inflater.inflate(R.layout.add_marker_dialog,null)
builder.setView(inf)
.setPositiveButton("Ajouter",
DialogInterface.OnClickListener { dialog, id ->
val title = inf.findViewById<EditText>(R.id.marker_title)
markerPos?.let { pos -> mapa?.let { map -> setMarker(map, pos,title.text.toString()) } }
})
.setNegativeButton("Annuler",
DialogInterface.OnClickListener { dialog, id ->
getDialog()?.cancel()
})
builder.create()
} ?: throw IllegalStateException("Activity cannot be null")
}
private fun setMarker(map :GoogleMap,pos:LatLng,title:String){
map.addMarker(MarkerOptions()
.position(pos)
.title(title)
.icon(bitmapDescriptorFromVector(activity, R.drawable.marker)))
}
private fun bitmapDescriptorFromVector(context: Context?, vectorResId: Int): BitmapDescriptor {
val vectorDrawable = ContextCompat.getDrawable(requireContext(), vectorResId)
vectorDrawable!!.setBounds(0, 0, vectorDrawable.intrinsicWidth, vectorDrawable.intrinsicHeight)
val bitmap = Bitmap.createBitmap(vectorDrawable.intrinsicWidth, vectorDrawable.intrinsicHeight, Bitmap.Config.ARGB_8888)
val canvas = Canvas(bitmap)
vectorDrawable.draw(canvas)
return BitmapDescriptorFactory.fromBitmap(bitmap)
}
}
\ No newline at end of file
package com.example.randotracker.dialog
import android.app.AlertDialog
import android.app.Dialog
import android.content.DialogInterface
import android.os.Bundle
import android.widget.EditText
import androidx.fragment.app.DialogFragment
import com.example.randotracker.R
import com.example.randotracker.fragments.MapFragment.Companion.isSaved
import com.example.randotracker.fragments.MapFragment.Companion.title
class saveDialog: DialogFragment() {
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
return activity?.let {
val builder = AlertDialog.Builder(it)
val inflater = requireActivity().layoutInflater;
val inf = inflater.inflate(R.layout.save,null)
builder.setView(inf)
.setPositiveButton("Sauver",
DialogInterface.OnClickListener { dialog, id ->
val mytitle = inf.findViewById<EditText>(R.id.save_name)
title = mytitle.text.toString()
isSaved = true
})
.setNegativeButton("Annuler",
DialogInterface.OnClickListener { dialog, id ->
isSaved = false
getDialog()?.cancel()
})
builder.create()
} ?: throw IllegalStateException("Activity cannot be null")
}
}
\ No newline at end of file
package com.example.randotracker.fragments
import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.example.randotracker.R
import com.google.android.gms.maps.CameraUpdateFactory
import com.google.android.gms.maps.GoogleMap
import com.google.android.gms.maps.SupportMapFragment
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.Color
import android.os.Build
import android.widget.Button
import androidx.annotation.RequiresApi
import androidx.core.content.ContextCompat
import androidx.lifecycle.Observer
import com.example.randotracker.Constants.ACTION_START_OR_RESUME_SERVICE
import com.example.randotracker.Constants.ACTION_STOP_SERVICE
import com.example.randotracker.dialog.markerDialog
import com.google.android.gms.maps.model.*
import com.example.randotracker.service.NavigationService
import com.example.randotracker.service.NavigationService.Companion.pathPoints
import com.example.randotracker.service.NavigationService.Companion.runNumber
import com.example.randotracker.database.RandoTable
import com.example.randotracker.RandoViewModel
import androidx.fragment.app.viewModels
import androidx.room.InvalidationTracker
import com.example.randotracker.dialog.saveDialog
import dagger.hilt.android.AndroidEntryPoint
@AndroidEntryPoint
class MapFragment : Fragment() {
private var poly: Polyline? = null
private val Db : RandoViewModel by viewModels()
private var ob = Observer<LatLng> {}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}
companion object{
var isSaved = false
var title = ""
var mapa : GoogleMap? = null
var markerPos: LatLng? = null
var mark: Marker? = null
}
@RequiresApi(Build.VERSION_CODES.M)
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
// Inflate the layout for this fragment
val rootView = inflater.inflate(R.layout.fragment_map, container, false)
val mapFragment = childFragmentManager.findFragmentById(R.id.map_frag) as SupportMapFragment?
mapFragment!!.getMapAsync { mMap ->
mapa = mMap
mMap.mapType = GoogleMap.MAP_TYPE_NORMAL
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(LatLng(46.207,6.14234),16.0F))
mMap.clear() //clear old markers
mMap.setOnMapLongClickListener {
markerPos = it
markerDialog().show(childFragmentManager,"oui")
}
NavigationService.latlong.observe(viewLifecycleOwner, Observer {
mark?.remove()
poly?.remove()
mMap.animateCamera(CameraUpdateFactory.newLatLng(it))
mark = mMap.addMarker(MarkerOptions().position(it).title("You").icon(bitmapDescriptorFromVector(activity, R.drawable.walk_black)))
poly = drawRando()
})
}
return rootView
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
requireActivity().findViewById<Button>(R.id.stop_button).visibility = View.INVISIBLE
requireActivity().findViewById<Button>(R.id.start_button).setOnClickListener {
requireActivity().findViewById<Button>(R.id.stop_button).visibility = View.VISIBLE
it.visibility = View.INVISIBLE
NavigationService.isTracking.postValue(true)
NavigationService.isFirstRun = true
sendCommandToService(ACTION_START_OR_RESUME_SERVICE)
}
requireActivity().findViewById<Button>(R.id.stop_button).setOnClickListener {
requireActivity().findViewById<Button>(R.id.start_button).visibility = View.VISIBLE
requireActivity().findViewById<Button>(R.id.stop_button).visibility = View.INVISIBLE
NavigationService.isTracking.postValue(false)
NavigationService.isFirstRun = false
sendCommandToService(ACTION_STOP_SERVICE)
requireActivity().stopService(Intent(requireActivity(),NavigationService::class.java))
poly?.remove()
saveDialog().show(childFragmentManager,"oui")
if(isSaved){
Db.insertRando(RandoTable(title,1,1, NavigationService.runNumber))
}
NavigationService.latlong.removeObservers(viewLifecycleOwner)
}
}
private fun drawRando(): Polyline? {
val polylineOptions = PolylineOptions()
.color(Color.RED)
.width(10.0F)
for (location in pathPoints.value?.get(runNumber)!!){
polylineOptions.add(location)
}
return mapa?.addPolyline(polylineOptions)
}
private fun sendCommandToService(action:String) = Intent(requireContext(),NavigationService::class.java).also {
it.action = action
requireContext().startService(it)
}
private fun bitmapDescriptorFromVector(context: Context?, vectorResId: Int): BitmapDescriptor {
val vectorDrawable = ContextCompat.getDrawable(requireContext(), vectorResId)
vectorDrawable!!.setBounds(0, 0, vectorDrawable.intrinsicWidth, vectorDrawable.intrinsicHeight)
val bitmap = Bitmap.createBitmap(vectorDrawable.intrinsicWidth, vectorDrawable.intrinsicHeight, Bitmap.Config.ARGB_8888)
val canvas = Canvas(bitmap)
vectorDrawable.draw(canvas)
return BitmapDescriptorFactory.fromBitmap(bitmap)
}
}
\ No newline at end of file
package com.example.randotracker.fragments
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.example.randotracker.Data
import com.example.randotracker.R
import com.example.randotracker.adapter.RandoAdapter
import com.example.randotracker.database.RandoTable
import com.example.randotracker.service.NavigationService
import dagger.hilt.android.AndroidEntryPoint
@AndroidEntryPoint
class Randon : Fragment() {
private lateinit var randoAdapter: RandoAdapter
//private val Db : RandoViewModel by viewModels()
var itemList :ArrayList<Data> = arrayListOf()
private fun setupRecyclerView() {
var recyclerViewRandos:RecyclerView = requireActivity().findViewById(R.id.recyclerViewRandos)
recyclerViewRandos.apply{
randoAdapter = RandoAdapter(itemList)
adapter = randoAdapter
layoutManager = LinearLayoutManager(requireContext())
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_randon, container, false)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
NavigationService.isTracking.observe(viewLifecycleOwner, Observer {
if(!it){
Data("oui",NavigationService.stop_time -NavigationService.stop_time,0)
}
})
setupRecyclerView()
}
}
\ No newline at end of file
package com.example.randotracker.service
import android.annotation.SuppressLint
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.NotificationManager.IMPORTANCE_LOW
import android.app.PendingIntent
import android.app.PendingIntent.FLAG_UPDATE_CURRENT
import android.content.Intent
import android.content.pm.PackageManager
import android.location.Location
import android.os.Build
import android.os.IBinder
import android.os.Looper
import android.util.Log
import androidx.annotation.RequiresApi
import androidx.core.app.NotificationCompat
import androidx.core.content.ContextCompat
import androidx.lifecycle.LifecycleService
import androidx.lifecycle.MutableLiveData
import com.example.randotracker.Constants.LOCATION_UPDATE_INTERVAL
import com.example.randotracker.Constants.NOTIFICATION_CHANNEL_ID
import com.example.randotracker.Constants.NOTIFICATION_ID
import com.example.randotracker.Constants.NOTIFICATION_CHANNEL_NAME
import com.example.randotracker.Constants.SHORTEST_UPDATE_INTERVAL
import com.example.randotracker.R
import com.example.randotracker.Randonne
import com.google.android.gms.location.FusedLocationProviderClient
import com.google.android.gms.location.LocationCallback
import com.google.android.gms.location.LocationResult
import com.google.android.gms.maps.model.LatLng
import com.google.android.gms.location.LocationRequest
import com.google.android.gms.location.LocationRequest.PRIORITY_HIGH_ACCURACY
typealias Polyline = MutableList<LatLng>
typealias Polylines = MutableList<Polyline>
class NavigationService : LifecycleService() {
lateinit var fusedLocationProviderClient: FusedLocationProviderClient
var isBegin = false
companion object{
var isFirstRun = true
var runNumber = 0
var start_time:Long = 0L
var stop_time:Long = 0L
var dist:Int = 0
var latlong = MutableLiveData<LatLng>()
val isTracking = MutableLiveData<Boolean>()
val pathPoints = MutableLiveData<Polylines>()
}
override fun onCreate() {
super.onCreate()
postInitValues()
fusedLocationProviderClient = FusedLocationProviderClient(this)
isTracking.observe(this, androidx.lifecycle.Observer {
updateLocationTracking(it)
})
}
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
super.onStartCommand(intent, flags, startId)
if(isFirstRun){
startForegroundService()
isFirstRun = false
}
return START_STICKY
}
override fun onBind(intent: Intent): IBinder? {
super.onBind(intent)
return null
}
override fun onDestroy() {
super.onDestroy()
isBegin = false
Log.d("Points", pathPoints.value.toString())
}
fun hasPermission(permission:String) = ContextCompat.checkSelfPermission(this,permission)== PackageManager.PERMISSION_GRANTED
private fun postInitValues(){
isTracking.postValue(false)
pathPoints.postValue(mutableListOf())
}
@SuppressLint("MissingPermission")
private fun updateLocationTracking(isTracking: Boolean){
if(isTracking){
val request = LocationRequest().apply{
interval = LOCATION_UPDATE_INTERVAL
fastestInterval = SHORTEST_UPDATE_INTERVAL
priority = PRIORITY_HIGH_ACCURACY
}
fusedLocationProviderClient.requestLocationUpdates(request,locationCallback, Looper.getMainLooper())
}else{
fusedLocationProviderClient.removeLocationUpdates(locationCallback)
}
}
val locationCallback = object : LocationCallback(){
override fun onLocationResult(result: LocationResult) {
super.onLocationResult(result)
if(isTracking.value!!){
result?.locations?.let{locations ->
for(location in locations){
addPathPoint(location)
latlong.postValue(LatLng(location.latitude,location.longitude))
if(!isBegin){
isBegin = true
start_time = location.time
}
stop_time = location.time
}
}
}
}
}
private fun addPathPoint(location: Location?) {
location?.let {
pathPoints.value?.last()?.add(LatLng(location.latitude,location.longitude))
pathPoints.postValue(pathPoints.value)
}
}
private fun addEmptyPolyline() = pathPoints.value?.apply{
add(mutableListOf())
pathPoints.postValue(this)
} ?: pathPoints.postValue(mutableListOf(mutableListOf()))
private fun startForegroundService(){
addEmptyPolyline()
isTracking.postValue(true)
val notificationManager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
createNotificationChannel(notificationManager)
}
val notificationBuilder = NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID)
.setAutoCancel(false)
.setOngoing(true)
.setSmallIcon(R.drawable.walk)
.setContentTitle("RandoTracker")
.setContentText("App is running")
.setContentIntent(getMainActivityPendingIntent())
startForeground(NOTIFICATION_ID,notificationBuilder.build())
}
private fun getMainActivityPendingIntent() = PendingIntent.getActivity(this,0,Intent(this,Randonne::class.java).also{
it.action = "ShowFragment"
},FLAG_UPDATE_CURRENT)
@RequiresApi(Build.VERSION_CODES.O)
private fun createNotificationChannel(notificationManager: NotificationManager){
val channel = NotificationChannel(NOTIFICATION_CHANNEL_ID,NOTIFICATION_CHANNEL_NAME,IMPORTANCE_LOW)
notificationManager.createNotificationChannel(channel)
}
}
\ No newline at end of file
package com.example.randotracker.ui.main
import com.example.randotracker.database.RandoRequest
import com.example.randotracker.database.RandoTable
import javax.inject.Inject
class Requests @Inject constructor(val rando: RandoRequest) {
suspend fun insertRando(run: RandoTable) = rando.insertRando(run)
suspend fun deleteRando(run: RandoTable) = rando.insertRando(run)
fun getAllRandos() = rando.getAllRandos()
}
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#F44336"
android:pathData="M0,0h108v108h-108z" />
</vector>
<vector android:height="6dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="6dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M13.5,5.5c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM9.8,8.9L7,23h2.1l1.8,-8 2.1,2v6h2v-7.5l-2.1,-2 0.6,-3C14.8,12 16.8,13 19,13v-2c-1.9,0 -3.5,-1 -4.3,-2.4l-1,-1.6c-0.4,-0.6 -1,-1 -1.7,-1 -0.3,0 -0.5,0.1 -0.8,0.1L6,8.3V13h2V9.6l1.8,-0.7"/>
</vector>
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M20.5,3l-0.16,0.03L15,5.1 9,3 3.36,4.9c-0.21,0.07 -0.36,0.25 -0.36,0.48V20.5c0,0.28 0.22,0.5 0.5,0.5l0.16,-0.03L9,18.9l6,2.1 5.64,-1.9c0.21,-0.07 0.36,-0.25 0.36,-0.48V3.5c0,-0.28 -0.22,-0.5 -0.5,-0.5zM15,19l-6,-2.11V5l6,2.11V19z"/>
</vector>
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/black" android:pathData="M20.5,3l-0.16,0.03L15,5.1 9,3 3.36,4.9c-0.21,0.07 -0.36,0.25 -0.36,0.48V20.5c0,0.28 0.22,0.5 0.5,0.5l0.16,-0.03L9,18.9l6,2.1 5.64,-1.9c0.21,-0.07 0.36,-0.25 0.36,-0.48V3.5c0,-0.28 -0.22,-0.5 -0.5,-0.5zM15,19l-6,-2.11V5l6,2.11V19z"/>
</vector>
<vector android:height="40dp" android:tint="#FFD500"
android:viewportHeight="24" android:viewportWidth="24"
android:width="40dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M11.99,2C6.47,2 2,6.48 2,12c0,5.52 4.47,10 9.99,10C17.52,22 22,17.52 22,12C22,6.48 17.52,2 11.99,2zM8.5,8C9.33,8 10,8.67 10,9.5S9.33,11 8.5,11S7,10.33 7,9.5S7.67,8 8.5,8zM12,18c-2.28,0 -4.22,-1.66 -5,-4h10C16.22,16.34 14.28,18 12,18zM15.5,11c-0.83,0 -1.5,-0.67 -1.5,-1.5S14.67,8 15.5,8S17,8.67 17,9.5S16.33,11 15.5,11z"/>
</vector>
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M13.5,5.5c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM9.8,8.9L7,23h2.1l1.8,-8 2.1,2v6h2v-7.5l-2.1,-2 0.6,-3C14.8,12 16.8,13 19,13v-2c-1.9,0 -3.5,-1 -4.3,-2.4l-1,-1.6c-0.4,-0.6 -1,-1 -1.7,-1 -0.3,0 -0.5,0.1 -0.8,0.1L6,8.3V13h2V9.6l1.8,-0.7"/>
</vector>
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/black" android:pathData="M13.5,5.5c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM9.8,8.9L7,23h2.1l1.8,-8 2.1,2v6h2v-7.5l-2.1,-2 0.6,-3C14.8,12 16.8,13 19,13v-2c-1.9,0 -3.5,-1 -4.3,-2.4l-1,-1.6c-0.4,-0.6 -1,-1 -1.7,-1 -0.3,0 -0.5,0.1 -0.8,0.1L6,8.3V13h2V9.6l1.8,-0.7"/>
</vector>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="30dp"
android:text="Voulez-vous ajouter un repère ?" />
<EditText
android:id="@+id/marker_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginBottom="4dp"
android:hint="Title" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragments.MapFragment">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="MAP"
android:textSize="36sp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
/>
<fragment
android:name="com.google.android.gms.maps.SupportMapFragment"
android:id="@+id/map_frag"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<Button
android:id="@+id/start_button"
android:layout_width="100sp"
android:layout_height="50sp"
android:text="start"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.784"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.845" />
<Button
android:id="@+id/stop_button"
android:layout_width="100sp"
android:layout_height="50sp"
android:text="stop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.212"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.845" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragments.MapFragment">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerViewRandos"
android:layout_width="415dp"
android:layout_height="733dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TITLE"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="247dp"
tools:layout_editor_absoluteY="16dp" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TIME"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="174dp"
tools:layout_editor_absoluteY="16dp" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvDistance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="DISTANCE"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="71dp"
tools:layout_editor_absoluteY="16dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/rando"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.main.RandoFragment">
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment