Exemple #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            LinearLayout linearLayout = new LinearLayout(this);

            linearLayout.Orientation = Orientation.Vertical;
            selectAll = new SfCheckBox(this);
            selectAll.StateChanged += SelectAll_StateChanged;
            selectAll.Text          = "Select All";
            linearLayout.AddView(selectAll);
            pepperoni = new SfCheckBox(this);
            pepperoni.StateChanged += CheckBox_StateChanged;
            pepperoni.Text          = "Pepperoni";
            linearLayout.AddView(pepperoni);
            beef = new SfCheckBox(this);
            beef.StateChanged += CheckBox_StateChanged;
            beef.Text          = "Beef";
            beef.Checked       = true;
            linearLayout.AddView(beef);
            mushroom = new SfCheckBox(this);
            mushroom.StateChanged += CheckBox_StateChanged;
            mushroom.Text          = "Mushrooms";
            linearLayout.AddView(mushroom);
            onion = new SfCheckBox(this);
            onion.StateChanged += CheckBox_StateChanged;
            onion.Text          = "Onions";
            onion.Checked       = true;
            linearLayout.AddView(onion);
            SetContentView(linearLayout);
        }
Exemple #2
0
        public ExcelToJSON()
        {
            this.layoutList.Add((NSString)"Workbook");
            this.layoutList.Add((NSString)"Worksheet");
            this.layoutList.Add((NSString)"Range");
            label       = new UILabel();
            inputButton = new UIButton(UIButtonType.System);
            inputButton.TouchUpInside   += OnButtonClicked;
            convertButton                = new UIButton(UIButtonType.System);
            convertButton.TouchUpInside += OnConvertClicked;

            layoutDoneButton = new UIButton();
            layoutButton     = new UIButton();
            layoutPicker     = new UIPickerView();
            pageSetuplabel   = new UILabel();
            layoutPicker     = new UIPickerView();
            layoutDoneButton = new UIButton();
            checkSchema      = new SfCheckBox();

            this.AddSubview(label);
            this.AddSubview(pageSetuplabel);
            this.AddSubview(layoutButton);
            this.AddSubview(layoutPicker);
            this.AddSubview(layoutDoneButton);
            this.AddSubview(checkSchema);
            this.AddSubview(convertButton);
            this.AddSubview(inputButton);
        }
Exemple #3
0
 public Performance()
 {
     label                 = new UILabel();
     label1                = new UILabel();
     label2                = new UILabel();
     label3                = new UILabel();
     button                = new UIButton(UIButtonType.System);
     textBox1              = new SfMaskedEdit();
     textBox2              = new SfMaskedEdit();
     importCheck           = new SfCheckBox();
     button.TouchUpInside += OnButtonClicked;
 }
Exemple #4
0
        public ExcelToPDF()
        {
            this.layoutList.Add((NSString)"NoScaling");
            this.layoutList.Add((NSString)"FitAllRowsOnOnePage");
            this.layoutList.Add((NSString)"FitAllColumnsOnOnePage");
            this.layoutList.Add((NSString)"FitSheetOnOnePage");
            label       = new UILabel();
            inputButton = new UIButton(UIButtonType.System);
            inputButton.TouchUpInside   += OnButtonClicked;
            convertButton                = new UIButton(UIButtonType.System);
            convertButton.TouchUpInside += OnConvertClicked;

            layoutDoneButton = new UIButton();
            layoutButton     = new UIButton();
            layoutPicker     = new UIPickerView();
            pageSetuplabel   = new UILabel();
            layoutPicker     = new UIPickerView();
            layoutDoneButton = new UIButton();
            SubstituteLabel  = new UILabel();
            FontStreamLabel  = new UILabel();
            FontNameLabel    = new UILabel();
            checkfontName    = new SfCheckBox();
            checkfontStream  = new SfCheckBox();

            this.AddSubview(label);
            this.AddSubview(pageSetuplabel);
            this.AddSubview(layoutButton);
            this.AddSubview(layoutPicker);
            this.AddSubview(layoutDoneButton);
            this.AddSubview(SubstituteLabel);
            this.AddSubview(checkfontName);
            this.AddSubview(FontNameLabel);
            this.AddSubview(checkfontStream);
            this.AddSubview(FontStreamLabel);
            this.AddSubview(convertButton);
            this.AddSubview(inputButton);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            selectAll               = new SfCheckBox();
            selectAll.Frame         = new CGRect(50, 50, 200, 50);
            selectAll.StateChanged += SelectAll_StateChanged;
            selectAll.SetTitle("Select All", UIControlState.Normal);

            pepperoni               = new SfCheckBox();
            pepperoni.Frame         = new CGRect(50, 100, 200, 50);
            pepperoni.StateChanged += CheckBox_StateChanged;
            pepperoni.SetTitle("Pepperoni", UIControlState.Normal);

            beef               = new SfCheckBox();
            beef.Frame         = new CGRect(50, 150, 200, 50);
            beef.StateChanged += CheckBox_StateChanged;
            beef.SetTitle("Beef", UIControlState.Normal);
            beef.IsChecked = true;

            mushroom               = new SfCheckBox();
            mushroom.Frame         = new CGRect(50, 200, 200, 50);
            mushroom.StateChanged += CheckBox_StateChanged;
            mushroom.SetTitle("Mushrooms", UIControlState.Normal);

            onion               = new SfCheckBox();
            onion.Frame         = new CGRect(50, 250, 200, 50);
            onion.StateChanged += CheckBox_StateChanged;
            onion.SetTitle("Onions", UIControlState.Normal);
            onion.IsChecked = true;

            this.View.AddSubview(selectAll);
            this.View.AddSubview(pepperoni);
            this.View.AddSubview(beef);
            this.View.AddSubview(mushroom);
            this.View.AddSubview(onion);
        }
