Example #1
0
        public override View GetSampleContent(Context con)
        {
            LinearLayout linear = new LinearLayout(con);

            linear.SetBackgroundColor(Color.White);
            linear.Orientation = Orientation.Vertical;
            linear.SetPadding(10, 10, 10, 10);

            TextView text1 = new TextView(con);

            text1.TextSize      = 17;
            text1.TextAlignment = TextAlignment.Center;
            text1.SetTextColor(Color.ParseColor("#262626"));
            text1.Text = "This sample demonstrates how to create a Word document with mathematical equations using Essential DocIO.";
            text1.SetPadding(5, 10, 10, 5);
            linear.AddView(text1);

            TextView space1 = new TextView(con);

            space1.TextSize = 10;
            linear.AddView(space1);

            m_context = con;

            LinearLayout radioLinearLayout = new LinearLayout(con);

            radioLinearLayout.Orientation = Orientation.Horizontal;

            TextView imageType = new TextView(con);

            imageType.Text     = "Save As : ";
            imageType.TextSize = 19;
            radioLinearLayout.AddView(imageType);

            radioGroup = new RadioGroup(con);
            radioGroup.TextAlignment = TextAlignment.Center;
            radioGroup.Orientation   = Orientation.Horizontal;
            docxButton      = new RadioButton(con);
            docxButton.Text = "DOCX";
            radioGroup.AddView(docxButton);
            pdfButton      = new RadioButton(con);
            pdfButton.Text = "PDF";
            radioGroup.AddView(pdfButton);
            radioGroup.Check(1);
            radioLinearLayout.AddView(radioGroup);
            linear.AddView(radioLinearLayout);
            docxButton.Checked = true;

            TextView space2 = new TextView(con);

            space2.TextSize = 10;
            linear.AddView(space2);

            Button button1 = new Button(con);

            button1.Text   = "Generate";
            button1.Click += OnButtonClicked;
            linear.AddView(button1);

            return(linear);
        }
 public void Include(RadioGroup radioGroup)
 {
     radioGroup.CheckedChange += (sender, args) => radioGroup.Check(args.CheckedId);
 }
Example #3
0
        protected override View OnCreateDialogView()
        {
            LayoutInflater inflator = LayoutInflater.FromContext(this.Context);
            View           dialog   = inflator.Inflate(Resource.Layout.opencl_preference, null);

            _openCLRadioGroup = dialog.FindViewById <RadioGroup>(Resource.Id.opencl_preference_radio_group);

            AppPreference preference = new AppPreference();

            RadioButton checkedButton = null;
            RadioButton cpuButton     = new RadioButton(this.Context);

            cpuButton.Text = "CPU (no OpenCL)";

            _openCLRadioGroup.AddView(cpuButton);
            //int selectedIdx = -1;
            if (preference.UseOpenCL == false)
            {
                checkedButton = cpuButton;
            }
            cpuButton.Click += (sender, args) =>
            {
                preference.UseOpenCL = false;
                //Toast.MakeText(this.Context, "cpu clicked", ToastLength.Short).Show();
            };


            String selectedDeviceName = preference.OpenClDeviceName;

            if (selectedDeviceName == null && CvInvoke.HaveOpenCL && preference.UseOpenCL)
            {
                selectedDeviceName = Emgu.CV.Ocl.Device.Default.Name;
            }

            if (CvInvoke.HaveOpenCL)
            {
                using (VectorOfOclPlatformInfo oclPlatformInfos = Emgu.CV.Ocl.OclInvoke.GetPlatformsInfo())
                {
                    if (oclPlatformInfos.Size > 0)
                    {
                        for (int i = 0; i < oclPlatformInfos.Size; i++)
                        {
                            Emgu.CV.Ocl.PlatformInfo platformInfo = oclPlatformInfos[i];

                            for (int j = 0; j < platformInfo.DeviceNumber; j++)
                            {
                                Emgu.CV.Ocl.Device device       = platformInfo.GetDevice(j);
                                RadioButton        deviceButton = new RadioButton(this.Context);
                                deviceButton.Text = "OpenCL: " + device.Name;

                                if (preference.UseOpenCL == true && device.Name.Equals(selectedDeviceName))
                                {
                                    checkedButton = deviceButton;
                                }
                                _openCLRadioGroup.AddView(deviceButton);

                                //counter++;
                                deviceButton.Click += (sender, args) =>
                                {
                                    preference.UseOpenCL        = true;
                                    preference.OpenClDeviceName = device.Name;
                                    //Toast.MakeText(this.Context, device.Name + " clicked", ToastLength.Short).Show();
                                };
                            }
                        }
                    }
                }
            }
            if (checkedButton != null)
            {
                _openCLRadioGroup.Check(checkedButton.Id);
            }
            //_openCLRadioGroup.in

            /*
             * _openCLToggleButton.Checked = preference.UseOpenCL;
             *
             * _openCLToggleButton.CheckedChange += (sender, args) =>
             * {
             *    bool isChecked = args.IsChecked;
             *
             *    if (isChecked && !CvInvoke.HaveOpenCL)
             *    {
             *       _openCLToggleButton.Checked = false;
             *       Toast.MakeText(Context, "No OpenCL compatible device found.", ToastLength.Long).Show();
             *       isChecked = false;
             *    }
             *
             *    preference.UseOpenCL = isChecked;
             * };
             */
            return(dialog);
        }
