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
f55acfa4
Commit
f55acfa4
authored
Feb 20, 2024
by
Timothé KOBAK
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
ba02b6a8
2d5ea4ce
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
21 deletions
+23
-21
AdAdapter.kt
...c/main/java/com/example/elbuenopeso/adapters/AdAdapter.kt
+4
-0
AdModel.kt
app/src/main/java/com/example/elbuenopeso/models/AdModel.kt
+1
-1
MarketFragment.kt
...va/com/example/elbuenopeso/ui/dashboard/MarketFragment.kt
+9
-9
fragment_market.xml
app/src/main/res/layout/fragment_market.xml
+0
-9
item_listview_ad.xml
app/src/main/res/layout/item_listview_ad.xml
+9
-2
No files found.
app/src/main/java/com/example/elbuenopeso/adapters/AdAdapter.kt
View file @
f55acfa4
...
@@ -8,6 +8,7 @@ import android.widget.TextView
...
@@ -8,6 +8,7 @@ import android.widget.TextView
import
com.example.elbuenopeso.R
import
com.example.elbuenopeso.R
import
com.example.elbuenopeso.models.AdModel
import
com.example.elbuenopeso.models.AdModel
import
com.example.elbuenopeso.ui.dashboard.MarketFragment
import
com.example.elbuenopeso.ui.dashboard.MarketFragment
import
java.math.RoundingMode
class
AdAdapter
(
private
val
context
:
Context
,
private
val
adModelArrayList
:
List
<
AdModel
>)
:
BaseAdapter
()
{
class
AdAdapter
(
private
val
context
:
Context
,
private
val
adModelArrayList
:
List
<
AdModel
>)
:
BaseAdapter
()
{
...
@@ -27,9 +28,12 @@ class AdAdapter(private val context: Context, private val adModelArrayList: List
...
@@ -27,9 +28,12 @@ class AdAdapter(private val context: Context, private val adModelArrayList: List
val
imageIV
:
ImageView
=
convertView
.
findViewById
(
R
.
id
.
itemListViewImageView
)
val
imageIV
:
ImageView
=
convertView
.
findViewById
(
R
.
id
.
itemListViewImageView
)
val
titleTV
:
TextView
=
convertView
.
findViewById
(
R
.
id
.
itemListViewTitleView
)
val
titleTV
:
TextView
=
convertView
.
findViewById
(
R
.
id
.
itemListViewTitleView
)
val
addressTV
:
TextView
=
convertView
.
findViewById
(
R
.
id
.
itemListViewTextView
)
val
addressTV
:
TextView
=
convertView
.
findViewById
(
R
.
id
.
itemListViewTextView
)
val
prixTV
:
TextView
=
convertView
.
findViewById
(
R
.
id
.
itemListViewPrixView
)
imageIV
.
setImageResource
(
ad
.
image
)
imageIV
.
setImageResource
(
ad
.
image
)
titleTV
.
text
=
ad
.
title
titleTV
.
text
=
ad
.
title
addressTV
.
text
=
ad
.
address
addressTV
.
text
=
ad
.
address
val
prix
=
(
ad
.
prix
.
toString
())
prixTV
.
text
=
"${prix.toBigDecimal().setScale(2, RoundingMode.UP).toDouble()} €"
return
convertView
return
convertView
}
}
}
}
\ No newline at end of file
app/src/main/java/com/example/elbuenopeso/models/AdModel.kt
View file @
f55acfa4
package
com.example.elbuenopeso.models
package
com.example.elbuenopeso.models
public
class
AdModel
(
var
title
:
String
,
var
address
:
String
,
var
image
:
Int
)
{
public
class
AdModel
(
var
title
:
String
,
var
address
:
String
,
var
image
:
Int
,
var
prix
:
Double
)
{
}
}
\ No newline at end of file
app/src/main/java/com/example/elbuenopeso/ui/dashboard/MarketFragment.kt
View file @
f55acfa4
...
@@ -34,15 +34,15 @@ class MarketFragment : Fragment() {
...
@@ -34,15 +34,15 @@ class MarketFragment : Fragment() {
val
listView
:
ListView
=
binding
.
listView
val
listView
:
ListView
=
binding
.
listView
// seed market items
// seed market items
var
annonces
:
List
<
AdModel
>
=
listOf
<
AdModel
>(
var
annonces
:
List
<
AdModel
>
=
listOf
<
AdModel
>(
AdModel
(
"Poutre"
,
"1 rue Jean-Pierre"
,
R
.
drawable
.
pichu
),
AdModel
(
"Poutre"
,
"1 rue Jean-Pierre"
,
R
.
drawable
.
pichu
,
25.0
),
AdModel
(
"Briques"
,
"2 rue Jean-Michel"
,
R
.
drawable
.
pichu
),
AdModel
(
"Briques"
,
"2 rue Jean-Michel"
,
R
.
drawable
.
pichu
,
16.0
),
AdModel
(
"Mur en bois"
,
"4 rue Alain-Juju"
,
R
.
drawable
.
pichu
),
AdModel
(
"Mur en bois"
,
"4 rue Alain-Juju"
,
R
.
drawable
.
pichu
,
7.2
),
AdModel
(
"Maison de pierre"
,
"7 rue Joris Belhomme"
,
R
.
drawable
.
pichu
),
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
),
AdModel
(
"Téléphone de Timothé"
,
"8 rue de Timothé"
,
R
.
drawable
.
pichu
,
0.85
),
AdModel
(
"Oridnateur"
,
"10 rue Jean-Charles"
,
R
.
drawable
.
pichu
),
AdModel
(
"Oridnateur"
,
"10 rue Jean-Charles"
,
R
.
drawable
.
pichu
,
104.98
),
AdModel
(
"Charnières"
,
"22 rue Jeanne-Marie"
,
R
.
drawable
.
pichu
),
AdModel
(
"Charnières"
,
"22 rue Jeanne-Marie"
,
R
.
drawable
.
pichu
,
2648.97
),
AdModel
(
"Porte en marbre"
,
"1 rue Jean-Pierre"
,
R
.
drawable
.
pichu
),
AdModel
(
"Porte en marbre"
,
"1 rue Jean-Pierre"
,
R
.
drawable
.
pichu
,
480.0
),
AdModel
(
"Cheminée"
,
"33 rue du Gouvernement"
,
R
.
drawable
.
pichu
),
AdModel
(
"Cheminée"
,
"33 rue du Gouvernement"
,
R
.
drawable
.
pichu
,
800.0
),
)
)
var
adAdapter
:
AdAdapter
=
AdAdapter
(
requireContext
(),
annonces
)
var
adAdapter
:
AdAdapter
=
AdAdapter
(
requireContext
(),
annonces
)
...
...
app/src/main/res/layout/fragment_market.xml
View file @
f55acfa4
...
@@ -14,13 +14,4 @@
...
@@ -14,13 +14,4 @@
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
<Button
android:id=
"@+id/button6"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Button"
app:layout_constraintBottom_toTopOf=
"@+id/text_dashboard"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/item_listview_ad.xml
View file @
f55acfa4
...
@@ -9,7 +9,6 @@
...
@@ -9,7 +9,6 @@
android:id=
"@+id/itemListViewTitleView"
android:id=
"@+id/itemListViewTitleView"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"16dp"
android:text=
"TextView"
android:text=
"TextView"
android:textSize=
"20sp"
android:textSize=
"20sp"
app:layout_constraintStart_toEndOf=
"@+id/itemListViewImageView"
app:layout_constraintStart_toEndOf=
"@+id/itemListViewImageView"
...
@@ -27,9 +26,17 @@
...
@@ -27,9 +26,17 @@
android:id=
"@+id/itemListViewTextView"
android:id=
"@+id/itemListViewTextView"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"12dp"
android:text=
"TextView"
android:text=
"TextView"
app:layout_constraintBottom_toBottomOf=
"@+id/itemListViewImageView"
app:layout_constraintBottom_toBottomOf=
"@+id/itemListViewImageView"
app:layout_constraintStart_toEndOf=
"@+id/itemListViewImageView"
/>
app:layout_constraintStart_toEndOf=
"@+id/itemListViewImageView"
/>
<TextView
android:id=
"@+id/itemListViewPrixView"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"TextView"
app:layout_constraintBottom_toTopOf=
"@+id/itemListViewTextView"
app:layout_constraintStart_toEndOf=
"@+id/itemListViewImageView"
app:layout_constraintTop_toBottomOf=
"@+id/itemListViewTitleView"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
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