@Override
    public void onBindViewHolder(@NonNull final PreferenceViewHolder holder) {
        super.onBindViewHolder(holder);
        final Preference pref = findPreferenceInHierarchy(getKey());
        if (pref != null) {
            pref.setOnPreferenceClickListener(preference -> {
                launchEditTemplateDialog();
                return false;
            });
            if (!getKey().equals(getContext().getString(R.string.pref_signature))) {
                final MaterialButton button = (MaterialButton) holder.findViewById(R.id.iconview);
                button.setIconResource(R.drawable.ic_menu_delete);
                button.setOnClickListener(v -> SimpleDialog.ofContext(getContext()).setTitle(R.string.init_log_template).setMessage(R.string.init_log_template_remove_confirm).confirm(() -> {
                    Settings.putLogTemplate(new Settings.PrefLogTemplate(getKey(), null, null));
                    callChangeListener(null);
                }));
            }
        }
    }
default value, if none is given in the preference XML.
main/src/main/java/cgeo/geocaching/settings/TemplateTextPreference.java