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) { ...@@ -25,50 +25,35 @@ private constructor(private val context: Context) {
} }
// Add ads manually. // Add ads manually.
fun init() { fun init() {
this.open() this.open()
this.insert( this.insert(
AdModel( AdModel("Poutre", "1 rue Jean-Pierre", "drawable/pichu.png", 25.0)
"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
)
) )
this.insert( this.insert(
AdModel( AdModel("Briques", "2 rue Jean-Michel", "drawable/pichu.png", 16.0)
"Steel",
"Lille",
"https://as2.ftcdn.net/v2/jpg/03/91/83/87/1000_F_391838708_4HFADW5beay2VVlnoual6Qi5fWeIaD9V.jpg",25.0
)
) )
this.insert( this.insert(
AdModel( AdModel("Maison de pierre", "7 rue Joris Belhomme", "drawable/pichu.png", 3.99)
"Clay",
"Douai",
"https://constrofacilitator.com/wp-content/uploads/2020/02/clay-in-construction.jpg",25.0
)
) )
this.insert( this.insert(
AdModel( AdModel("Mur en bois", "4 rue Alain-Juju", "drawable/pichu.png", 7.2)
"Metal",
"Lyon",
"https://www.meto-constructions.fr/wp-content/uploads/2018/12/IMG_6067.jpg",25.0
) )
this.insert(
AdModel("Téléphone de Timothé", "8 rue de Timothé", "drawable/pichu.png", 0.85)
) )
this.insert( this.insert(
AdModel( AdModel("Oridnateur", "10 rue Jean-Charles", "drawable/pichu.png", 104.98)
"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
) )
this.insert(
AdModel("Charnières", "22 rue Jeanne-Marie", "drawable/pichu.png", 2648.97)
) )
this.insert( this.insert(
AdModel( AdModel("Porte en marbre", "1 rue Jean-Pierre", "drawable/pichu.png", 480.0)
"Wood",
"Orchies",
"https://yieldpro.com/wp-content/uploads/2020/08/lumber1.jpg",25.0
) )
this.insert(
AdModel("Cheminée", "33 rue du Gouvernement", "drawable/pichu.png", 800.0)
) )
} }
......
...@@ -59,7 +59,7 @@ class MarketFragment : Fragment() { ...@@ -59,7 +59,7 @@ class MarketFragment : Fragment() {
dbManager!!.init() dbManager!!.init()
val cursor = dbManager.fetch() val cursor = dbManager.fetch()
Log.i(null, cursor?.getColumnName(0).toString()) 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() adapter.notifyDataSetChanged()
listView.adapter = adapter listView.adapter = adapter
return root 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