public int getMaxLengthFromCurrentField(final EditText editText) {
        if (editText == eLonDeg || editText == eLatSub || editText == eLonSub) {
            return 3;
        }
        if ((editText == eLatMin || editText == eLonMin) && currentFormat == CoordInputFormatEnum.Deg) {
            return 5;
        }
        if ((editText == eLatSec || editText == eLonSec) && currentFormat == CoordInputFormatEnum.Min) {
            return 3;
        }
        return 2;
    }
Max lengths, depending on currentFormat
<br>
formatPlain = disabled
DEG MIN SEC SUB
formatDeg 2/3 5 - -
formatMin 2/3 2 3 -
formatSec 2/3 2 2 3
main/src/main/java/cgeo/geocaching/ui/dialog/CoordinatesInputDialog.java