@Test public void shouldReturnEmptyStringWhenNoDestAndSourceValues() { ifmm = new InputFilterMinMax("4", "4"); assertEquals("", ifmm.filter("", 0, 0, new SpannableString(""), 0, 0)); }
@Override public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { try { double input = ReadingTools.safeParseDouble(dest.toString() + source.toString()); if (isInRange(min, max, input)) return null; } catch (NumberFormatException nfe) { Log.e(TAG, "filter: ", nfe); } return ""; }
InputFilterMinMax implements InputFilter { @Override public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { try { double input = ReadingTools.safeParseDouble(dest.toString() + source.toString()); if (isInRange(min, max, input)) return null; } catch (NumberFormatException nfe) { Log.e(TAG, "filter: ", nfe); } return ""; } }
InputFilterMinMax implements InputFilter { @Override public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { try { double input = ReadingTools.safeParseDouble(dest.toString() + source.toString()); if (isInRange(min, max, input)) return null; } catch (NumberFormatException nfe) { Log.e(TAG, "filter: ", nfe); } return ""; } InputFilterMinMax(double min, double max);  InputFilterMinMax(String min, String max); }
InputFilterMinMax implements InputFilter { @Override public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { try { double input = ReadingTools.safeParseDouble(dest.toString() + source.toString()); if (isInRange(min, max, input)) return null; } catch (NumberFormatException nfe) { Log.e(TAG, "filter: ", nfe); } return ""; } InputFilterMinMax(double min, double max);  InputFilterMinMax(String min, String max); @Override CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend); }
InputFilterMinMax implements InputFilter { @Override public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { try { double input = ReadingTools.safeParseDouble(dest.toString() + source.toString()); if (isInRange(min, max, input)) return null; } catch (NumberFormatException nfe) { Log.e(TAG, "filter: ", nfe); } return ""; } InputFilterMinMax(double min, double max);  InputFilterMinMax(String min, String max); @Override CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend);  }