Example #4
0
        public override View GetSampleContent(Context con)
        {
            LinearLayout linear = new LinearLayout(con);

            linear.SetBackgroundColor(Color.White);
            linear.Orientation = Orientation.Vertical;
            linear.SetPadding(10, 10, 10, 10);

            TextView text2 = new TextView(con);

            text2.TextSize      = 17;
            text2.TextAlignment = TextAlignment.Center;
            text2.Text          = "This sample illustrates the conversion of a simple Excel document to an image.";
            text2.SetTextColor(Color.ParseColor("#262626"));
            text2.SetPadding(5, 5, 5, 5);

            linear.AddView(text2);

            TextView space1 = new TextView(con);

            space1.TextSize = 10;
            linear.AddView(space1);

            m_context = con;

            LinearLayout radioLinearLayout = new LinearLayout(con);

            radioLinearLayout.Orientation = Orientation.Horizontal;

            TextView imageType = new TextView(con);

            imageType.Text     = "Image Format : ";
            imageType.TextSize = 19;
            radioLinearLayout.AddView(imageType);

            radioGroup = new RadioGroup(con);
            radioGroup.TextAlignment = TextAlignment.Center;
            radioGroup.Orientation   = Orientation.Horizontal;
            pngButton      = new RadioButton(con);
            pngButton.Text = "PNG";
            radioGroup.AddView(pngButton);
            jpegButton      = new RadioButton(con);
            jpegButton.Text = "JPEG";
            radioGroup.AddView(jpegButton);
            radioGroup.Check(1);
            radioLinearLayout.AddView(radioGroup);
            linear.AddView(radioLinearLayout);
            pngButton.Checked = true;

            TextView space2 = new TextView(con);

            space2.TextSize = 10;
            linear.AddView(space2);

            Button templateButton = new Button(con);

            templateButton.Text   = "Input Template";
            templateButton.Click += OnButtonClicked;
            linear.AddView(templateButton);

            Button convertButton = new Button(con);

            convertButton.Text   = "Convert";
            convertButton.Click += OnConvertButtonClicked;
            linear.AddView(convertButton);

            return(linear);
        }
