debut voyages

pull/6/head
Baptiste BONNEAU 2 years ago
parent 74706288b1
commit 477cf4deb6

@ -1,6 +1,6 @@
package uca.baptistearthur.geocaching.model package uca.baptistearthur.geocaching.model
data class Place( data class Place(
val latitude : Long, val latitude: Double,
val longitude : Long val longitude: Double
) )

@ -9,6 +9,6 @@ class RoadTrip(
){ ){
fun addPlaceToRoadTripList(place: Place) = places.add(place) fun addPlaceToRoadTripList(place: Place) = places.add(place)
fun addPlaceToRoadTripList(latitude: Long, longitude: Long) = places.add(Place(latitude, longitude)) fun addPlaceToRoadTripList(latitude: Double, longitude: Double) = places.add(Place(latitude, longitude))
} }

@ -1,6 +1,15 @@
package uca.baptistearthur.geocaching.model package uca.baptistearthur.geocaching.model
import java.util.Date
class Stub { class Stub {
fun load(): List<RoadTrip> {
return listOf(
RoadTrip("France", Date(), listOf(Place(48.866667, 2.333333), Place(48.866667, 2.333333)) as ArrayList<Place>),
RoadTrip("Italie", Date(), listOf(Place(52.866667, 4.333333), Place(48.866667, 2.333333)) as ArrayList<Place>),
RoadTrip("Allemagne", Date(), listOf(Place(37.866667, 3.333333)) as ArrayList<Place>),
)
}
} }

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>

@ -1,9 +1,19 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".ui.fragment.RoadTrip"> tools:context=".ui.fragment.RoadTrip"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/roadtrip_title"
android:background="@color/main_turquoise_200"
android:textColor="@color/main_turquoise_50"
android:padding="10dp"
android:textSize="20dp"/>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerViewRoadTripList" android:id="@+id/recyclerViewRoadTripList"
@ -11,4 +21,4 @@
android:layout_height="match_parent" android:layout_height="match_parent"
/> />
</FrameLayout> </LinearLayout>

@ -2,6 +2,7 @@
<string name="app_name">RoadTrip</string> <string name="app_name">RoadTrip</string>
<string name="carte">Carte</string> <string name="carte">Carte</string>
<string name="voyages">Voyages</string> <string name="voyages">Voyages</string>
<string name="roadtrip_title">Mes RoadTrips:</string>v
<!-- TODO: Remove or change this placeholder text --> <!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string> <string name="hello_blank_fragment">Hello blank fragment</string>
</resources> </resources>
Loading…
Cancel
Save