Update ipfs image

This commit is contained in:
Victor Shcherb 2021-02-03 16:30:01 +01:00
parent 5a25260345
commit 946741933c

View file

@ -16,16 +16,16 @@ public class IPFSImageCard extends ImageCard {
public IPFSImageCard(MapActivity mapActivity, JSONObject imageObject) { public IPFSImageCard(MapActivity mapActivity, JSONObject imageObject) {
super(mapActivity, imageObject); super(mapActivity, imageObject);
String cid = ""; url = mapActivity.getString(R.string.opr_base_url) + "api/ipfs/image?";
try { try {
cid = (String) imageObject.get("cid"); url += "cid=" + (String) imageObject.getString("cid");
url += "&hash=" + (String) imageObject.getString("hash");
url += "&ext=" + (String) imageObject.getString("extension");
} catch (JSONException e) { } catch (JSONException e) {
LOG.error(e); LOG.error(e);
} }
String BASE_URL = mapActivity.getString(R.string.opr_base_url) + "api/ipfs/image-ipfs?cid="; imageHiresUrl = url;
url = BASE_URL + cid; imageUrl = url;
imageHiresUrl = BASE_URL + cid;
imageUrl = BASE_URL + cid;
icon = ContextCompat.getDrawable(getMyApplication(), R.drawable.ic_logo_openplacereview); icon = ContextCompat.getDrawable(getMyApplication(), R.drawable.ic_logo_openplacereview);
if (!Algorithms.isEmpty(getUrl())) { if (!Algorithms.isEmpty(getUrl())) {
View.OnClickListener onClickListener = new View.OnClickListener() { View.OnClickListener onClickListener = new View.OnClickListener() {