public static String prepareMessageFromTemplate(String body, Contact contact) { body = body.replace(expressions[0], contact.getFullName()); body = body.replace(expressions[1], contact.getFullName()); body = body.replace(expressions[2], contact.getFirstName()); body = body.replace(expressions[3], contact.getMiddleName()); body = body.replace(expressions[4], contact.getLastName()); return body; }
@Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { LayoutInflater mInflater = (LayoutInflater) context.getSystemService(Activity.LAYOUT_INFLATER_SERVICE); convertView = mInflater.inflate(R.layout.mobicom_list_item_title_navigation, parent, false); } imgIcon = (ImageView) convertView.findViewById(R.id.imgIcon); txtTitle = (TextView) convertView.findViewById(R.id.txtTitle); txtName = (TextView) convertView.findViewById(R.id.txtName); imgIcon.setImageResource(spinnerNavItem.get(position).getIcon()); imgIcon.setVisibility(View.GONE); Contact contact = spinnerNavItem.get(position).getContact(); txtName.setText(contact.getFullName() + " \r \n " + spinnerNavItem.get(position).getContactNumber()); txtTitle.setVisibility(View.GONE); return convertView; }
/** * This method will return full name of contact to be updated. * This is require to avoid updating full name back to userId in case fullname is not set while updating contact. * * @param contact * @return */ private String getFullNameForUpdate(Contact contact) { String fullName = contact.getDisplayName(); if (TextUtils.isEmpty(contact.getFullName())) { Contact contactFromDB = getContactById(contact.getUserId()); if (contactFromDB != null) { fullName = contactFromDB.getFullName(); } } return fullName; }
public ProfilePictureUpload(Contact contact, Context context, TextView displayNameTextView, TextView statusTextView, TextView contactNumberTextView) { this.context = context; this.status = contact.getStatus(); this.displayName = contact.getFullName(); this.contactNumber = contact.getContactNumber(); this.weakReferenceStatus = new WeakReference<TextView>(statusTextView); this.weakReferenceDisplayName = new WeakReference<TextView>(displayNameTextView); this.weakReferenceContactNumber = new WeakReference<TextView>(contactNumberTextView); this.fileClientService = new FileClientService(getActivity()); this.userService = UserService.getInstance(context); }
if (contact != null && TextUtils.isEmpty(contact.getFullName()) && !TextUtils.isEmpty(fullName)) { contact.setFullName(fullName); baseContactService.upsert(contact);