Exemplo n.º 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.Quadrado);

            res                = (TextView)FindViewById(Resource.Id.tvResultado);
            lado               = (MultiAutoCompleteTextView)FindViewById(Resource.Id.txtLado);
            btnCalcular        = (Button)FindViewById(Resource.Id.btnCalcularQuadrado);
            btnCalcular.Click += onButtonClick;
        }
Exemplo n.º 2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate(Resource.Layout.EventInviteUserDialogView, container, false);

            view.FindViewById <Button>(Resource.Id.EventInvite_InviteButton).Click += InviteSelectedUsers;
            view.FindViewById <Button>(Resource.Id.EventInvite_CancelButton).Click += (sender, args) => Dismiss();

            _invitetxt         = view.FindViewById <MultiAutoCompleteTextView>(Resource.Id.EventInvite_UsersSelection);
            _invitetxt.Adapter = new ArrayAdapter <string>(_context, Resource.Layout.InviteListItemView,
                                                           _invUsers.Select(x => x.Name).ToArray());
            _invitetxt.SetTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
            return(view);
        }
Exemplo n.º 3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.Triangulo);

            tv          = (TextView)FindViewById(Resource.Id.tvResultadoTriangulo);
            alturaTri   = (MultiAutoCompleteTextView)FindViewById(Resource.Id.txtAlturaTriangulo);
            baseTri     = (MultiAutoCompleteTextView)FindViewById(Resource.Id.txtBaseTriangulo);
            btnCalcular = (Button)FindViewById(Resource.Id.btnCalcularTriangulo);

            btnCalcular.Click += OnButtonClick;
        }
Exemplo n.º 4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Scout_Form);
            //get controls from layout and assign event handlers
            textTitle              = FindViewById <TextView>(Resource.Id.textEventTitle);
            vMatchNumber           = FindViewById <EditText>(Resource.Id.vMatchNumber);
            vTeamNumber            = FindViewById <EditText>(Resource.Id.vTeamNumber);
            position               = FindViewById <Spinner>(Resource.Id.vPosition);
            position.ItemSelected += SpinnerClick;
            table      = FindViewById <CheckBox>(Resource.Id.table);
            radioLevel = FindViewById <RadioGroup>(Resource.Id.radioLevel);
            radioLevel.CheckedChange     += RadioClicked;
            radioSandstorm                = FindViewById <RadioGroup>(Resource.Id.radioSandstorm);
            radioSandstorm.CheckedChange += RadioClicked;
            sandCargo                     = FindViewById <CheckBox>(Resource.Id.sandCargo);
            sandHatch                     = FindViewById <CheckBox>(Resource.Id.sandHatch);
            sandHab                       = FindViewById <CheckBox>(Resource.Id.sandHab);
            cargo                         = FindViewById <CheckBox>(Resource.Id.cargo);
            cargo.CheckedChange          += CheckboxClicked;
            cargoWell                     = FindViewById <CheckBox>(Resource.Id.cargoWell);
            cargoWell.CheckedChange      += CheckboxClicked;
            cargoBarely                   = FindViewById <CheckBox>(Resource.Id.cargoBarely);
            cargoBarely.CheckedChange    += CheckboxClicked;
            hatch                         = FindViewById <CheckBox>(Resource.Id.hatch);
            hatch.CheckedChange          += CheckboxClicked;
            hatchWell                     = FindViewById <CheckBox>(Resource.Id.hatchWell);
            hatchWell.CheckedChange      += CheckboxClicked;
            hatchBarely                   = FindViewById <CheckBox>(Resource.Id.hatchBarely);
            hatchBarely.CheckedChange    += CheckboxClicked;
            radioClimb                    = FindViewById <RadioGroup>(Resource.Id.radioClimb);
            radioClimb.CheckedChange     += RadioClicked;
            radioDrivers                  = FindViewById <RadioGroup>(Resource.Id.radioDrivers);
            radioDrivers.CheckedChange   += RadioClicked;
            radioRecommend                = FindViewById <RadioGroup>(Resource.Id.radioRecommend);
            radioRecommend.CheckedChange += RadioClicked;
            radioResult                   = FindViewById <RadioGroup>(Resource.Id.radioResult);
            radioResult.CheckedChange    += RadioClicked;
            comments                      = FindViewById <MultiAutoCompleteTextView>(Resource.Id.comments);
            bFinish                       = FindViewById <Button>(Resource.Id.bFinish);
            bFinish.Click                += ButtonClicked;
            //put positions into dropdown
            string[]     positions = new string[] { "Red 1", "Red 2", "Red 3", "Blue 1", "Blue 2", "Blue 3" };
            ArrayAdapter posAdapt  = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleListItem1, positions);

            position.Adapter = posAdapt;
            //get current event and set title text
            currentEvent    = eData.GetCurrentEvent();
            textTitle.Text += currentEvent.eventName + "'";
        }
