/** * Populates the contact info fields based on the current contact information. */ private void updateContactInfo() { if (mContactUri != null) { setPhoto(mPhotoID, mPhotoUri, mContactUri, mNameOrNumber, mIsBusiness); } else { mContactPhoto.setVisibility(View.GONE); } mNameView.setText(mNameOrNumber); if (!TextUtils.isEmpty(mNumberLabel) && !TextUtils.isEmpty(mDisplayNumber)) { mNumberView.setVisibility(View.VISIBLE); mNumberView.setText(getString(R.string.call_subject_type_and_number, mNumberLabel, mDisplayNumber)); } else { mNumberView.setVisibility(View.GONE); mNumberView.setText(null); } }
/** * Updates the character limit display, coloring the text RED when the limit is reached or * exceeded. */ private void updateCharacterLimit() { String subjectText = mCallSubjectView.getText().toString(); final int length; // If a message encoding is specified, use that to count bytes in the message. if (mMessageEncoding != null) { length = subjectText.getBytes(mMessageEncoding).length; } else { // No message encoding specified, so just count characters entered. length = subjectText.length(); } mCharacterLimitView.setText( getString(R.string.call_subject_limit, length, mLimit)); if (length >= mLimit) { mCharacterLimitView.setTextColor(getResources().getColor( R.color.call_subject_limit_exceeded)); } else { mCharacterLimitView.setTextColor(getResources().getColor( R.color.dialtacts_secondary_text_color)); } }