Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hds
flexin
android-app
Commits
eeb76af3
Commit
eeb76af3
authored
Nov 05, 2017
by
Nastuzzi Samy
Browse files
Add empty items in grid
Manage empty items
parent
f7018e5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/fr/utc/simde/payutc/articles/GridAdapter.java
View file @
eeb76af3
...
...
@@ -52,31 +52,35 @@ public class GridAdapter extends ArticlesAdapter {
JsonNode
article
=
this
.
articleList
.
get
(
position
);
if
(
view
==
null
)
{
LayoutInflater
layoutInflater
=
LayoutInflater
.
from
(
this
.
activity
);
view
=
layoutInflater
.
inflate
(
R
.
layout
.
fragment_article_grid
,
null
);
if
(
article
.
size
()
==
0
)
view
=
new
View
(
this
.
activity
);
else
{
LayoutInflater
layoutInflater
=
LayoutInflater
.
from
(
this
.
activity
);
view
=
layoutInflater
.
inflate
(
R
.
layout
.
fragment_article_grid
,
null
);
ImageView
imageView
=
view
.
findViewById
(
R
.
id
.
image_article
);
ImageView
imageView
=
view
.
findViewById
(
R
.
id
.
image_article
);
if
(
clickViewList
[
position
]
==
null
)
clickViewList
[
position
]
=
view
.
findViewById
(
R
.
id
.
text_nbr_clicks
);
if
(
clickViewList
[
position
]
==
null
)
clickViewList
[
position
]
=
view
.
findViewById
(
R
.
id
.
text_nbr_clicks
);
TextView
textView
=
view
.
findViewById
(
R
.
id
.
text_article
);
textView
.
setText
(
article
.
get
(
"name"
).
textValue
());
TextView
textView
=
view
.
findViewById
(
R
.
id
.
text_article
);
textView
.
setText
(
article
.
get
(
"name"
).
textValue
());
RelativeLayout
.
LayoutParams
parms
=
new
RelativeLayout
.
LayoutParams
(
this
.
size
,
this
.
size
);
imageView
.
setLayoutParams
(
parms
);
RelativeLayout
.
LayoutParams
parms
=
new
RelativeLayout
.
LayoutParams
(
this
.
size
,
this
.
size
);
imageView
.
setLayoutParams
(
parms
);
ImageView
imageCotisant
=
view
.
findViewById
(
R
.
id
.
image_cotisant
);
ImageView
image18
=
view
.
findViewById
(
R
.
id
.
image_18
);
ImageView
imageCotisant
=
view
.
findViewById
(
R
.
id
.
image_cotisant
);
ImageView
image18
=
view
.
findViewById
(
R
.
id
.
image_18
);
LinearLayout
.
LayoutParams
imageParms
=
new
LinearLayout
.
LayoutParams
(
45
,
45
);
imageParms
.
setMargins
(
0
,
this
.
size
-
45
,
0
,
0
);
imageCotisant
.
setLayoutParams
(
imageParms
);
image18
.
setLayoutParams
(
imageParms
);
LinearLayout
.
LayoutParams
imageParms
=
new
LinearLayout
.
LayoutParams
(
45
,
45
);
imageParms
.
setMargins
(
0
,
this
.
size
-
45
,
0
,
0
);
imageCotisant
.
setLayoutParams
(
imageParms
);
image18
.
setLayoutParams
(
imageParms
);
setInfos
(
article
,
imageCotisant
,
image18
);
setImage
(
imageView
,
article
.
get
(
"image_url"
).
textValue
(),
position
);
setClickView
(
position
);
setInfos
(
article
,
imageCotisant
,
image18
);
setImage
(
imageView
,
article
.
get
(
"image_url"
).
textValue
(),
position
);
setClickView
(
position
);
}
}
return
view
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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