Exemplo n.º 5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Search);

            this.RequestedOrientation = Android.Content.PM.ScreenOrientation.Portrait;

            ActionBar.SetHomeButtonEnabled(true);
            ActionBar.SetDisplayHomeAsUpEnabled(true);

            spinnerCountry               = FindViewById <Spinner>(Resource.Id.spinner_Country);
            spinnerCountry.Prompt        = "Выберите страну";
            spinnerCountry.ItemSelected += spinnerCountry_ItemSelected;
            var adapterCountry = ArrayAdapter.CreateFromResource(
                this, Resource.Array.countryes_array, Android.Resource.Layout.SimpleSpinnerItem);

            adapterCountry.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            spinnerCountry.Adapter = adapterCountry;


            spinnerCategory               = FindViewById <Spinner>(Resource.Id.spinner_Category);
            spinnerCategory.Prompt        = "Выберите категорию";
            spinnerCategory.ItemSelected += spinnerCategory_ItemSelected;
            var adapterCategory = ArrayAdapter.CreateFromResource(
                this, Resource.Array.category_array, Android.Resource.Layout.SimpleSpinnerItem);

            adapterCategory.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            spinnerCategory.Adapter = adapterCategory;

            // Создаем адаптер для автозаполнения элемента MultiAutoCompleteTextView
            MAtextView = FindViewById <MultiAutoCompleteTextView>(Resource.Id.multiAutocomplete_country);
            ArrayAdapter <String> adapter = new ArrayAdapter <String>(this, Android.Resource.Layout.SimpleExpandableListItem1, INGREDIENTS);

            MAtextView.Adapter   = adapter;
            MAtextView.Threshold = 1;
            // установка запятой в качестве разделителя
            MAtextView.SetTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());

            buttonSrch        = FindViewById <Button>(Resource.Id.buttonSearth);
            buttonSrch.Click += ButtonSrch_Click;
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.MultiAutoCompleteTextView);

            //3、初始化数据源--数据源去匹配文本框中输入的类容
            String[] res = { "beijing1", "beijing2", "beijing3", "shanghai1", "shanghai2", "shanghai3" };
            // 2、创建一个适配器
            ArrayAdapter <String>     adapter  = new ArrayAdapter <String>(this, Resource.Layout.HelloAutoComplete, res);
            MultiAutoCompleteTextView MautoTxt = (MultiAutoCompleteTextView)FindViewById(Resource.Id.MAutoText);

            // 4、将adapter与当前AutoCompleteTextView绑定
            MautoTxt.Adapter = adapter;

            //设置输入多少字符时自动匹配
            MautoTxt.Threshold = 2;
            //5、设置分隔符,设置以逗号分割符为结束符号
            MautoTxt.SetTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            ObtenerIDEmpleados();
            ObtenerGuiasP();
            btnVer    = FindViewById <Button>(Resource.Id.btnVer);
            InserEntr = FindViewById <Button>(Resource.Id.btnActualizarE);

            actxtEmpelado = FindViewById <MultiAutoCompleteTextView>(Resource.Id.actxtIdEmpleado);
            ArrayAdapter adaptadorIds = new ArrayAdapter(this, Android.Resource.Layout.SimpleExpandableListItem1, Empleado);

            actxtEmpelado.Adapter   = adaptadorIds;
            actxtEmpelado.Threshold = 1;
            actxtEmpelado.SetTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
            //
            actxtGuias = FindViewById <MultiAutoCompleteTextView>(Resource.Id.actxtGuias);
            ArrayAdapter adaptadorG = new ArrayAdapter(this, Android.Resource.Layout.SimpleExpandableListItem1, Guias);

            actxtGuias.Adapter   = adaptadorG;
            actxtGuias.Threshold = 1;
            actxtGuias.SetTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
            //AutoComplete
            //SetUpMap();
            //
            btnVer.Click += delegate {
                //SetUpMap();
                Servicio NuevoSer = new Servicio();

                string guia = "";
                string idEm = "";
                int    i    = 0;
                while (char.ToString(actxtGuias.Text[i]) != ",")
                {
                    guia += actxtGuias.Text[i];
                    i++;
                }

                i = 0;
                while (char.ToString(actxtEmpelado.Text[i]) != " ")
                {
                    idEm += actxtEmpelado.Text[i];
                    i++;
                }

                DateTime dt    = DateTime.Today;
                string   Fecha = dt.ToString();
                //btnVer.Text = LongitudO;
                InsertarUbiPaquete parametros = new InsertarUbiPaquete(guia, Fecha, LatitudO, LongitudO.ToString(), idEm);

                string body = JsonConvert.SerializeObject(parametros);

                string Resultados = NuevoSer.llamarServicio(body);
            };
            //

            InserEntr.Click += delegate {
                //SetUpMap();
                Servicio NuevoSer = new Servicio();

                string guia = "";
                string idEm = "";
                int    i    = 0;
                while (char.ToString(actxtGuias.Text[i]) != ",")
                {
                    guia += actxtGuias.Text[i];
                    i++;
                }

                i = 0;
                while (char.ToString(actxtEmpelado.Text[i]) != " ")
                {
                    idEm += actxtEmpelado.Text[i];
                    i++;
                }

                DateTime dt    = DateTime.Today;
                string   Fecha = dt.ToString();
                //btnVer.Text = LongitudO;

                InsertarUbiPaqueteEntregado parametros = new InsertarUbiPaqueteEntregado(guia, Fecha, LatitudO, LongitudO.ToString(), idEm);

                string body = JsonConvert.SerializeObject(parametros);

                string Resultados = NuevoSer.llamarServicio(body);
            };
        }
