use of com.xabber.android.data.message.phrase.Phrase in project xabber-android by redsolution.
the class PhraseListAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view;
if (convertView == null) {
view = getActivity().getLayoutInflater().inflate(R.layout.preference, parent, false);
} else {
view = convertView;
}
Phrase phrase = PhraseManager.getInstance().getPhrase(getItem(position));
String title = phrase.getText();
if ("".equals(title))
title = getActivity().getString(R.string.phrase_empty);
String message = "";
if (!"".equals(phrase.getUser()))
message = append(message, getActivity().getString(R.string.phrase_user) + ": " + phrase.getUser());
if (!"".equals(phrase.getGroup()))
message = append(message, getActivity().getString(R.string.phrase_group) + ": " + phrase.getGroup());
if (phrase.isRegexp())
message = append(message, getActivity().getString(R.string.phrase_regexp));
((TextView) view.findViewById(android.R.id.title)).setText(title);
((TextView) view.findViewById(android.R.id.summary)).setText(message);
return view;
}
Aggregations