// Path: app/src/main/java/com/joanzapata/iconify/Icon.java
// public interface Icon {
// 
//     /** The key of icon, for example 'fa-ok' */
//     String key();
// 
//     /** The character matching the key in the font, for example '\u4354' */
//     char character();
// 
// }
// 
// Path: app/src/main/java/com/joanzapata/iconify/internal/HasOnViewAttachListener.java
// interface OnViewAttachListener {
//     void onAttach();
// 
//     void onDetach();
// }


import java.util.List;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Color;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.util.TypedValue;
import android.widget.TextView;
import androidx.core.view.ViewCompat;
import com.joanzapata.iconify.Icon;
import com.joanzapata.iconify.internal.HasOnViewAttachListener.OnViewAttachListener;
    private static boolean hasAnimatedSpans(SpannableStringBuilder spannableBuilder) {
        CustomTypefaceSpan[] spans = spannableBuilder.getSpans(0, spannableBuilder.length(), CustomTypefaceSpan.class);
        for (CustomTypefaceSpan span : spans) {
            if (span.isAnimated())
                return true;
        }
        return false;
    }

    private static void recursivePrepareSpannableIndexes(
            Context context,
            String fullText,
            SpannableStringBuilder text,
            List<IconFontDescriptorWrapper> iconFontDescriptors,
            int start) {

        // Try to find a {...} in the string and extract expression from it
        String stringText = text.toString();
        int startIndex = stringText.indexOf("{", start);
        if (startIndex == -1) return;
        int endIndex = stringText.indexOf("}", startIndex) + 1;
        if (endIndex == -1) return;
        String expression = stringText.substring(startIndex + 1, endIndex - 1);

        // Split the expression and retrieve the icon key
        String[] strokes = expression.split(" ");
        String key = strokes[0];

        // Loop through the descriptors to find a key match
        IconFontDescriptorWrapper iconFontDescriptor = null;
// Path: app/src/main/java/com/joanzapata/iconify/Icon.java
// public interface Icon {
// 
//     /** The key of icon, for example 'fa-ok' */
//     String key();
// 
//     /** The character matching the key in the font, for example '\u4354' */
//     char character();
// 
// }
// 
// Path: app/src/main/java/com/joanzapata/iconify/internal/HasOnViewAttachListener.java
// interface OnViewAttachListener {
//     void onAttach();
// 
//     void onDetach();
// }


// Path: app/src/main/java/com/joanzapata/iconify/internal/ParsingUtil.java
import java.util.List;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Color;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.util.TypedValue;
import android.widget.TextView;
import androidx.core.view.ViewCompat;
import com.joanzapata.iconify.Icon;
import com.joanzapata.iconify.internal.HasOnViewAttachListener.OnViewAttachListener;

    private static boolean hasAnimatedSpans(SpannableStringBuilder spannableBuilder) {
        CustomTypefaceSpan[] spans = spannableBuilder.getSpans(0, spannableBuilder.length(), CustomTypefaceSpan.class);
        for (CustomTypefaceSpan span : spans) {
            if (span.isAnimated())
                return true;
        }
        return false;
    }

    private static void recursivePrepareSpannableIndexes(
            Context context,
            String fullText,
            SpannableStringBuilder text,
            List<IconFontDescriptorWrapper> iconFontDescriptors,
            int start) {

        // Try to find a {...} in the string and extract expression from it
        String stringText = text.toString();
        int startIndex = stringText.indexOf("{", start);
        if (startIndex == -1) return;
        int endIndex = stringText.indexOf("}", startIndex) + 1;
        if (endIndex == -1) return;
        String expression = stringText.substring(startIndex + 1, endIndex - 1);

        // Split the expression and retrieve the icon key
        String[] strokes = expression.split(" ");
        String key = strokes[0];

        // Loop through the descriptors to find a key match
        IconFontDescriptorWrapper iconFontDescriptor = null;
        Icon icon = null;