Example #5
0
        public override View GetSampleContent(Context con)
        {
            LinearLayout linear = new LinearLayout(con);

            linear.SetBackgroundColor(Android.Graphics.Color.White);
            linear.Orientation = Orientation.Vertical;
            linear.SetPadding(10, 10, 10, 10);

            TextView text2 = new TextView(con);

            text2.TextSize      = 17;
            text2.TextAlignment = TextAlignment.Center;
            text2.Text          = "This sample demonstrates how to insert and update the Table of Contents (TOC) in a Word document using Essential DocIO.";
            text2.SetTextColor(Android.Graphics.Color.ParseColor("#262626"));
            text2.SetPadding(5, 5, 5, 5);

            linear.AddView(text2);

            TextView space1 = new TextView(con);

            space1.TextSize = 10;
            linear.AddView(space1);

            m_context = con;

            LinearLayout radioLinearLayout = new LinearLayout(con);

            radioLinearLayout.Orientation = Orientation.Horizontal;

            TextView imageType = new TextView(con);

            imageType.Text     = "Save As : ";
            imageType.TextSize = 19;
            radioLinearLayout.AddView(imageType);

            radioGroup = new RadioGroup(con);
            radioGroup.TextAlignment = TextAlignment.Center;
            radioGroup.Orientation   = Orientation.Horizontal;
            docxButton      = new RadioButton(con);
            docxButton.Text = "DOCX";
            radioGroup.AddView(docxButton);
            pdfButton      = new RadioButton(con);
            pdfButton.Text = "PDF";
            radioGroup.AddView(pdfButton);
            radioGroup.Check(1);
            radioLinearLayout.AddView(radioGroup);
            linear.AddView(radioLinearLayout);
            docxButton.Checked = true;

            TextView space2 = new TextView(con);

            space2.TextSize = 10;
            linear.AddView(space2);

            Button generateButton = new Button(con);

            generateButton.Text   = "Generate";
            generateButton.Click += OnButtonClicked;
            linear.AddView(generateButton);

            return(linear);
        }
