Commit e3eaeea0 by Kunj Gupta

UOFLMA-71: Image API related issues are fixed.

parent 7fe592f1
......@@ -82,11 +82,14 @@ public class CatalogueCategoryAdapter extends BaseAdapter {
}
if(catalogue.getIcon() != null && !catalogue.getIcon().isEmpty()) {
holder.image.setVisibility(View.VISIBLE);
StringBuilder builder = new StringBuilder();
builder.append(Constants.DOMAIN);
builder.append(catalogue.getIcon());
Picasso.with(mContext).load(builder.toString()).into(holder.image);
} else {
holder.image.setVisibility(View.INVISIBLE);
}
......
......@@ -82,11 +82,14 @@ public class CatalogueCategoryItemAdapter extends BaseAdapter {
}
if(catalogueItem.getIcon() != null && !catalogueItem.getIcon().isEmpty()) {
holder.image.setVisibility(View.VISIBLE);
StringBuilder builder = new StringBuilder();
builder.append(Constants.DOMAIN);
builder.append(catalogueItem.getIcon());
Picasso.with(mContext).load(builder.toString()).into(holder.image);
} else {
holder.image.setVisibility(View.INVISIBLE);
}
return convertView;
......
......@@ -43,7 +43,7 @@ public class CatalogueApiManager {
CatalogueLog.d("CatalogueApiManager: getCatalogues: request parameter: "+stringBuilder.toString());
final Retrofit retrofit = RestClient.getInitializedRestAdapter(Constants.API_AUTH_PARAM_USER_NAME, Constants.API_AUTH_PARAM_PASSWORD);
Call<ResponseBody> call = retrofit.create(CatalogueCategoryApi.class).getCatalogue(stringBuilder.toString(), "sys_id,title,description,icon", "true");
Call<ResponseBody> call = retrofit.create(CatalogueCategoryApi.class).getCatalogue(stringBuilder.toString(), "sys_id,title,description,homepage_image", "true");
try {
//Retrofit synchronous call
Response<ResponseBody> response = call.execute();
......
......@@ -17,7 +17,7 @@ public class Catalogue {
@SerializedName("sys_id")
@Expose
private String sysId;
@SerializedName("icon")
@SerializedName("homepage_image")
@Expose
private String icon;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment