@Override public void onItemSelected(AdapterView<?> parent, View view, final int position, long id) { final ArrayAdapter<String> adapter = ((ArrayAdapter<String>) mUnits.getAdapter()); if (mEvents != null && mCurrentUnit != null && !adapter.getItem(position).equals(mCurrentUnit)) { mEvents.onUnitChange(mUnits.getItemAtPosition(position).toString()); mCurrentUnit = adapter.getItem(position); } }
@Override public void onValueChange(NumberPicker picker, int oldVal, int newVal) { if (mEvents != null) mEvents.onRunningAverageChange(newVal); }
@Override public void onClick(View v) { if (v.getId() == R.id.clear_button) { mEvents.onClearRequest(); } }
@Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (mEvents != null) mEvents.onAutoScaleChange(isChecked); }