/** * Adds or updates a text view for the data element. */ public void setData(char[] text, int size) { if (text == null || size == 0) { if (mDataView != null) { mDataView.setVisibility(View.GONE); } } else { getDataView(); setMarqueeText(mDataView, text, size); mDataView.setVisibility(VISIBLE); } }
public void setViewUnblocked(ContactListItemView view) { view.setTag(R.id.block_id, null); final int textColor = mResources.getColor(R.color.dialtacts_secondary_text_color); view.getDataView().setTextColor(textColor); view.getLabelView().setTextColor(textColor); //TODO: Remove icon }
public void setViewBlocked(ContactListItemView view, Integer id) { view.setTag(R.id.block_id, id); final int textColor = mResources.getColor(R.color.blocked_number_block_color); view.getDataView().setTextColor(textColor); view.getLabelView().setTextColor(textColor); //TODO: Add icon }
/** * Sets phone number for a list item. This takes care of number highlighting if the highlight * mask exists. */ public void setPhoneNumber(String text, String countryIso) { if (text == null) { if (mDataView != null) { mDataView.setVisibility(View.GONE); } } else { getDataView(); // TODO: Format number using PhoneNumberUtils.formatNumber before assigning it to // mDataView. Make sure that determination of the highlight sequences are done only // after number formatting. // Sets phone number texts for display after highlighting it, if applicable. // CharSequence textToSet = text; final SpannableString textToSet = new SpannableString(text); if (mNumberHighlightSequence.size() != 0) { final HighlightSequence highlightSequence = mNumberHighlightSequence.get(0); mTextHighlighter.applyMaskingHighlight(textToSet, highlightSequence.start, highlightSequence.end); } setMarqueeText(mDataView, textToSet); mDataView.setVisibility(VISIBLE); // We have a phone number as "mDataView" so make it always LTR and VIEW_START mDataView.setTextDirection(View.TEXT_DIRECTION_LTR); mDataView.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_START); } }