private String getActivityTypeMessage(ActivityEntry item) { String s = item.getType(); if (MAP_ACTIVITY_TYPE.get(s) != null) { s = getContext().getResources().getString(MAP_ACTIVITY_TYPE.get(item.getType())); if (s.contains(PARAM_CUSTOM)) { s = s.replace(PARAM_CUSTOM, getData(item, OnPremiseConstant.ROLE_VALUE)); s = s.replace( PARAM_USER_PROFILE, "<b>" + getData(item, OnPremiseConstant.MEMEBERFIRSTNAME_VALUE) + " " + getData(item, OnPremiseConstant.MEMBERLASTNAME_VALUE) + "</b>"); } else { s = s.replace( PARAM_USER_PROFILE, "<b>" + getData(item, OnPremiseConstant.FIRSTNAME_VALUE) + " " + getData(item, OnPremiseConstant.LASTNAME_VALUE) + "</b>"); } if (s.contains(PARAM_TITLE)) { s = s.replace(PARAM_TITLE, "<b>" + getData(item, OnPremiseConstant.TITLE_VALUE) + "</b>"); } if (s.contains(PARAM_SITE_LINK)) { s = s.replace(PARAM_SITE_LINK, item.getSiteShortName()); } if (s.contains(PARAM_STATUS)) { s = s.replace(PARAM_STATUS, getData(item, OnPremiseConstant.STATUS_VALUE)); } if (s.contains(PARAM_SUBSCRIBER)) { s = s.replace( PARAM_SUBSCRIBER, "<b>" + getData(item, OnPremiseConstant.USERFIRSTNAME_VALUE) + " " + getData(item, OnPremiseConstant.USERLASTNAME_VALUE) + "</b>"); } } return s; }
private int getFileDrawableId(ActivityEntry item) { int drawable = R.drawable.ic_menu_notifications; String s = item.getType(); if (s.startsWith(PREFIX_FILE)) { drawable = MimeTypeManager.getIcon(getData(item, OnPremiseConstant.TITLE_VALUE)); } else { for (Entry<String, Integer> icon : EVENT_ICON.entrySet()) { if (s.startsWith(icon.getKey())) { drawable = icon.getValue(); break; } } } return drawable; }
private void getCreatorAvatar(GenericViewHolder vh, ActivityEntry item) { String type = item.getType(); String tmp = null; if (type.startsWith(PREFIX_FILE)) { renditionManager.display(vh.icon, item.getCreatedBy(), getFileDrawableId(item)); } else if (type.startsWith(PREFIX_GROUP)) { vh.icon.setImageDrawable(getContext().getResources().getDrawable(getFileDrawableId(item))); } else if (type.startsWith(PREFIX_USER)) { tmp = getData(item, CloudConstant.MEMEBERUSERNAME_VALUE); if (tmp.isEmpty()) { tmp = null; } renditionManager.display(vh.icon, tmp, getFileDrawableId(item)); } else if (type.startsWith(PREFIX_SUBSCRIPTION)) { tmp = getData(item, CloudConstant.FOLLOWERUSERNAME_VALUE); if (tmp.isEmpty()) { tmp = null; } renditionManager.display(vh.icon, tmp, getFileDrawableId(item)); } else { renditionManager.display(vh.icon, item.getCreatedBy(), getFileDrawableId(item)); } }