Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ElBuenoPeso
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Matis SPINELLI
ElBuenoPeso
Commits
e0c03ed1
Commit
e0c03ed1
authored
Feb 22, 2024
by
m-spi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CA MARCHE ! (accès bdd)
parent
44cc7624
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
32 deletions
+17
-32
DBManager.kt
...c/main/java/com/example/elbuenopeso/database/DBManager.kt
+16
-31
MarketFragment.kt
.../java/com/example/elbuenopeso/ui/market/MarketFragment.kt
+1
-1
No files found.
app/src/main/java/com/example/elbuenopeso/database/DBManager.kt
View file @
e0c03ed1
...
@@ -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
)
)
)
}
}
...
...
app/src/main/java/com/example/elbuenopeso/ui/market/MarketFragment.kt
View file @
e0c03ed1
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment