<commit_before>package com.dreiri.stolpersteine.utils;

import android.app.Activity;
import android.graphics.drawable.Drawable;
import android.text.SpannableString;
import android.text.style.ImageSpan;
import android.widget.TextView;


public class UIEnhancer {

    public static void insertImageIntoTextView(Activity activity, int imageResource, int textViewResource) {
        TextView textView = (TextView) activity.findViewById(textViewResource);
        CharSequence text = " " + textView.getText();
        addImageIntoTextView(activity, imageResource, textView, text, 0, 1);
    }
    
    public static void appendImageIntoTextView(Activity activity, int imageResource, int textViewResource) {
        TextView textView = (TextView) activity.findViewById(textViewResource);
        CharSequence text = textView.getText() + " ";
        addImageIntoTextView(activity, imageResource, textView, text, text.length() - 1, text.length());
    }
    
    private static void addImageIntoTextView(Activity activity, int imageResource, TextView textView, CharSequence text, int start, int end) {
        SpannableString spannableString = new SpannableString(text);
        Drawable image = activity.getResources().getDrawable(imageResource);
        image.setBounds(0, 0, image.getIntrinsicWidth(), image.getIntrinsicHeight());
        spannableString.setSpan(new ImageSpan(image, ImageSpan.ALIGN_BASELINE), start, end, SpannableString.SPAN_INCLUSIVE_EXCLUSIVE);
        textView.setText(spannableString);
    }

}<commit_msg>Modified ImageSpan to ALIGN_BOTTOM instead of ALIGN_BASELINE<commit_after>package com.dreiri.stolpersteine.utils;

import android.app.Activity;
import android.graphics.drawable.Drawable;
import android.text.SpannableString;
import android.text.style.ImageSpan;
import android.widget.TextView;


public class UIEnhancer {

    public static void insertImageIntoTextView(Activity activity, int imageResource, int textViewResource) {
        TextView textView = (TextView) activity.findViewById(textViewResource);
        CharSequence text = " " + textView.getText();
        addImageIntoTextView(activity, imageResource, textView, text, 0, 1);
    }
    
    public static void appendImageIntoTextView(Activity activity, int imageResource, int textViewResource) {
        TextView textView = (TextView) activity.findViewById(textViewResource);
        CharSequence text = textView.getText() + " ";
        addImageIntoTextView(activity, imageResource, textView, text, text.length() - 1, text.length());
    }
    
    private static void addImageIntoTextView(Activity activity, int imageResource, TextView textView, CharSequence text, int start, int end) {
        SpannableString spannableString = new SpannableString(text);
        Drawable image = activity.getResources().getDrawable(imageResource);
        image.setBounds(0, 0, image.getIntrinsicWidth(), image.getIntrinsicHeight());
        spannableString.setSpan(new ImageSpan(image, ImageSpan.ALIGN_BOTTOM), start, end, SpannableString.SPAN_INCLUSIVE_EXCLUSIVE);
        textView.setText(spannableString);
    }

}
{'fraction_non_alphanumeric': 0.09105586051017113, 'fraction_numerical': 0.0032289312237649337, 'mean_word_length': 4.6429872495446265, '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': '1080163', 'n_tokens_mistral': 856, 'n_tokens_neox': 830, 'n_words': 192}