Exemple #6
0
        public View GetSampleContent(Context con)
        {
            LinearLayout linear = new LinearLayout(con);

            linear.Orientation = Orientation.Vertical;

            LinearLayout.LayoutParams linearLayoutParams = new LinearLayout.LayoutParams(
                LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.MatchParent, (int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 3, con.Resources.DisplayMetrics));
            int margin;

            if (IsTabletDevice(con))
            {
                margin = (int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 15, con.Resources.DisplayMetrics);
            }
            else
            {
                margin = (int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 9.5f, con.Resources.DisplayMetrics);
            }

            linearLayoutParams.SetMargins(margin, margin, margin, margin);

            ImageView imageView = new ImageView(con);

            imageView.SetScaleType(ImageView.ScaleType.FitStart);
            imageView.SetAdjustViewBounds(true);
            imageView.SetImageResource(Resource.Drawable.Pizzaimage);
            linear.AddView(imageView);

            int padding = (int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 7, con.Resources.DisplayMetrics);

            LinearLayout frameParent = new LinearLayout(con);

            frameParent.SetBackgroundColor(Color.White);
            frameParent.Orientation      = Orientation.Vertical;
            frameParent.LayoutParameters = linearLayoutParams;

            LinearLayout frame = new LinearLayout(con);

            frame.Orientation = Orientation.Vertical;
            int currentapiVersion = (int)Build.VERSION.SdkInt;

            if (currentapiVersion > 21)
            {
                frame.Background = con.Resources.GetDrawable(Resource.Drawable.shadow, con.Theme);
            }

            TextView headLabel = new TextView(con);

            headLabel.SetPadding(padding, headLabel.PaddingTop, headLabel.PaddingRight, headLabel.PaddingBottom);
            headLabel.TextSize = 18;
            headLabel.SetTextColor(Color.ParseColor("#FF007DE6"));
            headLabel.Text = "Add Extra Toppings";
            frame.AddView(headLabel);

            #region Items Layout

            selectAllBox          = new SfCheckBox(con);
            selectAllBox.Text     = "Select All";
            selectAllBox.TextSize = 15;
            selectAllBox.SetTextColor(Color.ParseColor("#FF000000"));
            selectAllBox.StateChanged    += SelectAll1_StateChanged;
            selectAllBox.LayoutParameters = linearLayoutParams;
            frame.AddView(selectAllBox);

            grilledBox          = new SfCheckBox(con);
            grilledBox.Text     = "Grilled Chicken";
            grilledBox.TextSize = 15;
            grilledBox.SetTextColor(Color.ParseColor("#FF000000"));
            grilledBox.StateChanged    += NonvegToppingsChanged;
            grilledBox.LayoutParameters = linearLayoutParams;
            frame.AddView(grilledBox);

            tikkaBox          = new SfCheckBox(con);
            tikkaBox.Text     = "Chicken Tikka";
            tikkaBox.TextSize = 15;
            tikkaBox.SetTextColor(Color.ParseColor("#FF000000"));
            tikkaBox.StateChanged    += NonvegToppingsChanged;
            tikkaBox.LayoutParameters = linearLayoutParams;
            frame.AddView(tikkaBox);

            sausaga          = new SfCheckBox(con);
            sausaga.Text     = "Chicken Sausage";
            sausaga.TextSize = 15;
            sausaga.SetTextColor(Color.ParseColor("#FF000000"));
            sausaga.StateChanged    += NonvegToppingsChanged;
            sausaga.LayoutParameters = linearLayoutParams;
            frame.AddView(sausaga);

            beefBox          = new SfCheckBox(con);
            beefBox.Text     = "Beef";
            beefBox.TextSize = 15;
            beefBox.SetTextColor(Color.ParseColor("#FF000000"));
            beefBox.StateChanged    += NonvegToppingsChanged;
            beefBox.LayoutParameters = linearLayoutParams;
            frame.AddView(beefBox);

            frameParent.AddView(frame);
            linear.AddView(frameParent);
            #endregion

            button = new Button(con);
            button.SetWidth(ActionBar.LayoutParams.MatchParent);
            button.SetHeight(43);
            button.TextSize = 21;
            button.Text     = "Order Now";
            button.SetBackgroundColor(Color.ParseColor("#FF007DE6"));
            button.SetTextColor(Color.ParseColor("#73FFFFFF"));
            button.Click  += SearchButton_Click;
            button.Enabled = false;

            linear.AddView(button);

            resultsDialog = new AlertDialog.Builder(con);
            resultsDialog.SetPositiveButton("OK", (object sender, DialogClickEventArgs e) =>
            {
            });

            resultsDialog.SetCancelable(true);
            return(linear);
        }
