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
07e62214
Commit
07e62214
authored
Feb 21, 2024
by
Alutulu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
arrondit nbr
parent
eb647a7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
AdAdapter.kt
...c/main/java/com/example/elbuenopeso/adapters/AdAdapter.kt
+3
-3
No files found.
app/src/main/java/com/example/elbuenopeso/adapters/AdAdapter.kt
View file @
07e62214
...
@@ -7,7 +7,6 @@ import android.widget.ImageView
...
@@ -7,7 +7,6 @@ import android.widget.ImageView
import
android.widget.TextView
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
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
()
{
...
@@ -19,6 +18,8 @@ class AdAdapter(private val context: Context, private val adModelArrayList: List
...
@@ -19,6 +18,8 @@ class AdAdapter(private val context: Context, private val adModelArrayList: List
override
fun
getItemId
(
i
:
Int
):
Long
=
i
.
toLong
()
override
fun
getItemId
(
i
:
Int
):
Long
=
i
.
toLong
()
fun
usingJavaStringFormat
(
input
:
Double
,
scale
:
Int
)
=
String
.
format
(
"%.${scale}f"
,
input
)
override
fun
getView
(
i
:
Int
,
view
:
View
?,
viewGroup
:
ViewGroup
):
View
{
override
fun
getView
(
i
:
Int
,
view
:
View
?,
viewGroup
:
ViewGroup
):
View
{
var
convertView
=
view
var
convertView
=
view
val
ad
=
adModelArrayList
[
i
]
val
ad
=
adModelArrayList
[
i
]
...
@@ -31,8 +32,7 @@ class AdAdapter(private val context: Context, private val adModelArrayList: List
...
@@ -31,8 +32,7 @@ class AdAdapter(private val context: Context, private val adModelArrayList: List
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
=
"${usingJavaStringFormat(ad.prix, 2)} €"
prixTV
.
text
=
"${prix.toBigDecimal().setScale(2, RoundingMode.UP).toDouble()} €"
return
convertView
return
convertView
}
}
}
}
\ 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