Merge pull request 'baptiste2' (#8) from baptiste2 into master
Reviewed-on: baptiste.bonneau/RoadTrip#8baptiste2
commit
596fd974ee
@ -1,57 +1,43 @@
|
|||||||
package uca.baptistearthur.geocaching.ui.fragment
|
package uca.baptistearthur.geocaching.ui.fragment
|
||||||
|
|
||||||
import android.content.Context
|
import android.annotation.SuppressLint
|
||||||
import android.content.pm.PackageManager
|
import android.os.Build
|
||||||
import android.location.LocationManager
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.core.content.ContextCompat
|
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import org.osmdroid.config.Configuration
|
|
||||||
import org.osmdroid.util.GeoPoint
|
|
||||||
import org.osmdroid.views.MapView
|
|
||||||
import org.osmdroid.views.overlay.ScaleBarOverlay
|
|
||||||
import android.Manifest.permission.ACCESS_FINE_LOCATION
|
|
||||||
import android.location.Location
|
|
||||||
import android.location.LocationListener
|
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.widget.ProgressBar
|
import android.widget.TextView
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
import androidx.annotation.RequiresApi
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import org.osmdroid.bonuspack.routing.OSRMRoadManager
|
|
||||||
import org.osmdroid.bonuspack.routing.RoadManager
|
|
||||||
import org.osmdroid.config.IConfigurationProvider
|
|
||||||
import org.osmdroid.library.BuildConfig
|
|
||||||
import org.osmdroid.tileprovider.tilesource.TileSourceFactory
|
|
||||||
import org.osmdroid.tileprovider.util.StorageUtils.getStorage
|
|
||||||
import org.osmdroid.views.overlay.compass.CompassOverlay
|
|
||||||
import org.osmdroid.views.overlay.compass.InternalCompassOrientationProvider
|
|
||||||
import org.osmdroid.views.overlay.mylocation.GpsMyLocationProvider
|
|
||||||
import org.osmdroid.views.overlay.mylocation.MyLocationNewOverlay
|
|
||||||
import uca.baptistearthur.geocaching.R
|
import uca.baptistearthur.geocaching.R
|
||||||
|
import uca.baptistearthur.geocaching.converters.Converters
|
||||||
|
import uca.baptistearthur.geocaching.converters.toFrenchFormat
|
||||||
import uca.baptistearthur.geocaching.recyclerview.PlacesAdapter
|
import uca.baptistearthur.geocaching.recyclerview.PlacesAdapter
|
||||||
import uca.baptistearthur.geocaching.ui.overlay.AddMarkerOverlay
|
import java.time.format.DateTimeFormatter
|
||||||
import uca.baptistearthur.geocaching.ui.overlay.RecenterOverlay
|
import java.util.*
|
||||||
|
|
||||||
class RoadtripDetail : Fragment() {
|
class RoadtripDetail : Fragment() {
|
||||||
|
|
||||||
private var placesRecyclerView : RecyclerView? = null
|
private var placesRecyclerView : RecyclerView? = null
|
||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||||
Log.d("GeoMap", "MAP ON CREATE VIEW")
|
Log.d("GeoMap", "MAP ON CREATE VIEW")
|
||||||
// Inflate the layout for this fragment
|
// Inflate the layout for this fragment
|
||||||
val view = inflater.inflate(R.layout.roadtrip_detail, container, false)
|
val view = inflater.inflate(R.layout.roadtrip_detail, container, false)
|
||||||
|
|
||||||
// val roadTrip = // récupérer le roadtrip cliqué
|
var roadTripJSON = arguments?.getString("roadTrip")
|
||||||
// placesRecyclerView = view?.findViewById(R.id.recyclerViewPlacesList)
|
val roadTrip = Converters().toRoadTripEntity(roadTripJSON)
|
||||||
// placesRecyclerView?.adapter = PlacesAdapter(roadTrip.places)
|
|
||||||
// placesRecyclerView?.layoutManager = LinearLayoutManager(context)
|
|
||||||
|
|
||||||
return view
|
|
||||||
}
|
|
||||||
|
|
||||||
|
placesRecyclerView = view?.findViewById(R.id.recyclerViewPlacesList)
|
||||||
|
placesRecyclerView?.adapter = PlacesAdapter(roadTrip.places)
|
||||||
|
placesRecyclerView?.layoutManager = LinearLayoutManager(context)
|
||||||
|
|
||||||
|
view?.findViewById<TextView>(R.id.roadTripDetailTitle)?.text = roadTrip.name
|
||||||
|
view?.findViewById<TextView>(R.id.roadTripDetailDate)?.text = roadTrip.date.toFrenchFormat()
|
||||||
|
|
||||||
|
return view
|
||||||
|
}
|
||||||
}
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||||
|
<item android:gravity="bottom">
|
||||||
|
<shape>
|
||||||
|
<size android:height="1dp" />
|
||||||
|
<solid android:color="@color/black" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
@ -1,26 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<fragment
|
|
||||||
android:id="@+id/fragment_container"
|
|
||||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="8"
|
|
||||||
app:defaultNavHost="true"
|
|
||||||
app:navGraph="@navigation/navgraph" />
|
|
||||||
|
|
||||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
|
||||||
android:id="@+id/bottom_navigation"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@color/main_turquoise_700"
|
|
||||||
app:menu="@menu/bottom_tabs" />
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
@ -1,7 +1,7 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.android.application' version '7.4.1' apply false
|
id 'com.android.application' version '7.3.0' apply false
|
||||||
id 'com.android.library' version '7.4.1' apply false
|
id 'com.android.library' version '7.3.0' apply false
|
||||||
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
|
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
|
||||||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' version '2.0.1' apply false
|
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' version '2.0.1' apply false
|
||||||
}
|
}
|
Loading…
Reference in new issue