Exemple #7
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            CrossCurrentActivity.Current.Activity.Window.SetSoftInputMode(SoftInput.AdjustPan);
            var view = new RelativeLayout(Context.ApplicationContext);

            view.SetBackgroundColor(Color.ParseColor("#80000000"));
            view.SetPadding(8, 8, 8, 8);

            var dataFormParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);

            dataFormParams.AddRule(LayoutRules.CenterInParent);
            dataFormParams.Width  = ViewGroup.LayoutParams.MatchParent;
            dataFormParams.Height = ViewGroup.LayoutParams.WrapContent;

            dataForm                = new SfDataForm(Context.ApplicationContext);
            dataForm.Id             = View.GenerateViewId();
            userInfo                = new UserInfo();
            dataForm.DataObject     = userInfo;
            dataForm.LayoutManager  = new DataFormLayoutManagerExt(dataForm);
            dataForm.LabelPosition  = LabelPosition.Top;
            dataForm.ValidationMode = ValidationMode.LostFocus;
            dataForm.CommitMode     = CommitMode.LostFocus;
            view.AddView(dataForm, dataFormParams);

            var edtParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);

            edtParams.AddRule(LayoutRules.Below, dataForm.Id);
            edtParams.Width      = ViewGroup.LayoutParams.WrapContent;
            edtParams.LeftMargin = 48;
            edtParams.Height     = ViewGroup.LayoutParams.WrapContent;



            var dataForm2Params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);

            dataForm2Params.AddRule(LayoutRules.Below, dataForm.Id);
            dataForm2Params.Width       = ViewGroup.LayoutParams.MatchParent;
            dataForm2Params.RightMargin = 48;
            dataForm2Params.Height      = ViewGroup.LayoutParams.WrapContent;

            dataForm2                = new SfDataForm(Context.ApplicationContext);
            phoneInfo                = new PhoneInfo();
            dataForm2.DataObject     = phoneInfo;
            dataForm2.ColumnCount    = 4;
            dataForm2.LayoutManager  = new DataFormLayoutManagerExt(dataForm2, ShowCountryListDialog);
            dataForm2.LabelPosition  = LabelPosition.Top;
            dataForm2.Id             = View.GenerateViewId();
            dataForm2.ValidationMode = ValidationMode.LostFocus;
            dataForm2.CommitMode     = CommitMode.LostFocus;
            view.AddView(dataForm2, dataForm2Params);

            var txtViewLayoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);

            txtViewLayoutParams.AddRule(LayoutRules.AlignParentBottom);
            txtViewLayoutParams.AddRule(LayoutRules.AlignParentRight);
            txtViewLayoutParams.Width  = ViewGroup.LayoutParams.WrapContent;
            txtViewLayoutParams.Height = ViewGroup.LayoutParams.WrapContent;

            var txtView = new TextView(Context.ApplicationContext);

            txtView.Text     = "Next";
            txtView.TextSize = 28;
            txtView.SetPadding(2, 2, 2, 2);
            txtView.Clickable = true;
            txtView.SetTextColor(Color.White);
            view.AddView(txtView, txtViewLayoutParams);

            var sfCheckboxParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent,
                                                                   ViewGroup.LayoutParams.WrapContent);

            sfCheckboxParams.AddRule(LayoutRules.Below, dataForm2.Id);
            sfCheckboxParams.Width  = ViewGroup.LayoutParams.WrapContent;
            sfCheckboxParams.Height = ViewGroup.LayoutParams.WrapContent;
            sfCheckboxParams.SetMargins(6, 4, 2, 2);


            sfCheckbox = new SfCheckBox(Context.ApplicationContext);
            int[][] states = { new[] { Android.Resource.Attribute.StateChecked }, new[] { -Android.Resource.Attribute.StateChecked } };
            int[]   colors = { Color.Purple, Color.White };
            sfCheckbox.Checked      = false;
            sfCheckbox.Text         = "I Accept the terms of use of the Application";
            sfCheckbox.TextSize     = 10;
            sfCheckbox.CornerRadius = 5.0f;
            sfCheckbox.SetTextColor(Color.White);
            sfCheckbox.ButtonTintList = new ColorStateList(states, colors);
            sfCheckbox.CheckedChange += SfCheckbox_CheckedChange;
            view.AddView(sfCheckbox, sfCheckboxParams);


            txtView.Click += TxtView_Click;
            return(view);
        }