Example #6
0
        public void SetCodCliFor()
        {
            var layoutprinc = new LinearLayout(this);

            layoutprinc.Orientation = Orientation.Vertical;
            var separator = new View(this);

            separator.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 1);
            separator.SetBackgroundResource(Android.Resource.Color.DarkerGray);
            var layoutRadio = new RadioGroup(this);

            layoutRadio.Orientation = Orientation.Horizontal;
            var radioDesc = new RadioButton(this)
            {
                Text = "Descrizione",
            };
            var radioIva = new RadioButton(this)
            {
                Text = "Partita iva"
            };
            var radioCod = new RadioButton(this)
            {
                Text = "Codice"
            };

            layoutRadio.AddView(radioDesc);
            layoutRadio.AddView(radioIva);
            layoutRadio.AddView(radioCod);
            layoutRadio.Check(radioDesc.Id);
            layoutprinc.AddView(layoutRadio);
            layoutprinc.AddView(separator);
            var searchText = new AutoCompleteTextView(this);
            var path       = Android.OS.Environment.GetExternalStoragePublicDirectory(Android.OS.Environment
                                                                                      .DirectoryDownloads).AbsolutePath;
            var clienti        = Helper.GetClienti(path);
            var descliforlist  = new List <string>();
            var partitaivalist = new List <string>();
            var codcliforlist  = new List <string>();

            foreach (var cliente in clienti)
            {
                codcliforlist.Add(cliente[7]);
                var parttemp = cliente[15];
                if (parttemp.Length != 0)
                {
                    parttemp = parttemp.Substring(1);
                }
                partitaivalist.Add(parttemp);


                descliforlist.Add(cliente[12]);
            }
            descliforlist.RemoveAt(0);
            searchText.Adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, descliforlist);

            layoutRadio.CheckedChange += (s, e) =>
            {
                switch (e.CheckedId)
                {
                case 1:
                    searchText.Adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1,
                                                          descliforlist);
                    break;

                case 2:
                    searchText.Adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1,
                                                          partitaivalist);
                    break;

                case 3:
                    searchText.Adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1,
                                                          codcliforlist);
                    break;
                }
            };
            layoutprinc.AddView(searchText);
            var builder1 = new AlertDialog.Builder(this);

            builder1.SetTitle("Seleziona cliente");
            builder1.SetCancelable(false);
            builder1.SetView(layoutprinc);
            builder1.SetPositiveButton("Conferma", delegate
            {
                switch (layoutRadio.CheckedRadioButtonId)
                {
                case 1:
                    codclifor = clienti.First(list => list[12] == searchText.Text)[7]; break;

                case 2:
                    codclifor = clienti.First(list => list[15] == "0" + searchText.Text)[7]; break;

                case 3:
                    codclifor = searchText.Text; break;
                }

                using (StreamWriter stream = new StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "/codclifor.txt"))
                {
                    stream.Write(codclifor);
                }

                SupportActionBar.Subtitle = "Cliente:" + clienti.First(list => list[7] == codclifor)[12];
            });
            layoutRadio.Check(1);
            builder1.Show();
        }
        private void SetRideType(int selectedIndex)
        {
            m_selectedRideType = selectedIndex;

            var btnSwitch1 = (RadioButton)FindViewById(Resource.Id.rb1);
            var btnSwitch2 = (RadioButton)FindViewById(Resource.Id.rb2);
            var btnSwitch3 = (RadioButton)FindViewById(Resource.Id.rb3);

            switch (selectedIndex)
            {
            case 0:
                btnSwitch1.Enabled = false;
                btnSwitch3.Enabled = false;
                btnSwitch1.Text    = "";
                btnSwitch1.Text    = "";
                btnSwitch2.Text    = "Up to 7";
                btnSwitch3.Text    = "";
                break;

            case 1:
                btnSwitch1.Enabled = true;
                btnSwitch3.Enabled = true;
                btnSwitch1.Text    = "Up to 7";
                btnSwitch2.Text    = "Up to 9";
                btnSwitch3.Text    = "Up to 14";
                break;

            case 2:
                btnSwitch1.Enabled = false;
                btnSwitch3.Enabled = false;
                btnSwitch1.Text    = "";
                btnSwitch2.Text    = "Up to 3";
                btnSwitch3.Text    = "";
                break;

            case 3:
                btnSwitch1.Enabled = false;
                btnSwitch3.Enabled = false;
                btnSwitch1.Text    = "";
                btnSwitch2.Text    = "Up to 5";
                btnSwitch3.Text    = "";
                break;

            case 4:
                btnSwitch1.Enabled = true;
                btnSwitch3.Enabled = false;
                btnSwitch1.Text    = "Up to 6";
                btnSwitch2.Text    = "Up to 13";
                btnSwitch3.Text    = "";
                break;

            case 5:
                btnSwitch1.Enabled = true;
                btnSwitch3.Enabled = false;
                btnSwitch1.Text    = "Up to 24";
                btnSwitch2.Text    = "Up to 56";
                btnSwitch3.Text    = "";
                break;

            case 6:
                btnSwitch1.Enabled = false;
                btnSwitch3.Enabled = false;
                btnSwitch1.Text    = "";
                btnSwitch2.Text    = "Up to 9";
                btnSwitch3.Text    = "";
                break;

            default:
                break;
            }
            m_rgUpto.Check(Resource.Id.rb2);
            m_selectedRideTypeValue = 1;
            SetFare();
        }
