<commit_before>package cgeo.geocaching;

import cgeo.geocaching.databinding.StatusBinding;
import cgeo.geocaching.network.StatusUpdater;
import cgeo.geocaching.network.StatusUpdater.Status;
import cgeo.geocaching.utils.AndroidRxUtils;
import cgeo.geocaching.utils.Log;
import cgeo.geocaching.utils.ShareUtils;

import android.content.res.Resources;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;

import io.reactivex.rxjava3.disposables.CompositeDisposable;

public class StatusFragment extends Fragment {

    private final CompositeDisposable statusSubscription = new CompositeDisposable();
    private StatusBinding binding;

    @Override
    public View onCreateView(@NonNull final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) {
        super.onCreateView(inflater, container, savedInstanceState);
        binding = StatusBinding.inflate(getLayoutInflater(), container, false);
        final ViewGroup statusGroup = binding.getRoot();
        statusSubscription.add(AndroidRxUtils.bindFragment(this, StatusUpdater.LATEST_STATUS)
                .subscribe(status -> {
                    if (status == Status.NO_STATUS) {
                        statusGroup.setVisibility(View.INVISIBLE);
                        return;
                    }

                    final Resources res = getResources();
                    final String packageName = getActivity().getPackageName();

                    if (status.icon != null) {
                        final int iconId = res.getIdentifier(status.icon, "drawable", packageName);
                        if (iconId != 0) {
                            binding.statusIcon.setImageResource(iconId);
                            binding.statusIcon.setVisibility(View.VISIBLE);
                        } else {
                            Log.w("StatusHandler: could not find icon corresponding to @drawable/" + status.icon);
                            binding.statusIcon.setVisibility(View.GONE);
                        }
                    } else {
                        binding.statusIcon.setVisibility(View.GONE);
                    }

                    String message = status.message;
                    if (status.messageId != null) {
                        final int messageId = res.getIdentifier(status.messageId, "string", packageName);
                        if (messageId != 0) {
                            message = res.getString(messageId);
                        }
                    }

                    binding.statusMessage.setText(message);
                    statusGroup.setVisibility(View.VISIBLE);

                    if (status.url != null) {
                        statusGroup.setOnClickListener(v -> ShareUtils.openUrl(this.getContext(), status.url));
                    } else {
                        statusGroup.setClickable(false);
                    }
                }));
        return statusGroup;
    }

    @Override
    public void onDestroyView() {
        statusSubscription.clear();
        super.onDestroyView();
    }

}
<commit_msg>don't use Chrome Webview for status message links<commit_after>package cgeo.geocaching;

import cgeo.geocaching.databinding.StatusBinding;
import cgeo.geocaching.network.StatusUpdater;
import cgeo.geocaching.network.StatusUpdater.Status;
import cgeo.geocaching.utils.AndroidRxUtils;
import cgeo.geocaching.utils.Log;

import android.content.Intent;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;

import io.reactivex.rxjava3.disposables.CompositeDisposable;

public class StatusFragment extends Fragment {

    private final CompositeDisposable statusSubscription = new CompositeDisposable();
    private StatusBinding binding;

    @Override
    public View onCreateView(@NonNull final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) {
        super.onCreateView(inflater, container, savedInstanceState);
        binding = StatusBinding.inflate(getLayoutInflater(), container, false);
        final ViewGroup statusGroup = binding.getRoot();
        statusSubscription.add(AndroidRxUtils.bindFragment(this, StatusUpdater.LATEST_STATUS)
                .subscribe(status -> {
                    if (status == Status.NO_STATUS) {
                        statusGroup.setVisibility(View.INVISIBLE);
                        return;
                    }

                    final Resources res = getResources();
                    final String packageName = getActivity().getPackageName();

                    if (status.icon != null) {
                        final int iconId = res.getIdentifier(status.icon, "drawable", packageName);
                        if (iconId != 0) {
                            binding.statusIcon.setImageResource(iconId);
                            binding.statusIcon.setVisibility(View.VISIBLE);
                        } else {
                            Log.w("StatusHandler: could not find icon corresponding to @drawable/" + status.icon);
                            binding.statusIcon.setVisibility(View.GONE);
                        }
                    } else {
                        binding.statusIcon.setVisibility(View.GONE);
                    }

                    String message = status.message;
                    if (status.messageId != null) {
                        final int messageId = res.getIdentifier(status.messageId, "string", packageName);
                        if (messageId != 0) {
                            message = res.getString(messageId);
                        }
                    }

                    binding.statusMessage.setText(message);
                    statusGroup.setVisibility(View.VISIBLE);

                    if (status.url != null) {
                        statusGroup.setOnClickListener(v -> startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(status.url)))); // don't use ShareUtils here. E.g. we want to redirect directly to PlayStore even if "use WebView" is set
                    } else {
                        statusGroup.setClickable(false);
                    }
                }));
        return statusGroup;
    }

    @Override
    public void onDestroyView() {
        statusSubscription.clear();
        super.onDestroyView();
    }

}

{'fraction_non_alphanumeric': 0.08510317818948637, 'fraction_numerical': 0.0009037505648441031, 'mean_word_length': 1.8694900605012965, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4143021', 'n_tokens_mistral': 1643, 'n_tokens_neox': 1536, 'n_words': 320}