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
2d98e570
Commit
2d98e570
authored
Feb 22, 2024
by
m-spi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
corec2
parent
fa1d8dd1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
MarketFragment.kt
.../java/com/example/elbuenopeso/ui/market/MarketFragment.kt
+13
-14
No files found.
app/src/main/java/com/example/elbuenopeso/ui/market/MarketFragment.kt
View file @
2d98e570
...
...
@@ -30,7 +30,7 @@ class MarketFragment : Fragment() {
private
lateinit
var
listView
:
ListView
private
lateinit
var
gridView
:
GridView
private
lateinit
var
toggleButton
:
ToggleButton
private
lateinit
var
ad
Adapter
:
Ad
Adapter
private
lateinit
var
ad
apter
:
Db
Adapter
private
var
isGridViewEnabled
=
false
...
...
@@ -51,15 +51,15 @@ class MarketFragment : Fragment() {
val
listView
:
ListView
=
binding
.
listView
// seed market items
var
annonces
:
List
<
AdModel
>
=
listOf
<
AdModel
>(
AdModel
(
"Poutre"
,
"1 rue Jean-Pierre"
,
R
.
drawable
.
pichu
,
25.0
),
AdModel
(
"Briques"
,
"2 rue Jean-Michel"
,
R
.
drawable
.
pichu
,
16.0
),
AdModel
(
"Mur en bois"
,
"4 rue Alain-Juju"
,
R
.
drawable
.
pichu
,
7.2
),
AdModel
(
"Maison de pierre"
,
"7 rue Joris Belhomme"
,
R
.
drawable
.
pichu
,
3.99
),
AdModel
(
"Téléphone de Timothé"
,
"8 rue de Timothé"
,
R
.
drawable
.
pichu
,
0.85
),
AdModel
(
"Oridnateur"
,
"10 rue Jean-Charles"
,
R
.
drawable
.
pichu
,
104.98
),
AdModel
(
"Charnières"
,
"22 rue Jeanne-Marie"
,
R
.
drawable
.
pichu
,
2648.97
),
AdModel
(
"Porte en marbre"
,
"1 rue Jean-Pierre"
,
R
.
drawable
.
pichu
,
480.0
),
AdModel
(
"Cheminée"
,
"33 rue du Gouvernement"
,
R
.
drawable
.
pichu
,
800.0
),
AdModel
(
"Poutre"
,
"1 rue Jean-Pierre"
,
R
.
drawable
.
pichu
.
toString
()
,
25.0
),
AdModel
(
"Briques"
,
"2 rue Jean-Michel"
,
R
.
drawable
.
pichu
.
toString
()
,
16.0
),
AdModel
(
"Mur en bois"
,
"4 rue Alain-Juju"
,
R
.
drawable
.
pichu
.
toString
()
,
7.2
),
AdModel
(
"Maison de pierre"
,
"7 rue Joris Belhomme"
,
R
.
drawable
.
pichu
.
toString
()
,
3.99
),
AdModel
(
"Téléphone de Timothé"
,
"8 rue de Timothé"
,
R
.
drawable
.
pichu
.
toString
()
,
0.85
),
AdModel
(
"Oridnateur"
,
"10 rue Jean-Charles"
,
R
.
drawable
.
pichu
.
toString
()
,
104.98
),
AdModel
(
"Charnières"
,
"22 rue Jeanne-Marie"
,
R
.
drawable
.
pichu
.
toString
()
,
2648.97
),
AdModel
(
"Porte en marbre"
,
"1 rue Jean-Pierre"
,
R
.
drawable
.
pichu
.
toString
()
,
480.0
),
AdModel
(
"Cheminée"
,
"33 rue du Gouvernement"
,
R
.
drawable
.
pichu
.
toString
()
,
800.0
),
)
toggleButton
.
setOnCheckedChangeListener
{
_
,
isChecked
->
...
...
@@ -70,8 +70,7 @@ class MarketFragment : Fragment() {
val
dbManager
:
DBManager
?
=
DBManager
.
getDBManager
(
requireContext
())
dbManager
!!
.
init
()
val
cursor
=
dbManager
.
fetch
()
Log
.
i
(
null
,
cursor
?.
getColumnName
(
0
).
toString
())
val
adapter
=
DbAdapter
(
requireContext
(),
cursor
!!
,
R
.
layout
.
item_listview_ad
)
adapter
=
DbAdapter
(
requireContext
(),
cursor
!!
,
R
.
layout
.
item_listview_ad
)
adapter
.
notifyDataSetChanged
()
listView
.
adapter
=
adapter
return
root
...
...
@@ -81,11 +80,11 @@ class MarketFragment : Fragment() {
if
(
isGridViewEnabled
)
{
listView
.
visibility
=
View
.
GONE
gridView
.
visibility
=
View
.
VISIBLE
gridView
.
adapter
=
ad
Ad
apter
gridView
.
adapter
=
adapter
}
else
{
gridView
.
visibility
=
View
.
GONE
listView
.
visibility
=
View
.
VISIBLE
listView
.
adapter
=
ad
Ad
apter
listView
.
adapter
=
adapter
}
}
...
...
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