private void init(final AttributeSet attrs, final int defStyleAttr, final int defStyleRes) {

        setOrientation(VERTICAL);
        final ContextThemeWrapper ctw = new ContextThemeWrapper(getContext(), R.style.cgeo);
        inflate(ctw, R.layout.formula_edittext_view, this);
        binding = FormulaEdittextViewBinding.bind(this);
        binding.formulaText.addTextChangedListener(ViewUtils.createSimpleWatcher(editable -> processFormulaChange()));
        binding.formulaFunction.setOnClickListener(l -> FormulaUtils.showSelectFunctionDialog(getContext(), binding.formulaText, newFormula -> processFormulaChange()));

        ViewUtils.consumeAttributes(getContext(), attrs, R.styleable.FormulaEditText, defStyleAttr, defStyleRes, typedArray -> setHint(typedArray.getString(R.styleable.FormulaEditText_hint)));

        processFormulaChange();
    }
Allows live-editing of a formula, optionally associated with a Variable List
main/src/main/java/cgeo/geocaching/ui/FormulaEditText.java