parent
f91a64bc15
commit
f2a38eb339
@ -0,0 +1,26 @@
|
||||
package uca.baptistearthur.geocaching.recyclerview
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.Button
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.RecyclerView.Adapter
|
||||
import uca.baptistearthur.geocaching.R
|
||||
import uca.baptistearthur.geocaching.model.RoadTrip
|
||||
|
||||
|
||||
class RoadTripAdapter (val voyages: List<RoadTrip>) : Adapter<RoadTripViewHolder>(){
|
||||
|
||||
override fun onBindViewHolder(holder: RoadTripViewHolder, position: Int) {
|
||||
holder.itemView.findViewById<Button>(R.id.btnGetRoadTripsInfo).text = "test"
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RoadTripViewHolder {
|
||||
return RoadTripViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.cell_one_roadtrip, parent, false))
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return voyages.size
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package uca.baptistearthur.geocaching.recyclerview
|
||||
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.widget.Button
|
||||
import androidx.recyclerview.widget.RecyclerView.ViewHolder
|
||||
import uca.baptistearthur.geocaching.R
|
||||
|
||||
class RoadTripViewHolder(val cellule: View): ViewHolder(cellule) {
|
||||
|
||||
// init{
|
||||
// cellule.findViewById<Button>(R.id.btnGetRoadTripsInfo). ...
|
||||
// }
|
||||
|
||||
}
|
@ -1,33 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<Button
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/btnGetRoadTripsInfo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnGetRoadTripsInfo"
|
||||
android:layout_width="314dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
android:background="@color/white"
|
||||
android:drawableStart="@drawable/right_arrow"
|
||||
android:drawableLeft="@drawable/right_arrow"
|
||||
android:gravity="left"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
/>
|
||||
|
||||
<ImageButton
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="end"
|
||||
android:src="@drawable/bin"
|
||||
android:background="@color/white"
|
||||
android:scaleType="fitCenter"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
android:layout_gravity="start"
|
||||
android:background="@color/white"
|
||||
android:drawableStart="@drawable/right_arrow"
|
||||
android:drawableLeft="@drawable/right_arrow"
|
||||
android:gravity="left"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
/>
|
||||
|
Loading…
Reference in new issue