Android TwoLineListItem - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android TwoLineListItem class.

This code example shows how to use the following methods:getText1, getText2
		} else { 
			view = (TwoLineListItem) convertView;
		} 
 
		// Set value for the first text field 
		TextView textView1 = view.getText1();
		if (textView1!=null) {
			Book book = translationDto.getBook();
			textView1.setText(book.getInitials());
		} 
 
		// set value for the second text field 
		TextView textView2 = view.getText2();
		if (textView2!=null) {
			// but first, this book may require a custom font to display it 
			if (translationDto.getCustomFontFile()!=null) {
				Typeface typeFace = Typeface.createFromFile(translationDto.getCustomFontFile());
				textView2.setTypeface(typeFace, Typeface.NORMAL);
			} else { 
				// reset typeface in case this TwoLineListItemView is being reused 
6
CodeRank
This code example shows how to use the following methods:getText1, getText2
		} else { 
			view = (TwoLineListItem) convertView;
		} 
 
		// Set value for the first text field 
		if (view.getText1() != null) {
			String line1 = item.getDayDesc();
			view.getText1().setText(line1);
		} 
 
		// set value for the second text field 
		if (view.getText2() != null) {
			String line2 = item.getReadingsDesc();
			view.getText2().setText(line2);
		} 
		 
		return view;
	} 
} 
6
CodeRank
This code example shows how to use the following methods:findViewById
This code example shows how to use the following methods:getText1, getText2
		} else { 
			view = (TwoLineListItem) convertView;
		} 
 
		// Set value for the first text field 
		if (view.getText1() != null) {
			String text = item.getCode();
			view.getText1().setText(text);
		} 
 
		// set value for the second text field 
		if (view.getText2() != null) {
			String text = item.getDescription();
			view.getText2().setText(text);
		} 
 
		return view;
	} 
} 
6
CodeRank
This code example shows how to use the following methods:getText1, getText2
		} else { 
			view = (TwoLineListItem) convertView;
		} 
 
		// Set value for the first text field 
		if (view.getText1() != null) {
			String summary = item.getSummary();
			view.getText1().setText(Html.fromHtml(summary));
		} 
 
		// set value for the second text field 
		if (view.getText2() != null) {
			String detail = item.getDetail();
			view.getText2().setText(Html.fromHtml(detail));
		} 
 
		return view;
	} 
} 
6
CodeRank
This code example shows how to use the following methods:getText1, getText2
		} else { 
			view = (TwoLineListItem) convertView;
		} 
 
		// Set value for the first text field 
		if (view.getText1() != null) {
			String key = item.getName();
			view.getText1().setText(key);
		} 
 
		// set value for the second text field 
		if (view.getText2() != null) {
			String verseText = searchControl.getSearchResultVerseText(item);
			view.getText2().setText(verseText);
		} 
 
		return view;
	} 
} 
6
CodeRank
This code example shows how to use the following methods:getText1, getText2
 
            // Set the item title and description into the view. 
            // This example does not render real HTML, so as a hack to make 
            // the description look better, we strip out the 
            // tags and take just the first SNIPPET_LENGTH chars. 
            view.getText1().setText(item.getTitle());
            String descr = item.getDescription().toString();
            descr = removeTags(descr);
            view.getText2().setText(descr.substring(0, Math.min(descr.length(), SNIPPET_LENGTH)));
            return view;
        } 
 
    } 
 
    /** 
     * Simple code to strip out <tag>s -- primitive way to sortof display HTML as 
     * plain text. 
     */ 
    public String removeTags(String str) {
        str = str.replaceAll("<.*?>", " ");
6
CodeRank
This code example shows how to use the following methods:getText1, getText2
		return view;
	} 
 
	private TwoLineListItem createView(ViewGroup parent) {
		TwoLineListItem item = (TwoLineListItem) layoutInflator.inflate(android.R.layout.simple_list_item_2, parent, false);
		item.getText1().setSingleLine();
		item.getText2().setSingleLine();
		item.getText1().setEllipsize(TextUtils.TruncateAt.END);
		item.getText2().setEllipsize(TextUtils.TruncateAt.END);
		return item;
	} 
 
} 
6
CodeRank
This code example shows how to use the following methods:getText1, getText2
        } else { 
            view = (TwoLineListItem) convertView;
        } 
  
        // Set value for the first text field 
        if (view.getText1() != null) {
            view.getText1().setText(c.getName());
        } 
  
        // set value for the second text field 
        if (view.getText2() != null) {
            view.getText2().setText(c.getNumber());
        } 
  
        return view;
    } 
  
    public int getPositionForSection(int section) {
        String letter = sections[section];
        return alphaIndexer.get(letter);
6
CodeRank
This code example shows how to use the following methods:getText1, getText2
        // TODO Auto-generated method stub 
        super.onBindView(view);
 
        mUrl = (TwoLineListItem) view;
 
        mUrl.getText1().setText(getTitle());
        mUrl.getText2().setText(getPersistedString(url));
    } 
 
    @Override 
    protected View onCreateDialogView() {
        // TODO Auto-generated method stub 
 
        mEditText = new EditText(getContext());
        return mEditText;
    } 
 
    @Override 
    protected void onDialogClosed(boolean positiveResult) {
        super.onDialogClosed(positiveResult);
5
CodeRank

Related Android TwoLineListItem Questions & Answers:

See Code Examples for Android TwoLineListItem Methods: