Example usage for android.widget NumberPicker clearFocus

List of usage examples for android.widget NumberPicker clearFocus

Introduction

In this page you can find the example usage for android.widget NumberPicker clearFocus.

Prototype

@Override
    public void clearFocus() 

Source Link

Usage

From source file:com.lambdasoup.quickfit.ui.CaloriesDialogFragment.java

@Override
public void onClick(DialogInterface dialog, int which) {
    switch (which) {
    case DialogInterface.BUTTON_POSITIVE:
        NumberPicker numberPicker = ((NumberPicker) getDialog().findViewById(R.id.calories_picker));
        numberPicker.clearFocus();
        int newVal = numberPicker.getValue();
        listener.onCaloriesChanged(getArguments().getLong(KEY_WORKOUT_ID), newVal);
        break;/*from   w  w w  .  ja v a 2s  .  c  o m*/
    case DialogInterface.BUTTON_NEGATIVE:
        break;
    default:
        throw new IllegalStateException("No such button.");
    }
}

From source file:com.lambdasoup.quickfit.ui.DurationMinutesDialogFragment.java

@Override
public void onClick(DialogInterface dialog, int which) {
    switch (which) {
    case DialogInterface.BUTTON_POSITIVE:
        NumberPicker numberPicker = ((NumberPicker) getDialog().findViewById(R.id.duration_mins_picker));
        numberPicker.clearFocus();
        int newVal = numberPicker.getValue();
        listener.onDurationChanged(getArguments().getLong(KEY_WORKOUT_ID), newVal);
        break;//from   w  ww  .  j  a  v a 2  s. c  o  m
    case DialogInterface.BUTTON_NEGATIVE:
        break;
    default:
        throw new IllegalStateException("No such button.");
    }
}