<commit_before>package sample.github.nisrulz.customview;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.view.View;

public class CustomView extends View {

  Paint paint = new Paint();

  public CustomView(Context context) {
    super(context);

    paint.setColor(Color.BLACK);
    paint.setTextSize(30);
  }

  @Override protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);

    setBackgroundColor(Color.BLUE);
    canvas.drawText("Custom Text", 100, 100, paint);

  }


}<commit_msg>Added demonstration of `invalidate()`<commit_after>package sample.github.nisrulz.customview;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.view.View;

public class CustomView extends View {

  Paint paint = new Paint();
  String text = "Custom Text";

  public CustomView(Context context) {
    super(context);

    paint.setColor(Color.BLACK);
    paint.setTextSize(30);
  }

  @Override protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);

    setBackgroundColor(Color.BLUE);
    canvas.drawText(text, 100, 100, paint);

  }
  
  public void setText(String text) {
    this.text = text;
    invalidate();
  }


}
{'fraction_non_alphanumeric': 0.11246200607902736, 'fraction_numerical': 0.0121580547112462, 'mean_word_length': 4.226190476190476, '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': '6543799', 'n_tokens_mistral': 426, 'n_tokens_neox': 394, 'n_words': 91}