<commit_before>package com.xtremelabs.droidsugar.view;

import java.awt.*;

import android.widget.TextView;

@SuppressWarnings({"ALL"})
public class FakeTextView extends FakeView {
    private CharSequence text;
    Rectangle rectangle;
    public Directions compoundDrawablesWithIntrinsicBounds;

    public FakeTextView(TextView view) {
        super(view);
    }

    public final void setText(CharSequence text) {
        this.text = text;
    }

    public final void setText(int titleRes) {
        this.text = "text from resource"; // todo: actually fetch strings
    }

    public CharSequence getText() {
        return text;
    }

    public void setCompoundDrawablesWithIntrinsicBounds(int left, int top, int right, int bottom) {
        compoundDrawablesWithIntrinsicBounds = new Directions(left, top , right, bottom);
    }

    public class Directions {
        public int left;
        public int top;
        public int right;
        public int bottom;<commit_msg>Prefer to pass around TweetCursors over Cursors.<commit_after>package com.xtremelabs.droidsugar.view;

import java.util.ArrayList;
import java.util.List;

import android.text.style.URLSpan;
import android.widget.TextView;

@SuppressWarnings({"ALL"})
public class FakeTextView extends FakeView {
    private CharSequence text;
    public Directions compoundDrawablesWithIntrinsicBounds;

    public FakeTextView(TextView view) {
        super(view);
    }

    public final void setText(CharSequence text) {
        this.text = text;
    }

    public final void setText(int titleRes) {
        this.text = "text from resource"; // todo: actually fetch strings
    }

    public CharSequence getText() {
        return text;
    }

    public URLSpan[] getUrls() {
        String[] words = text.toString().split("\\s+");
        List<URLSpan> urlSpans = new ArrayList<URLSpan>();
        for (String word : words) {
            if (word.startsWith("http://")) {
                urlSpans.add(new URLSpan(word));
            }
        }
        return urlSpans.toArray(new URLSpan[urlSpans.size()]);
    }

    public void setCompoundDrawablesWithIntrinsicBounds(int left, int top, int right, int bottom) {
        compoundDrawablesWithIntrinsicBounds = new Directions(left, top , right, bottom);
    }

    public class Directions {
        public int left;
        public int top;
        public int right;
        public int bottom;
{'fraction_non_alphanumeric': 0.08989229494614748, 'fraction_numerical': 0.0, 'mean_word_length': 2.8455414012738856, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7584804', 'n_tokens_mistral': 684, 'n_tokens_neox': 670, 'n_words': 188}