Example #8
0
        public void BuildEditGroupDialog(Group group)
        {
            GrouD = new Dialog(this);
            GrouD.SetContentView(Resource.Layout.MyDialog);
            GrouD.SetCancelable(true);
            //
            LinearLayout OAGroupsLayout = GrouD.FindViewById <LinearLayout>(Resource.Id.AbcDEF);

            OAGroupsLayout.Orientation = Orientation.Vertical;

            LinearLayout l2 = new LinearLayout(this);

            l2.LayoutParameters = new LinearLayout.LayoutParams(750, 850);
            l2.Orientation      = Orientation.Vertical;
            l2.SetBackgroundResource(Resource.Drawable.BlackOutLine);
            //
            #region Title
            TitleLayout = new LinearLayout(this)
            {
                LayoutParameters = WrapContParams,
                Orientation      = Orientation.Horizontal,
            };
            TitleTV = new TextView(this)
            {
                LayoutParameters = WrapContParams,
                Text             = "Edit Group ",
                TextSize         = 40,
                Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
            };
            TitleLayout.AddView(TitleTV);
            #endregion

            #region Location Defining
            LocationLayout = new LinearLayout(this)
            {
                LayoutParameters = WrapContParams,
                Orientation      = Orientation.Horizontal,
            };
            //
            LocTV = new TextView(this)
            {
                LayoutParameters = WrapContParams,
                Text             = "Location: ",
                TextSize         = 25,
                Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
            };
            LocTV.SetTextColor(Color.DarkRed);
            //
            LocET = new TextInputEditText(this)
            {
                LayoutParameters = WrapContParams,
                Text             = group.Location,
                TextSize         = 20,
                Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
            };
            TextInputLayout Loc = new TextInputLayout(this)
            {
                LayoutParameters = WrapContParams,
                Orientation      = Orientation.Horizontal,
            };
            LocationLayout.AddView(LocTV);
            LocationLayout.AddView(LocET);
            #endregion

            #region Age Defining
            AgeLayout = new LinearLayout(this)
            {
                LayoutParameters = WrapContParams,
                Orientation      = Orientation.Horizontal,
            };
            //
            AgeTV = new TextView(this)
            {
                LayoutParameters = WrapContParams,
                Text             = "Age: ",
                TextSize         = 25,
                Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
            };
            AgeTV.SetTextColor(Color.DarkRed);
            //
            AgeET = new TextInputEditText(this)
            {
                LayoutParameters = WrapContParams,
                Text             = group.age,
                TextSize         = 20,
                Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
            };
            AgeLayout.AddView(AgeTV);
            AgeLayout.AddView(AgeET);
            #endregion

            #region Level Defining
            LVLLayout = new LinearLayout(this)
            {
                LayoutParameters = WrapContParams,
                Orientation      = Orientation.Horizontal,
            };
            //
            LVLTV = new TextView(this)
            {
                LayoutParameters = WrapContParams,
                Text             = "Group Level: ",
                TextSize         = 25,
                Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
            };
            LVLTV.SetTextColor(Color.DarkRed);
            //
            LVLET = new TextInputEditText(this)
            {
                LayoutParameters = WrapContParams,
                Text             = group.geoupLevel,
                TextSize         = 20,
                Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
            };
            LVLLayout.AddView(LVLTV);
            LVLLayout.AddView(LVLET);
            #endregion

            #region Competetive defining
            CompRG             = new RadioGroup(this);
            CompRG.Orientation = Orientation.Vertical;
            //Defining Competitive group Radio Button
            CompRB = new RadioButton(this)
            {
                Text     = "Competetive",
                TextSize = 25,
                Typeface = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
            };
            CompRB.SetTextColor(Android.Graphics.Color.DarkBlue);
            CompRB.Click += this.RB_Click;
            //Defining not Competetive group radio Button
            NotCompRB = new RadioButton(this)
            {
                Text     = "Not Competetive",
                TextSize = 25,
                Typeface = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
            };
            NotCompRB.SetTextColor(Android.Graphics.Color.DarkBlue);
            NotCompRB.Click += this.RB_Click;

            CompRG.AddView(CompRB);
            CompRG.AddView(NotCompRB);
            if (group.competetive)
            {
                CompRG.Check(CompRB.Id);
            }
            else
            {
                CompRG.Check(NotCompRB.Id);
            }
            #endregion

            #region Time And Date
            TimeAndDateLayout = new LinearLayout(this)
            {
                LayoutParameters = WrapContParams,
                Orientation      = Orientation.Horizontal,
            };
            TimeButton = new Button(this)
            {
                LayoutParameters = WrapContParams,
                Text             = group.time,
                TextSize         = 25,
                Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
            };
            TimeButton.SetTextColor(Color.Red);
            TimeButton.Click += this.TimeButton_Click;
            TimeAndDateLayout.AddView(TimeButton);
            #endregion

            #region Save Button
            SaveLayout = new LinearLayout(this)
            {
                LayoutParameters = WrapContParams,
                Orientation      = Orientation.Horizontal,
            };
            SaveButton = new Button(this)
            {
                LayoutParameters = WrapContParams,
                Text             = "Save",
                TextSize         = 25,
                Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
            };
            SaveButton.SetBackgroundColor(Color.BurlyWood);
            SaveButton.Click += this.SaveButton_Click;
            SaveLayout.AddView(SaveButton);
            #endregion

            l2.AddView(TitleLayout);
            l2.AddView(LocationLayout);
            l2.AddView(AgeLayout);
            l2.AddView(LVLLayout);
            l2.AddView(CompRG);
            l2.AddView(TimeAndDateLayout);
            l2.AddView(SaveLayout);
            OAGroupsLayout.AddView(l2);
            //
            GrouD.Show();
        }
