Code example for Layout

Methods: getLineForVerticalgetOffsetForHorizontal

0
 
            x += widget.getScrollX();
            y += widget.getScrollY();
 
            Layout layout = widget.getLayout();
            int line = layout.getLineForVertical(y);
            int off = layout.getOffsetForHorizontal(line, x);
 
            MyURLSpan[] link = buffer.getSpans(off, off, MyURLSpan.class);
 
            if (link.length != 0) {
                if (action == MotionEvent.ACTION_UP) {
                    if (!mHasPerformedLongPress) {
                        link[0].onClick(widget);
                    } 
                    pressed = false;
                } else if (action == MotionEvent.ACTION_DOWN) {
                    pressed = true;
                    checkForLongClick(link, widget);
                    Selection.setSelection(buffer,
Stop searching for code, let great code find you!  Add Codota to your java IDE