Commit e0c03ed1 authored by m-spi's avatar m-spi

CA MARCHE ! (accès bdd)

parent 44cc7624
......@@ -25,50 +25,35 @@ private constructor(private val context: Context) {
}
// Add ads manually.
fun init() {
this.open()
this.insert(
AdModel(
"Wood",
"Douai",
"https://media.istockphoto.com/id/134253640/photo/construction-of-a-wooden-roof-frame-underway.jpg?s=612x612&w=0&k=20&c=e5gUkic9LGQWahIdHozOsEzHKy_HtsmvmtOHmYsejSU=",
25.0
)
AdModel("Poutre", "1 rue Jean-Pierre", "drawable/pichu.png", 25.0)
)
this.insert(
AdModel(
"Steel",
"Lille",
"https://as2.ftcdn.net/v2/jpg/03/91/83/87/1000_F_391838708_4HFADW5beay2VVlnoual6Qi5fWeIaD9V.jpg",25.0
)
AdModel("Briques", "2 rue Jean-Michel", "drawable/pichu.png", 16.0)
)
this.insert(
AdModel(
"Clay",
"Douai",
"https://constrofacilitator.com/wp-content/uploads/2020/02/clay-in-construction.jpg",25.0
)
AdModel("Maison de pierre", "7 rue Joris Belhomme", "drawable/pichu.png", 3.99)
)
this.insert(
AdModel(
"Metal",
"Lyon",
"https://www.meto-constructions.fr/wp-content/uploads/2018/12/IMG_6067.jpg",25.0
AdModel("Mur en bois", "4 rue Alain-Juju", "drawable/pichu.png", 7.2)
)
this.insert(
AdModel("Téléphone de Timothé", "8 rue de Timothé", "drawable/pichu.png", 0.85)
)
this.insert(
AdModel(
"Glass",
"Valenciennes",
"https://i0.wp.com/www.tipsnepal.com/wp-content/uploads/2020/09/simple-float-glass-1505049573-3306125.jpeg?resize=500%2C317&quality=100&strip=all&ssl=1",25.0
AdModel("Oridnateur", "10 rue Jean-Charles", "drawable/pichu.png", 104.98)
)
this.insert(
AdModel("Charnières", "22 rue Jeanne-Marie", "drawable/pichu.png", 2648.97)
)
this.insert(
AdModel(
"Wood",
"Orchies",
"https://yieldpro.com/wp-content/uploads/2020/08/lumber1.jpg",25.0
AdModel("Porte en marbre", "1 rue Jean-Pierre", "drawable/pichu.png", 480.0)
)
this.insert(
AdModel("Cheminée", "33 rue du Gouvernement", "drawable/pichu.png", 800.0)
)
}
......
......@@ -59,7 +59,7 @@ class MarketFragment : Fragment() {
dbManager!!.init()
val cursor = dbManager.fetch()
Log.i(null, cursor?.getColumnName(0).toString())
val adapter = DbAdapter(requireContext(), cursor!!, R.layout.fragment_market)
val adapter = DbAdapter(requireContext(), cursor!!, R.layout.item_listview_ad)
adapter.notifyDataSetChanged()
listView.adapter = adapter
return root
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment