mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Add image conditional for landmark and city
This commit is contained in:
parent
e75c7fc5e8
commit
186d6ed87d
4 changed files with 11 additions and 1 deletions
|
|
@ -148,7 +148,16 @@ public class NearbyListFragment extends ListFragment {
|
||||||
|
|
||||||
//TODO: Check for description type and set Drawable image here
|
//TODO: Check for description type and set Drawable image here
|
||||||
//Types of desc: landmark, city, event, mountain, isle
|
//Types of desc: landmark, city, event, mountain, isle
|
||||||
icon.setImageResource(R.drawable.icon_landmark);
|
switch(place.description) {
|
||||||
|
case "landmark":
|
||||||
|
icon.setImageResource(R.drawable.icon_landmark);
|
||||||
|
break;
|
||||||
|
case "city":
|
||||||
|
icon.setImageResource(R.drawable.icon_city);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
icon.setImageResource(R.drawable.empty_photo);
|
||||||
|
}
|
||||||
|
|
||||||
// Return the completed view to render on screen
|
// Return the completed view to render on screen
|
||||||
return convertView;
|
return convertView;
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@ public class NearbyPlaces {
|
||||||
String type = fields[3];
|
String type = fields[3];
|
||||||
String image;
|
String image;
|
||||||
|
|
||||||
|
//TODO: remove this
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case "event":
|
case "event":
|
||||||
image = "https://upload.wikimedia.org/wikipedia/commons/c/ca/Anarchist_attack_on_the_King_of_Spain_Alfonso_XIII_%281906%29.jpg";
|
image = "https://upload.wikimedia.org/wikipedia/commons/c/ca/Anarchist_attack_on_the_King_of_Spain_Alfonso_XIII_%281906%29.jpg";
|
||||||
|
|
|
||||||
BIN
app/src/main/res/drawable/icon_city.png
Normal file
BIN
app/src/main/res/drawable/icon_city.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 13 KiB |
Loading…
Add table
Add a link
Reference in a new issue