Example usage for android.widget NumberPicker setVisibility

List of usage examples for android.widget NumberPicker setVisibility

Introduction

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

Prototype

@RemotableViewMethod
public void setVisibility(@Visibility int visibility) 

Source Link

Document

Set the visibility state of this view.

Usage

From source file:es.ugr.swad.swadroid.modules.tests.TestsMake.java

/**
 * Screen to select the number of questions in the test
 *//* w  w w  . j a v a 2  s  .co m*/
private void selectNumQuestions() {
    screenStep = ScreenStep.NUM_QUESTIONS;

    setLayout(R.layout.tests_num_questions);

    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
        android.widget.NumberPicker numberPicker = (android.widget.NumberPicker) findViewById(
                R.id.testNumQuestionsNumberPicker);

        numberPicker.setMaxValue(test.getMax());
        numberPicker.setMinValue(test.getMin());
        numberPicker.setValue(test.getDef());
        numberPicker.setVisibility(View.VISIBLE);
    } else {
        es.ugr.swad.swadroid.gui.widget.NumberPicker numberPickerOld = (es.ugr.swad.swadroid.gui.widget.NumberPicker) findViewById(
                R.id.testNumQuestionsNumberPickerOld);

        numberPickerOld.setRange(test.getMin(), test.getMax());
        numberPickerOld.setCurrent(test.getDef());
        numberPickerOld.setVisibility(View.VISIBLE);
    }
}