Example #1
0
        public MenuHeaderCell(NSString cellIdentifier, float tableViewWidth,
                              FieldControlModel field) : base(UITableViewCellStyle.Default, cellIdentifier)
        {
            ContentView.BackgroundColor = Colors.Color1;
            headingLabel = new UIImageView();
            imageView    = new UIImageView();

            headingLabel.Image = UIImage.FromBundle("header_logo");
            imageView.Image    = ImageHelper.ResizeImage(UIImage.FromFile(field.ImageBundle ?? ""),
                                                         35, 25);

            CGRect frame = this.Frame;

            frame.Height = Sizes.MenuHeaderHeight;
            frame.Width  = tableViewWidth;
            this.Frame   = frame;


            nfloat centerX = Frame.Width / 2;
            nfloat centerY = Frame.Height / 2;

            nfloat imageDim = 25;

            imageView.Frame = new CGRect((float)this.Frame.Width - 50,
                                         centerY - imageView.Frame.Height - (imageDim / (float)2),
                                         imageDim, imageDim);
            headingLabel.Frame = new CGRect(0, centerY - headingLabel.Frame.Height - 12.5,
                                            (float)this.Frame.Width - 70, 30);
            Add(imageView);
            Add(headingLabel);
        }
Example #2
0
        public MenuSocialCell(NSString cellIdentifier, float tableViewWidth,
                              FieldControlModel field, MenuViewModel viewModel) : base(UITableViewCellStyle.Default, cellIdentifier)
        {
            ContentView.BackgroundColor = Colors.Color2;
            this.SelectionStyle         = UITableViewCellSelectionStyle.None;
            shareButton = new UIButton();
            shareButton.SetImage(UIImage.FromBundle("ic_screen_share_white"), UIControlState.Normal);
            twitterButton = new UIButton();
            twitterButton.SetImage(UIImage.FromBundle("ic_lightbulb_outline_white"), UIControlState.Normal);
            instagramButton = new UIButton();
            instagramButton.SetImage(UIImage.FromBundle("ic_bug_report_white"), UIControlState.Normal);
            facebookButton = new UIButton();
            facebookButton.SetImage(UIImage.FromBundle("ic_query_builder_white"), UIControlState.Normal);

            shareButton.SetButtonStyle(UIColor.Clear, Colors.White);
            twitterButton.SetButtonStyle(UIColor.Clear, Colors.White);
            instagramButton.SetButtonStyle(UIColor.Clear, Colors.White);
            facebookButton.SetButtonStyle(UIColor.Clear, Colors.White);

            CGRect frame = this.Frame;

            frame.Height = Sizes.FieldCellHeight;
            frame.Width  = tableViewWidth;
            this.Frame   = frame;

            nfloat centerX  = Frame.Width / 2;
            nfloat centerY  = Frame.Height / 2;
            nfloat imageDim = 25;

            shareButton.Frame = new CGRect(10,
                                           centerY - shareButton.Frame.Height - (imageDim / (float)2),
                                           imageDim, imageDim);
            twitterButton.Frame = new CGRect(centerX / 2,
                                             centerY - twitterButton.Frame.Height - (imageDim / (float)2),
                                             imageDim, imageDim);
            instagramButton.Frame = new CGRect(centerX,
                                               centerY - instagramButton.Frame.Height - (imageDim / (float)2),
                                               imageDim, imageDim);
            facebookButton.Frame = new CGRect(centerX + centerX / 2,
                                              centerY - facebookButton.Frame.Height - (imageDim / (float)2),
                                              imageDim, imageDim);

            //shareButton.TouchUpInside += (sender, e) => viewModel.ShowSocialCommand.Execute(viewModel.Facebook);
            //twitterButton.TouchUpInside += (sender, e) => viewModel.ShowSocialCommand.Execute(viewModel.Twitter);
            //instagramButton.TouchUpInside += (sender, e) => viewModel.ShowSocialCommand.Execute(viewModel.Instagram);
            //facebookButton.TouchUpInside += (sender, e) => viewModel.ShowSocialCommand.Execute(viewModel.Facebook);

            Add(shareButton);
            Add(twitterButton);
            Add(instagramButton);
            Add(facebookButton);
        }
