TextView setLines - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for TextView setLines method.

This code example shows how to use the following methods:setGravity, setLines, setTextColor, setTextSize, setTypeface
    /** 
     * Configures text view. Is called for the TEXT_VIEW_ITEM_RESOURCE views. 
     * @param view the text view to be configured 
     */ 
    protected void configureTextView(TextView view) {
        view.setTextColor(textColor);
        view.setGravity(Gravity.CENTER);
        view.setTextSize(textSize);
        view.setLines(1);
        view.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD);
    } 
     
    /** 
     * Loads a text view from view 
     * @param view the text view or layout containing it 
     * @param textResource the text resource Id in layout 
     * @return the loaded text view 
     */ 
    private TextView getTextView(View view, int textResource) {
    	TextView text = null;
7
CodeRank
This code example shows how to use the following methods:setGravity, setLines, setTextColor, setTextSize, setTypeface
     * Configures text view. Is called for the TEXT_VIEW_ITEM_RESOURCE views. 
     * @param view the text view to be configured 
     */ 
    protected void configureTextView(TextView view) {
        if (itemResourceId == TEXT_VIEW_ITEM_RESOURCE) {
            view.setTextColor(textColor);
            view.setGravity(Gravity.CENTER);
            view.setTextSize(textSize);
            view.setLines(1);
        } 
        if (textTypeface != null) {
            view.setTypeface(textTypeface);
        } else { 
            view.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD);
        } 
    } 
     
    /** 
     * Loads a text view from view 
     * @param view the text view or layout containing it 
6
CodeRank
This code example shows how to use the following methods:setGravity, setInputType, setLines, setSingleLine, setText
    protected void applyBinding() { 
        if (txtWidget != null) {
            txtWidget.setText(getCurrentValue());
        } 
        if (editWidget != null) {
            editWidget.setText(getCurrentValue());
        } 
    } 
 
    @Override 
    public View buildView(LayoutContext context, LayoutMode mode, Document doc,
            List<String> attributeNames, WidgetDefinition widgetDef) {
 
        super.buildView(context, mode, doc, attributeNames, widgetDef);
 
        Context ctx = context.getActivity();
 
        View view = null;
        if (mode == LayoutMode.VIEW) {
            txtWidget = new TextView(ctx);

7
CodeRank
This code example shows how to use the following methods:setGravity, setInputType, setLines, setSingleLine, setText
        } 
        if (htmlWidget != null) {
            htmlWidget.loadData(getCurrentValue().get(0), "text/html", "UTF-8");
        } 
        if (editWidget != null) {
            editWidget.setText(getCurrentValue().get(0));
        } 
    } 
 
    @Override 
    public View buildView(LayoutContext context, LayoutMode mode, Document doc,
            List<String> attributeNames, WidgetDefinition widgetDef) {
 
        super.buildView(context, mode, doc, attributeNames, widgetDef);
 
        Context ctx = context.getActivity();
 
        if (mode == LayoutMode.VIEW) {
            container = new LinearLayout(ctx);
            container.setOrientation(LinearLayout.VERTICAL);

7
CodeRank
This code example shows how to use the following methods:setId, setLayoutParams, setEllipsize, setLineSpacing, setLines
6
CodeRank
This code example shows how to use the following methods:setLines
	EditText edit;
	 
	public FormElementLongText(Context context) {
		super(context);
		label = new TextView(this.getContext());
		edit = new EditText(this.getContext());
		this.addView(label);
		this.addView(edit);
		edit.setLines(4);
	} 
 
	@Override 
	public void setTitle(String v) {
		label.setText(v);
	} 
 
	@Override 
	public String getTitle() {
		return label.getText().toString();
	} 
5
CodeRank

Related TextView setLines Questions & Answers:

setLines Method Overview
Makes the TextView exactly this many lines tall.
See Code Examples for other Android TextView Methods: