<commit_before>package com.sampsonjoliver.firestarter.views;

import android.content.Context;
import android.graphics.Typeface;
import android.support.v7.widget.AppCompatTextView;
import android.util.AttributeSet;

public class FontIconView extends AppCompatTextView {
    private static Typeface iconFontTypeface;
    public static final String iconFontFile = "fonts/MaterialIcons-Regular.ttf";

    public FontIconView(Context context) {
        this(context, null);
    }

    public FontIconView(Context context, AttributeSet attrs) {
        this(context, attrs, android.R.attr.textViewStyle);
    }

    public FontIconView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);

        if (iconFontTypeface == null)
            iconFontTypeface = Typeface.createFromAsset(context.getAssets(), iconFontFile);

        setTypeface(iconFontTypeface);
    }
}<commit_msg>Fix for FontIconView when viewing in edit mode (in XML preview). This doesn't render the actual font image, but for some reason the preview renderer is failing to retrieve the font and throwing an exception<commit_after>package com.sampsonjoliver.firestarter.views;

import android.content.Context;
import android.graphics.Typeface;
import android.support.v7.widget.AppCompatTextView;
import android.util.AttributeSet;

public class FontIconView extends AppCompatTextView {
    private static Typeface iconFontTypeface;
    public static final String iconFontFile = "fonts/MaterialIcons-Regular.ttf";

    public FontIconView(Context context) {
        this(context, null);
    }

    public FontIconView(Context context, AttributeSet attrs) {
        this(context, attrs, android.R.attr.textViewStyle);
    }

    public FontIconView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);

        if (!isInEditMode()) {
            if (iconFontTypeface == null)
                iconFontTypeface = Typeface.createFromAsset(context.getAssets(), iconFontFile);

            setTypeface(iconFontTypeface);
        }
    }
}
{'fraction_non_alphanumeric': 0.08196721311475409, 'fraction_numerical': 0.0009643201542912247, 'mean_word_length': 3.9170616113744074, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3874188', 'n_tokens_mistral': 569, 'n_tokens_neox': 557, 'n_words': 146}