<commit_before>package ee.ria.DigiDoc.android.utils.widget;

import android.app.Dialog;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.CheckBox;

import androidx.annotation.NonNull;

import ee.ria.DigiDoc.R;
import ee.ria.DigiDoc.android.Activity;

public class NotificationDialog extends Dialog {

    public NotificationDialog(@NonNull Activity context) {
        super(context);
        getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
        setContentView(R.layout.success_notification_dialog);
        Button okButton = findViewById(R.id.okButton);
        okButton.setOnClickListener(v -> {
            CheckBox checkBox = (CheckBox) findViewById(R.id.successNotificationDontShowAgain);
            if (checkBox.isChecked()) {
                context.getSettingsDataStore().setShowSuccessNotification(false);
            }
            dismiss();
        });
    }

}<commit_msg>Hide decryption success dialog from screen recorders<commit_after>package ee.ria.DigiDoc.android.utils.widget;

import android.app.Dialog;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.CheckBox;

import androidx.annotation.NonNull;

import ee.ria.DigiDoc.R;
import ee.ria.DigiDoc.android.Activity;
import ee.ria.DigiDoc.android.utils.SecureUtil;

public class NotificationDialog extends Dialog {

    public NotificationDialog(@NonNull Activity context) {
        super(context);
        SecureUtil.markAsSecure(getWindow());
        getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
        setContentView(R.layout.success_notification_dialog);
        Button okButton = findViewById(R.id.okButton);
        okButton.setOnClickListener(v -> {
            CheckBox checkBox = (CheckBox) findViewById(R.id.successNotificationDontShowAgain);
            if (checkBox.isChecked()) {
                context.getSettingsDataStore().setShowSuccessNotification(false);
            }
            dismiss();
        });
    }

}
{'fraction_non_alphanumeric': 0.09985170538803757, 'fraction_numerical': 0.0, 'mean_word_length': 3.517857142857143, 'pattern_counts': {'":': 0, '<': 3, '<?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': '142199', 'n_tokens_mistral': 570, 'n_tokens_neox': 556, 'n_words': 89}