Example usage for android.text Layout getText

List of usage examples for android.text Layout getText

Introduction

In this page you can find the example usage for android.text Layout getText.

Prototype

public final CharSequence getText() 

Source Link

Document

Return the text that is displayed by this Layout.

Usage

From source file:com.duy.pascal.ui.editor.view.LineUtils.java

/**
 * @param editable - edit text//from  w  w w . j  av  a 2 s  .co  m
 * @param line   - current line
 * @param col    - column index at current line
 * @return the index at (line:col)
 */
public static int getIndexFromLineCol(Layout editable, int line, int col) {
    int index = editable.getLineStart(line);
    index += col;
    return Math.min(index, editable.getText().length());
}