Exemple #8
0
        public void ShowFilterPopUp <T>(string buttonText, View element, List <Models.Category> FilterOptions, T request, Func <Task> ucitajProizvodeCallback)
        {
            this.filterOptions           = FilterOptions;
            this.requestType             = typeof(T);
            this.request                 = request;
            this.ucitajProizvodeCallback = ucitajProizvodeCallback;
            DataTemplate templateView;
            Grid         layout;

            templateView = new DataTemplate(() =>
            {
                layout        = new Grid();
                layout.Margin = new Thickness(10, 0, 10, 0);

                var counter = 0;
                foreach (var item in filterOptions)
                {
                    layout.RowDefinitions.Add(new RowDefinition {
                        Height = GridLength.Auto
                    });

                    StackLayout stack = new StackLayout
                    {
                        Orientation = StackOrientation.Vertical
                    };

                    Label label = new Label
                    {
                        Text = item.Name,
                        HorizontalTextAlignment = TextAlignment.Start,
                        VerticalTextAlignment   = TextAlignment.Center,
                        VerticalOptions         = LayoutOptions.Center,
                        FontAttributes          = FontAttributes.Bold,
                        FontFamily = Device.RuntimePlatform == Device.iOS ? "Montserrat-SemiBold" :
                                     Device.RuntimePlatform == Device.Android ? "Montserrat-SemiBold.ttf#Montserrat-SemiBold" : "Assets/Montserrat-SemiBold.ttf#Montserrat-SemiBold"
                    };
                    stack.Children.Add(label);

                    if (item.FilterType == "radio")
                    {
                        SfRadioGroup radioGroup = new SfRadioGroup();
                        radioGroup.Spacing      = 0;
                        foreach (var subCategory in item.SubCategories)
                        {
                            SfRadioButton option = new SfRadioButton
                            {
                                Text    = subCategory.Value,
                                Padding = new Thickness {
                                    Left = 0, Bottom = 0, Right = 0, Top = 0
                                },
                            };

                            option.IsChecked = GetRadioButtonChecked(item.FieldName, subCategory.Value);

                            option.StateChanged += Option_StateChanged;
                            radioGroup.Children.Add(option);
                        }
                        stack.Children.Add(radioGroup);
                    }
                    else if (item.FilterType == "checkbox")
                    {
                        foreach (var subCategory in item.SubCategories)
                        {
                            SfCheckBox option = new SfCheckBox
                            {
                                Text = subCategory.Value
                            };
                            option.StateChanged += Option_StateChanged;
                            stack.Children.Add(option);
                        }
                    }



                    layout.Children.Add(stack, 0, counter++);
                }

                layout.RowDefinitions.Add(new RowDefinition {
                    Height = GridLength.Auto
                });
                SfButton button        = new SfButton();
                button.Text            = buttonText;
                button.Margin          = new Thickness(20, 0, 20, 20);
                button.VerticalOptions = LayoutOptions.End;
                button.Clicked        += Button_Clicked1;
                layout.Children.Add(button, 0, counter++);

                var scrollView = new ScrollView()
                {
                    Content = layout, HeightRequest = 150
                };

                return(scrollView);
            });

            this.PopupView.ShowHeader       = false;
            this.PopupView.ShowFooter       = false;
            this.PopupView.HeightRequest    = 600;
            this.PopupView.WidthRequest     = 300;
            this.PopupView.ShowCloseButton  = false;
            this.PopupView.AcceptButtonText = "OK";

            // Adding ContentTemplate of the SfPopupLayout
            this.PopupView.ContentTemplate = templateView;

            //this.ShowRelativeToView(element, RelativePosition.AlignBottom, 0, 0);

            // The default height and width of PopupView is 250 and 300 respectively.
            // You can set any desired values as the height and width of the popup view.

            (double btnX, double btnY) = ScreenCoords.GetScreenCoordinates(element);

            this.Show(btnX - 0, btnY + 75);
        }