#include #include #include #include #include WashOptionsWindow::WashOptionsWindow(int options):Window(0,0,-1,-1){ const char*arraynames[]={ "@array/cleverwash", "@array/potch", "@array/speed" , "@array/dry", "@array/stain" }; LayoutInflater::from(getContext())->inflate("@layout/options",this); ViewGroup*vg=dynamic_cast(getChildAt(0)); for(int i=0;igetChildCount();i++){ std::vectorvalues; std::vectorarray; OptionPicker*op=dynamic_cast(vg->getChildAt(i)); vg->getChildAt(i)->setOnClickListener(std::bind(&WashOptionsWindow::onOptionClick,this,std::placeholders::_1)); getContext()->getArray(arraynames[i],array); LOGD("%s size=%d",arraynames[i],array.size()); if(op)op->setValuedName(values,array); } } void WashOptionsWindow::onOptionClick(View&v){ ViewGroup*vg=v.getParent(); for(int i=0;igetChildCount();i++){ OptionPicker*op=dynamic_cast(vg->getChildAt(i)); op->showOptions(op==&v); } //invalidate(); }