コード例 #1
0
 @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);
   }
 }
コード例 #2
0
 @Override
 public void onValueChange(NumberPicker picker, int oldVal, int newVal) {
   if (mEvents != null) mEvents.onRunningAverageChange(newVal);
 }
コード例 #3
0
 @Override
 public void onClick(View v) {
   if (v.getId() == R.id.clear_button) {
     mEvents.onClearRequest();
   }
 }
コード例 #4
0
 @Override
 public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
   if (mEvents != null) mEvents.onAutoScaleChange(isChecked);
 }