Exemplo n.º 8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Scout_Form_Edit);
            //get controls from layout and assign event handlers
            textTitle              = FindViewById <TextView>(Resource.Id.textEventTitle);
            vMatchNumber           = FindViewById <EditText>(Resource.Id.vMatchNumber);
            vTeamNumber            = FindViewById <EditText>(Resource.Id.vTeamNumber);
            position               = FindViewById <Spinner>(Resource.Id.vPosition);
            position.ItemSelected += SpinnerClick;
            table      = FindViewById <CheckBox>(Resource.Id.table);
            radioLevel = FindViewById <RadioGroup>(Resource.Id.radioLevel);
            radioLevel.CheckedChange     += RadioClicked;
            radioSandstorm                = FindViewById <RadioGroup>(Resource.Id.radioSandstorm);
            radioSandstorm.CheckedChange += RadioClicked;
            sandCargo                     = FindViewById <CheckBox>(Resource.Id.sandCargo);
            sandHatch                     = FindViewById <CheckBox>(Resource.Id.sandHatch);
            sandHab                       = FindViewById <CheckBox>(Resource.Id.sandHab);
            cargo                         = FindViewById <CheckBox>(Resource.Id.cargo);
            cargo.CheckedChange          += CheckboxClicked;
            cargoWell                     = FindViewById <CheckBox>(Resource.Id.cargoWell);
            cargoWell.CheckedChange      += CheckboxClicked;
            cargoBarely                   = FindViewById <CheckBox>(Resource.Id.cargoBarely);
            cargoBarely.CheckedChange    += CheckboxClicked;
            hatch                         = FindViewById <CheckBox>(Resource.Id.hatch);
            hatch.CheckedChange          += CheckboxClicked;
            hatchWell                     = FindViewById <CheckBox>(Resource.Id.hatchWell);
            hatchWell.CheckedChange      += CheckboxClicked;
            hatchBarely                   = FindViewById <CheckBox>(Resource.Id.hatchBarely);
            hatchBarely.CheckedChange    += CheckboxClicked;
            radioClimb                    = FindViewById <RadioGroup>(Resource.Id.radioClimb);
            radioClimb.CheckedChange     += RadioClicked;
            radioDrivers                  = FindViewById <RadioGroup>(Resource.Id.radioDrivers);
            radioDrivers.CheckedChange   += RadioClicked;
            radioRecommend                = FindViewById <RadioGroup>(Resource.Id.radioRecommend);
            radioRecommend.CheckedChange += RadioClicked;
            radioResult                   = FindViewById <RadioGroup>(Resource.Id.radioResult);
            radioResult.CheckedChange    += RadioClicked;
            comments                      = FindViewById <MultiAutoCompleteTextView>(Resource.Id.comments);
            bFinish                       = FindViewById <Button>(Resource.Id.bFinish);
            bFinish.Click                += ButtonClicked;
            //put positions into dropdown
            string[]     positions = new string[] { "Red 1", "Red 2", "Red 3", "Blue 1", "Blue 2", "Blue 3" };
            ArrayAdapter posAdapt  = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleListItem1, positions);

            position.Adapter = posAdapt;
            //get current event and set title text
            currentEvent    = eData.GetCurrentEvent();
            currentMatch    = eData.GetCurrentMatch();
            textTitle.Text += currentMatch.matchNumber.ToString() + "'";
            //set options to match properties
            vMatchNumber.Text = currentMatch.matchNumber.ToString();
            vTeamNumber.Text  = currentMatch.teamNumber.ToString();
            position.SetSelection(currentMatch.position);
            table.Checked = currentMatch.isTable;
            ((RadioButton)radioLevel.GetChildAt(currentMatch.sandstormStartLevel - 1)).Checked = true;
            ((RadioButton)radioSandstorm.GetChildAt(currentMatch.sandstormMode)).Checked       = true;
            sandCargo.Checked   = currentMatch.sandstormCargo;
            sandHatch.Checked   = currentMatch.sandstormHatch;
            sandHab.Checked     = currentMatch.sandstormLine;
            cargo.Checked       = currentMatch.cargo;
            cargoWell.Checked   = currentMatch.cargoWell;
            cargoBarely.Checked = currentMatch.cargoBarely;
            hatch.Checked       = currentMatch.hatch;
            hatchWell.Checked   = currentMatch.hatchWell;
            hatchBarely.Checked = currentMatch.hatchBarely;
            try
            {
                ((RadioButton)radioClimb.GetChildAt(currentMatch.climb - 2)).Checked = true;
            }
            catch
            {
                ((RadioButton)radioClimb.GetChildAt(2)).Checked = true;
            }
            ((RadioButton)radioDrivers.GetChildAt(Convert.ToInt16(!currentMatch.goodDrivers))).Checked = true;
            ((RadioButton)radioRecommend.GetChildAt(currentMatch.wouldRecommend)).Checked = true;
            ((RadioButton)radioResult.GetChildAt(currentMatch.result)).Checked            = true;
            comments.Text = currentMatch.additionalComments;
        }