Commit e3eaeea0 by Kunj Gupta

UOFLMA-71: Image API related issues are fixed.

parent 7fe592f1
...@@ -82,11 +82,14 @@ public class CatalogueCategoryAdapter extends BaseAdapter { ...@@ -82,11 +82,14 @@ public class CatalogueCategoryAdapter extends BaseAdapter {
} }
if(catalogue.getIcon() != null && !catalogue.getIcon().isEmpty()) { if(catalogue.getIcon() != null && !catalogue.getIcon().isEmpty()) {
holder.image.setVisibility(View.VISIBLE);
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.append(Constants.DOMAIN); builder.append(Constants.DOMAIN);
builder.append(catalogue.getIcon()); builder.append(catalogue.getIcon());
Picasso.with(mContext).load(builder.toString()).into(holder.image); Picasso.with(mContext).load(builder.toString()).into(holder.image);
} else {
holder.image.setVisibility(View.INVISIBLE);
} }
......
...@@ -82,11 +82,14 @@ public class CatalogueCategoryItemAdapter extends BaseAdapter { ...@@ -82,11 +82,14 @@ public class CatalogueCategoryItemAdapter extends BaseAdapter {
} }
if(catalogueItem.getIcon() != null && !catalogueItem.getIcon().isEmpty()) { if(catalogueItem.getIcon() != null && !catalogueItem.getIcon().isEmpty()) {
holder.image.setVisibility(View.VISIBLE);
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.append(Constants.DOMAIN); builder.append(Constants.DOMAIN);
builder.append(catalogueItem.getIcon()); builder.append(catalogueItem.getIcon());
Picasso.with(mContext).load(builder.toString()).into(holder.image); Picasso.with(mContext).load(builder.toString()).into(holder.image);
} else {
holder.image.setVisibility(View.INVISIBLE);
} }
return convertView; return convertView;
......
...@@ -43,7 +43,7 @@ public class CatalogueApiManager { ...@@ -43,7 +43,7 @@ public class CatalogueApiManager {
CatalogueLog.d("CatalogueApiManager: getCatalogues: request parameter: "+stringBuilder.toString()); CatalogueLog.d("CatalogueApiManager: getCatalogues: request parameter: "+stringBuilder.toString());
final Retrofit retrofit = RestClient.getInitializedRestAdapter(Constants.API_AUTH_PARAM_USER_NAME, Constants.API_AUTH_PARAM_PASSWORD); 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 { try {
//Retrofit synchronous call //Retrofit synchronous call
Response<ResponseBody> response = call.execute(); Response<ResponseBody> response = call.execute();
......
...@@ -17,7 +17,7 @@ public class Catalogue { ...@@ -17,7 +17,7 @@ public class Catalogue {
@SerializedName("sys_id") @SerializedName("sys_id")
@Expose @Expose
private String sysId; private String sysId;
@SerializedName("icon") @SerializedName("homepage_image")
@Expose @Expose
private String icon; 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