예제 #1
0
        public override View OnCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle)
        {
            View         view         = layoutInflater.Inflate(Resource.Layout.fragment_onechoice_questionario, viewGroup, false);
            TextView     textView     = view.FindViewById <TextView>(Resource.Id.title_text_view);
            RadioGroup   radioGroup   = view.FindViewById <RadioGroup>(Resource.Id.options_group);
            LinearLayout linearLayout = view.FindViewById <LinearLayout>(Resource.Id.options_layout);

            textView.Text     = _questao.getTitulo();
            textView.Selected = true;
            int             respostaSelected = QuestionarioManager.GetInstance().LastRespostaSelected(_page);
            List <Resposta> respostas        = _questao.Respostas;


            for (int i = 0; i < _questao.Respostas.Count; i++)
            {
                int id = i;
                QuestionarioWidgetGenerator.CreateRadioButton(radioGroup, _page, id, respostas[i].Descricao, respostaSelected == id);
            }

            LinearLayout          layout = view.FindViewById <LinearLayout>(Resource.Id.root_options_layout);
            EditNewRespostaLayout editNewRespostaLayout = new EditNewRespostaLayout(view.Context);
            LayoutParams          lparams = new LayoutParams(-1, -2);

            lparams.SetMargins(14, 0, 0, 0);

            layout.AddView(editNewRespostaLayout, lparams);

            return(view);
        }