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
2d5ea4ce
Commit
2d5ea4ce
authored
Feb 21, 2024
by
Alutulu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pichu fix
parent
d8f27b64
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 @
2d5ea4ce
...
...
@@ -8,6 +8,7 @@ import android.widget.TextView
import
com.example.elbuenopeso.R
import
com.example.elbuenopeso.models.AdModel
import
com.example.elbuenopeso.ui.dashboard.MarketFragment
import
java.math.RoundingMode
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
val
imageIV
:
ImageView
=
convertView
.
findViewById
(
R
.
id
.
itemListViewImageView
)
val
titleTV
:
TextView
=
convertView
.
findViewById
(
R
.
id
.
itemListViewTitleView
)
val
addressTV
:
TextView
=
convertView
.
findViewById
(
R
.
id
.
itemListViewTextView
)
val
prixTV
:
TextView
=
convertView
.
findViewById
(
R
.
id
.
itemListViewPrixView
)
imageIV
.
setImageResource
(
ad
.
image
)
titleTV
.
text
=
ad
.
title
addressTV
.
text
=
ad
.
address
val
prix
=
(
ad
.
prix
.
toString
())
prixTV
.
text
=
"${prix.toBigDecimal().setScale(2, RoundingMode.UP).toDouble()} €"
return
convertView
}
}
\ No newline at end of file
app/src/main/java/com/example/elbuenopeso/models/AdModel.kt
View file @
2d5ea4ce
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 @
2d5ea4ce
...
...
@@ -34,15 +34,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
),
AdModel
(
"Briques"
,
"2 rue Jean-Michel"
,
R
.
drawable
.
pichu
),
AdModel
(
"Mur en bois"
,
"4 rue Alain-Juju"
,
R
.
drawable
.
pichu
),
AdModel
(
"Maison de pierre"
,
"7 rue Joris Belhomme"
,
R
.
drawable
.
pichu
),
AdModel
(
"Téléphone de Timothé"
,
"8 rue de Timothé"
,
R
.
drawable
.
pichu
),
AdModel
(
"Oridnateur"
,
"10 rue Jean-Charles"
,
R
.
drawable
.
pichu
),
AdModel
(
"Charnières"
,
"22 rue Jeanne-Marie"
,
R
.
drawable
.
pichu
),
AdModel
(
"Porte en marbre"
,
"1 rue Jean-Pierre"
,
R
.
drawable
.
pichu
),
AdModel
(
"Cheminée"
,
"33 rue du Gouvernement"
,
R
.
drawable
.
pichu
),
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
),
)
var
adAdapter
:
AdAdapter
=
AdAdapter
(
requireContext
(),
annonces
)
...
...
app/src/main/res/layout/fragment_market.xml
View file @
2d5ea4ce
...
...
@@ -14,13 +14,4 @@
app:layout_constraintStart_toStartOf=
"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>
\ No newline at end of file
app/src/main/res/layout/item_listview_ad.xml
View file @
2d5ea4ce
...
...
@@ -9,7 +9,6 @@
android:id=
"@+id/itemListViewTitleView"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"16dp"
android:text=
"TextView"
android:textSize=
"20sp"
app:layout_constraintStart_toEndOf=
"@+id/itemListViewImageView"
...
...
@@ -27,9 +26,17 @@
android:id=
"@+id/itemListViewTextView"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"12dp"
android:text=
"TextView"
app:layout_constraintBottom_toBottomOf=
"@+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>
\ 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