本文整理汇总了Java中org.eyeseetea.malariacare.views.filters.MinMaxInputFilter类的典型用法代码示例。如果您正苦于以下问题:Java MinMaxInputFilter类的具体用法?Java MinMaxInputFilter怎么用?Java MinMaxInputFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MinMaxInputFilter类属于org.eyeseetea.malariacare.views.filters包,在下文中一共展示了MinMaxInputFilter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: no_bounds_null_accepted
import org.eyeseetea.malariacare.views.filters.MinMaxInputFilter; //导入依赖的package包/类
@Test
public void no_bounds_null_accepted(){
//GIVEN
MinMaxInputFilter minMaxInputFilter=new MinMaxInputFilter(null);
//WHEN
boolean result=minMaxInputFilter.inRange(null);
//THEN
assertTrue(result);
}
示例2: no_min_null_rejected
import org.eyeseetea.malariacare.views.filters.MinMaxInputFilter; //导入依赖的package包/类
@Test
public void no_min_null_rejected(){
//GIVEN
MinMaxInputFilter minMaxInputFilter=new MinMaxInputFilter(null,10);
//WHEN
boolean result=minMaxInputFilter.inRange(null);
//THEN
assertFalse(result);
}
示例3: no_max_null_rejected
import org.eyeseetea.malariacare.views.filters.MinMaxInputFilter; //导入依赖的package包/类
@Test
public void no_max_null_rejected(){
//GIVEN
MinMaxInputFilter minMaxInputFilter=new MinMaxInputFilter(5,null);
//WHEN
boolean result=minMaxInputFilter.inRange(null);
//THEN
assertFalse(result);
}
示例4: no_max_value_accepted
import org.eyeseetea.malariacare.views.filters.MinMaxInputFilter; //导入依赖的package包/类
@Test
public void no_max_value_accepted(){
//GIVEN
MinMaxInputFilter minMaxInputFilter=new MinMaxInputFilter(5,null);
//WHEN
boolean result=minMaxInputFilter.inRange(5);
//THEN
assertTrue(result);
}
示例5: bounds_set_value_inside_accepted
import org.eyeseetea.malariacare.views.filters.MinMaxInputFilter; //导入依赖的package包/类
@Test
public void bounds_set_value_inside_accepted(){
//GIVEN
MinMaxInputFilter minMaxInputFilter=new MinMaxInputFilter(0,10);
//WHEN
boolean result=minMaxInputFilter.inRange(5);
//THEN
assertTrue(result);
}
示例6: bounds_set_value_outside_rejected
import org.eyeseetea.malariacare.views.filters.MinMaxInputFilter; //导入依赖的package包/类
@Test
public void bounds_set_value_outside_rejected(){
//GIVEN
MinMaxInputFilter minMaxInputFilter=new MinMaxInputFilter(0,10);
//WHEN
boolean result=minMaxInputFilter.inRange(-5);
//THEN
assertFalse(result);
}
示例7: no_bounds_null_accepted
import org.eyeseetea.malariacare.views.filters.MinMaxInputFilter; //导入依赖的package包/类
@Test
public void no_bounds_null_accepted() {
//GIVEN
MinMaxInputFilter minMaxInputFilter = new MinMaxInputFilter(null);
//WHEN
boolean result = minMaxInputFilter.inRange(null);
//THEN
assertTrue(result);
}
示例8: no_min_null_rejected
import org.eyeseetea.malariacare.views.filters.MinMaxInputFilter; //导入依赖的package包/类
@Test
public void no_min_null_rejected() {
//GIVEN
MinMaxInputFilter minMaxInputFilter = new MinMaxInputFilter(null, 10);
//WHEN
boolean result = minMaxInputFilter.inRange(null);
//THEN
assertFalse(result);
}
示例9: no_max_null_rejected
import org.eyeseetea.malariacare.views.filters.MinMaxInputFilter; //导入依赖的package包/类
@Test
public void no_max_null_rejected() {
//GIVEN
MinMaxInputFilter minMaxInputFilter = new MinMaxInputFilter(5, null);
//WHEN
boolean result = minMaxInputFilter.inRange(null);
//THEN
assertFalse(result);
}
示例10: no_max_value_accepted
import org.eyeseetea.malariacare.views.filters.MinMaxInputFilter; //导入依赖的package包/类
@Test
public void no_max_value_accepted() {
//GIVEN
MinMaxInputFilter minMaxInputFilter = new MinMaxInputFilter(5, null);
//WHEN
boolean result = minMaxInputFilter.inRange(5);
//THEN
assertTrue(result);
}
示例11: bounds_set_value_inside_accepted
import org.eyeseetea.malariacare.views.filters.MinMaxInputFilter; //导入依赖的package包/类
@Test
public void bounds_set_value_inside_accepted() {
//GIVEN
MinMaxInputFilter minMaxInputFilter = new MinMaxInputFilter(0, 10);
//WHEN
boolean result = minMaxInputFilter.inRange(5);
//THEN
assertTrue(result);
}
示例12: bounds_set_value_outside_rejected
import org.eyeseetea.malariacare.views.filters.MinMaxInputFilter; //导入依赖的package包/类
@Test
public void bounds_set_value_outside_rejected() {
//GIVEN
MinMaxInputFilter minMaxInputFilter = new MinMaxInputFilter(0, 10);
//WHEN
boolean result = minMaxInputFilter.inRange(-5);
//THEN
assertFalse(result);
}
示例13: initPositiveIntValue
import org.eyeseetea.malariacare.views.filters.MinMaxInputFilter; //导入依赖的package包/类
/**
* Initialise NumberPicker and button to view/edit a integer between 0 and Constants.MAX_INT_AGE
* @param tableRow
* @param value
*/
private void initPositiveIntValue(TableRow tableRow, Value value){
Button button=(Button)tableRow.findViewById(R.id.dynamic_positiveInt_btn);
final EditText numberPicker = (EditText)tableRow.findViewById(R.id.dynamic_positiveInt_edit);
//Without setMinValue, setMaxValue, setValue in this order, the setValue is not displayed in the screen.
numberPicker.setFilters(new InputFilter[]{
new InputFilter.LengthFilter(Constants.MAX_INT_CHARS),
new MinMaxInputFilter(0, 99)
});
//Has value? show it
if(value!=null){
numberPicker.setText(value.getValue());
}
if (!readOnly) {
//Save the numberpicker value in the DB, and continue to the next screen.
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String positiveIntValue = String.valueOf(numberPicker.getText());
//Required, empty values rejected
if(checkEditTextNotNull(positiveIntValue)){
numberPicker.setError(context.getString(R.string.dynamic_error_age));
return;
}
Question question = progressTabStatus.getCurrentQuestion();
ReadWriteDB.saveValuesText(question, positiveIntValue, module);
hideKeyboard(context,v);
finishOrNext();
}
});
}else{
numberPicker.setEnabled(false);
button.setEnabled(false);
}
//Add button to listener
swipeTouchListener.addClickableView(button);
//Take focus and open keyboard
openKeyboard(numberPicker);
}
示例14: getView
import org.eyeseetea.malariacare.views.filters.MinMaxInputFilter; //导入依赖的package包/类
private View getView(int position, ViewGroup parent, View rowView, Question question, AutoTabViewHolder viewHolder, float idSurvey) {
//FIXME This should be moved into its own class (Ex: ViewHolderFactory.getView(item))
switch (question.getOutput()) {
case Constants.LONG_TEXT:
rowView = AutoTabLayoutUtils.initialiseView(R.layout.longtext, parent, question, viewHolder, position, getInflater());
//Add main component and listener
((CustomEditText) viewHolder.component).addTextChangedListener(new TextViewListener(question));
break;
case Constants.NO_ANSWER:
rowView = AutoTabLayoutUtils.initialiseView(R.layout.label, parent, question, viewHolder, position, getInflater());
break;
case Constants.POSITIVE_INT:
rowView = AutoTabLayoutUtils.initialiseView(R.layout.integer, parent, question, viewHolder, position, getInflater());
//Add main component, set filters and listener
((CustomEditText) viewHolder.component).setFilters(new InputFilter[]{new InputFilter.LengthFilter(Constants.MAX_INT_CHARS),new MinMaxInputFilter(1, null)});
((CustomEditText) viewHolder.component).addTextChangedListener(new TextViewListener(question));
break;
case Constants.INT:
rowView = AutoTabLayoutUtils.initialiseView(R.layout.integer, parent, question, viewHolder, position, getInflater());
//Add main component, set filters and listener
((CustomEditText) viewHolder.component).setFilters(new InputFilter[]{new InputFilter.LengthFilter(Constants.MAX_INT_CHARS)});
((CustomEditText) viewHolder.component).addTextChangedListener(new TextViewListener(question));
break;
case Constants.DATE:
rowView = AutoTabLayoutUtils.initialiseView(R.layout.date, parent, question, viewHolder, position, getInflater());
//Add main component and listener
((CustomButton) viewHolder.component).setOnClickListener(new DatePickerListener(question, viewHolder));
break;
case Constants.SHORT_TEXT:
rowView = AutoTabLayoutUtils.initialiseView(R.layout.shorttext, parent, question, viewHolder, position, getInflater());
//Add main component and listener
((CustomEditText) viewHolder.component).addTextChangedListener(new TextViewListener(question));
break;
case Constants.DROPDOWN_LIST:
rowView = AutoTabLayoutUtils.initialiseDropDown(position, parent, question, viewHolder, getInflater(), getContext());
// Initialise Listener
((Spinner) viewHolder.component).setOnItemSelectedListener(new SpinnerListener(question, viewHolder));
break;
case Constants.DROPDOWN_LIST_DISABLED:
rowView = AutoTabLayoutUtils.initialiseDropDown(position, parent, question, viewHolder, getInflater(), getContext());
// Initialise value depending on match question
AutoTabLayoutUtils.autoFillAnswer(viewHolder, question, getContext(), inVisibilityState, this, idSurvey, module);
break;
case Constants.RADIO_GROUP_HORIZONTAL:
if(PreferencesState.getInstance().isShowNumDen()) {
rowView = AutoTabLayoutUtils.initialiseView(R.layout.radio_scored, parent, question, viewHolder, position, getInflater());
AutoTabLayoutUtils.initialiseScorableComponent(rowView, viewHolder);
}else{
rowView = AutoTabLayoutUtils.initialiseView(R.layout.radio, parent, question, viewHolder, position, getInflater());
}
AutoTabLayoutUtils.createRadioGroupComponent(question, viewHolder, LinearLayout.HORIZONTAL, getInflater(), getContext());
//Add Listener
((RadioGroup) viewHolder.component).setOnCheckedChangeListener(new RadioGroupListener(question, viewHolder));
break;
case Constants.RADIO_GROUP_VERTICAL:
if(PreferencesState.getInstance().isShowNumDen()) {
rowView = AutoTabLayoutUtils.initialiseView(R.layout.radio_scored, parent, question, viewHolder, position, getInflater());
AutoTabLayoutUtils.initialiseScorableComponent(rowView, viewHolder);
}else{
rowView = AutoTabLayoutUtils.initialiseView(R.layout.radio, parent, question, viewHolder, position, getInflater());
}
AutoTabLayoutUtils.createRadioGroupComponent(question, viewHolder, LinearLayout.VERTICAL, getInflater(), getContext());
//Add Listener
((RadioGroup) viewHolder.component).setOnCheckedChangeListener(new RadioGroupListener(question, viewHolder));
break;
case Constants.SWITCH_BUTTON:
rowView = AutoTabLayoutUtils.initialiseView(R.layout.switchbutton, parent, question, viewHolder, position, getInflater());
((Switch)viewHolder.component).setOnCheckedChangeListener(new SwitchButtonListener(question,viewHolder));
default:
break;
}
return rowView;
}
示例15: getViewTableContent
import org.eyeseetea.malariacare.views.filters.MinMaxInputFilter; //导入依赖的package包/类
private View getViewTableContent(LinearLayout row,QuestionRow questionRow, AutoTabViewHolder viewHolder, float idSurvey){
row.setWeightSum(1f);
float columnWeight=questionRow.sizeColumns()/1f;
for(Question question:questionRow.getQuestions()){
CustomEditText customEditText;
Spinner spinner;
CustomButton customButton;
//Create view for columm
switch (question.getOutput()){
case Constants.NO_ANSWER:
addTextViewToRow(row,question,columnWeight);
viewHolder.addColumnComponent(null);
break;
case Constants.DATE:
customButton = addDateButtonToRow(row,question,columnWeight);
customButton.setOnClickListener(new DatePickerListener(question, new AutoTabViewHolder(customButton)));
viewHolder.addColumnComponent(customButton);
break;
case Constants.LONG_TEXT:
case Constants.SHORT_TEXT:
customEditText= addEditViewToRow(row,question,columnWeight);
customEditText.addTextChangedListener(new TextViewListener(question));
viewHolder.addColumnComponent(customEditText);
break;
case Constants.INT:
customEditText= addEditIntViewToRow(row, question, columnWeight);
customEditText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(Constants.MAX_INT_CHARS)});
customEditText.addTextChangedListener(new TextViewListener(question));
viewHolder.addColumnComponent(customEditText);
break;
case Constants.POSITIVE_INT:
customEditText= addEditIntViewToRow(row, question, columnWeight);
customEditText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(Constants.MAX_INT_CHARS), new MinMaxInputFilter(1, null)});
customEditText.addTextChangedListener(new TextViewListener(question));
viewHolder.addColumnComponent(customEditText);
break;
case Constants.DROPDOWN_LIST:
spinner = addSpinnerViewToRow(row,question,columnWeight);
spinner.setOnItemSelectedListener(new SpinnerListener(question, new AutoTabViewHolder(spinner)));
viewHolder.addColumnComponent(spinner);
break;
case Constants.DROPDOWN_LIST_DISABLED:
spinner = addSpinnerViewToRow(row,question,columnWeight);
spinner.setOnItemSelectedListener(new SpinnerListener(question, new AutoTabViewHolder(spinner)));
AutoTabLayoutUtils.autoFillAnswer(new AutoTabViewHolder(spinner), question, getContext(), inVisibilityState, this, idSurvey, module);
viewHolder.addColumnComponent(spinner);
break;
case Constants.RADIO_GROUP_HORIZONTAL:
case Constants.RADIO_GROUP_VERTICAL:
RadioGroup radioGroup = addRadioGroupViewToRow(row,question,columnWeight);
radioGroup.setOnCheckedChangeListener(new RadioGroupListener(question, new AutoTabViewHolder(radioGroup)));
viewHolder.addColumnComponent(radioGroup);
break;
case Constants.SWITCH_BUTTON:
Switch switchButton = addSwitchViewToRow(row,question,columnWeight);
switchButton.setOnCheckedChangeListener(new SwitchButtonListener(question,viewHolder));
viewHolder.addColumnComponent(switchButton);
}
}
return row;
}