Example #3
0
        //public static readonly MvxBindingDescription[] BindingDescriptions = new[]
        //{
        //	new MvxBindingDescription()
        //	{
        //		TargetName = "TitleText",
        //		Source = new MvxPathSourceStepDescription()
        //		{
        //			SourcePropertyPath = "LabelText"
        //		}
        //	}
        //};

        public OnlySingleLineTextCell(UITableViewCellStyle cellStyle, NSString cellIdentifier, float tableViewWidth,
                                      FieldControlModel field, float cellHeight = 30f)
            : base(cellStyle, cellIdentifier)
        {
            TextLabel.Text = field.LabelText;
            TextLabel.SetLabelStyle(Colors.White, Font.Regular(Sizes.FontSizeNormal));
            this.BackgroundColor = Colors.Color2;

            CGRect frame = this.Frame;

            frame.Height = cellHeight;
            frame.Width  = tableViewWidth;
            this.Frame   = frame;
        }
Example #4
0
        //public static readonly MvxBindingDescription[] BindingDescriptions = new[]
        //{
        //	new MvxBindingDescription()
        //	{
        //		TargetName = "TitleText",
        //		Source = new MvxPathSourceStepDescription()
        //		{
        //			SourcePropertyPath = "Filial"
        //		}
        //	},
        //	new MvxBindingDescription()
        //	{
        //		TargetName = "DetailText",
        //		Source = new MvxPathSourceStepDescription()
        //		{
        //			SourcePropertyPath = "Descricao"
        //		}
        //	}
        //};

        public StandardImageCell(UITableViewCellStyle cellStyle, NSString cellIdentifier,
                                 FieldControlModel field) : base(cellStyle, cellIdentifier)
        {
            this.BackgroundColor = Colors.Color2;
            TextLabel.SetLabelStyle(Colors.White, Font.Regular(Sizes.FontSizeNormal));

            TextLabel.Text = field.LabelText ?? StringsResources.NullValueError;
            if (field.ImageBundle != null)
            {
                ImageView.Image = ImageHelper.ResizeImage(UIImage.FromFile(field.ImageBundle ?? ""),
                                                          24, 24);
            }
            if (cellStyle == UITableViewCellStyle.Subtitle)
            {
                DetailTextLabel.SetLabelStyle(Colors.White, Font.Regular(Sizes.FontSizeSmall));
                DetailTextLabel.Text = field.SubLabelText;
            }
        }
Example #5
0
        public MenuButtonCell(NSString cellIdentifier, float tableViewWidth,
                              FieldControlModel field)
            : base(UITableViewCellStyle.Default, cellIdentifier)
        {
            titleText    = new UILabel();
            subtitleText = new UILabel();
            button       = new UIButton();
            CGRect frame = this.Frame;
            //nfloat centerX = Frame.Width / 2;
            //nfloat centerY = Frame.Height / 2;
            nfloat buttonHeight = 50;
            nfloat buttonWidth  = Frame.Width / 3;

            this.BackgroundColor = Colors.Color2;
            this.SelectionStyle  = UITableViewCellSelectionStyle.None;

            frame.Height = Sizes.CenterInputCellHeight;
            frame.Width  = tableViewWidth;
            this.Frame   = frame;

            button.SetButtonStyle(Colors.Color1, Colors.White);

            titleText.Frame = new CGRect(12, 10,
                                         Frame.Width, 30);
            titleText.SetLabelStyle(Colors.Color1, Font.Regular(Sizes.FontSizeNormal));

            subtitleText.Frame = new CGRect(12, 20,
                                            Frame.Width - 10, 70);
            subtitleText.SetLabelStyle(Colors.White, Font.Regular(Sizes.FontSizeSmall));
            subtitleText.LineBreakMode = UILineBreakMode.TailTruncation;
            subtitleText.Lines         = 4;

            button.Frame = new CGRect(12, Frame.Height - buttonHeight - 10,
                                      buttonWidth, buttonHeight);
            button.SetViewConnerRadius(UIRectCorner.AllCorners, Sizes.ConnerSizes);

            Add(titleText);
            Add(subtitleText);
            Add(button);

            titleText.Text    = field.LabelText ?? StringsResources.NullValueError;
            subtitleText.Text = field.SubLabelText ?? StringsResources.NullValueError;
            button.SetTitle(field.EditLabelPlaceHolder, UIControlState.Normal);
        }