Example #9
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Score);

            // Initialize toolbar
            var toolbar = FindViewById <SupportToolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);

            MatchId  = Intent.GetIntExtra("MatchId", 1);
            TeamId   = Intent.GetIntExtra("TeamId", 1);
            PlayerId = Intent.GetIntExtra("PlayerId", 1);
            Play     = Intent.GetStringExtra("Play");
            ThisBall = new Ball();

            // Active Players
            mActiveBatsman = FindViewById <Spinner>(Resource.Id.activeBatsman);
            mActiveBatsman.ItemSelected += ActiveBatsman_ItemSelected;
            mActiveBowler = FindViewById <Spinner>(Resource.Id.activeBowler);
            mActiveBowler.ItemSelected   += ActiveBowler_ItemSelected;
            mFielder_Keeper               = FindViewById <Spinner>(Resource.Id.fielder);
            mFielder_Keeper.ItemSelected += Fielder_Keeper_ItemSelected;

            // Score and wickets
            mRunsWickets1 = FindViewById <RadioGroup>(Resource.Id.runswickets1);
            mRunsWickets2 = FindViewById <RadioGroup>(Resource.Id.runswickets2);
            mRunsWickets3 = FindViewById <RadioGroup>(Resource.Id.runswickets3);
            mRunsWickets4 = FindViewById <RadioGroup>(Resource.Id.runswickets4);
            mRunsWickets1.Check(Resource.Id.dot);
            mRunsWickets1.SetOnCheckedChangeListener(this);
            mRunsWickets2.SetOnCheckedChangeListener(this);
            mRunsWickets3.SetOnCheckedChangeListener(this);
            mRunsWickets4.SetOnCheckedChangeListener(this);

            // Extras
            ArrayAdapter extrasAdapter = new SpinnerAdapter(this, Resource.Layout.Row, new[] { "0", "1", "2", "3", "4" });

            mExtras1 = FindViewById <RadioGroup>(Resource.Id.extras1);
            mExtras1.SetOnCheckedChangeListener(this);
            mExtra1Runs         = FindViewById <Spinner>(Resource.Id.extras_one_runs);
            mExtra1Runs.Adapter = extrasAdapter;
            mExtra1Runs.Enabled = false;

            mExtras2 = FindViewById <RadioGroup>(Resource.Id.extras2);
            mExtras2.SetOnCheckedChangeListener(this);
            mExtra2Runs         = FindViewById <Spinner>(Resource.Id.extras_two_runs);
            mExtra2Runs.Adapter = extrasAdapter;
            mExtra2Runs.Enabled = false;

            //Buttons
            var mClear = FindViewById <Button>(Resource.Id.clear);

            mClear.Click += ClearScore;
            var mUpdate = FindViewById <Button>(Resource.Id.updateScore);

            mUpdate.Click += UpdateScore;
            var mDeclare = FindViewById <Button>(Resource.Id.declare);

            mDeclare.Click += DeclareGame;
            var mUndo = FindViewById <Button>(Resource.Id.undo);

            mUndo.Click += UndoScore;
        }