void ReleaseDesignerOutlets()
        {
            if (BigLabel != null)
            {
                BigLabel.Dispose();
                BigLabel = null;
            }

            if (MenuTableView != null)
            {
                MenuTableView.Dispose();
                MenuTableView = null;
            }

            if (ProfileImage != null)
            {
                ProfileImage.Dispose();
                ProfileImage = null;
            }

            if (SmallLabel != null)
            {
                SmallLabel.Dispose();
                SmallLabel = null;
            }
        }
Exemple #2
0
        void ReleaseDesignerOutlets()
        {
            if (userProfileImage != null)
            {
                userProfileImage.Dispose();
                userProfileImage = null;
            }

            if (userNameLabel != null)
            {
                userNameLabel.Dispose();
                userNameLabel = null;
            }

            if (MenuTableView != null)
            {
                MenuTableView.Dispose();
                MenuTableView = null;
            }

            if (announceButton != null)
            {
                announceButton.Dispose();
                announceButton = null;
            }

            if (activityIndicator != null)
            {
                activityIndicator.Dispose();
                activityIndicator = null;
            }
        }
        private void MenuItems_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            dataSource = new MenuListDataSource(viewModel.MenuItems);
            dataSource.DidSelectMenuItem += DataSource_DidSelectMenuItem;
            MenuTableView.Source          = dataSource;
            MenuTableView.ReloadData();

            if (viewModel.MenuItems.Count > 0)
            {
                View.BringSubviewToFront(MenuTableView);
            }
        }
Exemple #4
0
        private void SetupTableView()
        {
            var selectedIndexPath = NSIndexPath.FromItemSection(0, 0);

            MenuTableView.Source = new InlineTableViewSourceWithoutRowHeight
            {
                _RowsInSection = (tv, section) => Scenes.Count,
                _GetCell       = (tv, indexPath) =>
                {
                    var scene = Scenes[indexPath.Row];

                    var cell = new UITableViewCell(UITableViewCellStyle.Subtitle, "abc")
                    {
                        BackgroundColor = UIColor.Clear
                    };

                    cell.SelectionStyle      = UITableViewCellSelectionStyle.None;
                    cell.TextLabel.Text      = scene.Title;
                    cell.TextLabel.Lines     = 0;
                    cell.TextLabel.TextColor = UIColor.White;
                    cell.TextLabel.Font      = UIFont.FromName("Apple-Kid", 48);

                    cell.DetailTextLabel.Text      = scene.Description;
                    cell.DetailTextLabel.TextColor = UIColor.White.ColorWithAlpha(.75f);
                    cell.DetailTextLabel.Font      = UIFont.FromName("Apple-Kid", 28);
                    cell.DetailTextLabel.Lines     = 0;

                    cell.ImageView.Image = selectedIndexPath == indexPath
                        ? UIImage.FromFile("selection.png")
                        : UIImage.FromFile("noselection.png");

                    cell.ImageView.Transform = CGAffineTransform.MakeTranslation(-4, 0);

                    return(cell);
                },
                _RowSelected = (tv, indexPath) =>
                {
                    var currSelection = selectedIndexPath;
                    if (currSelection != indexPath)
                    {
                        selectedIndexPath = indexPath;

                        SoundManager.PlaySound("click");
                        MenuTableView.ReloadRows(new[] { currSelection, indexPath }, UITableViewRowAnimation.None);
                    }
                    else
                    {
                        SoundManager.PlaySound("wow");
                        TransitionToScene(indexPath.Row);
                    }
                },
            };
        }
Exemple #5
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.

            var text             = "Emily Blant";
            var attributedString = new NSMutableAttributedString(text);

            attributedString.AddAttribute(UIStringAttributeKey.KerningAdjustment, new NSNumber(2.2f), new NSRange(0, text.Length - 1));
            MenuName.AttributedText = attributedString;

            MenuTableView.RegisterNibForCellReuse(TableMenuCell.Nib, TableMenuCell.Key);
            MenuTableView.RowHeight      = 44.0f;
            MenuTableView.WeakDelegate   = this;
            MenuTableView.WeakDataSource = this;
            MenuTableView.SelectRow(NSIndexPath.FromRowSection(1, 0), false, UITableViewScrollPosition.None);

            MenuTableView.Alpha = 0.0f;
            MenuName.Alpha      = 0.0f;
            MenuImage.Alpha     = 0.0f;

            SideMenuManager.Instance.MenuWillAppear += (object sender, EventArgs e) =>
            {
                UIView.Animate(SideMenuManager.Instance.TransitionDuration, () =>
                {
                    MenuTableView.Alpha = 1.0f;
                    MenuName.Alpha      = 1.0f;
                    MenuImage.Alpha     = 1.0f;
                });
            };

            SideMenuManager.Instance.MenuWillDisappear += (object sender, EventArgs e) =>
            {
                UIView.Animate(SideMenuManager.Instance.TransitionDuration, () =>
                {
                    MenuTableView.Alpha = 0.0f;
                    MenuName.Alpha      = 0.0f;
                    MenuImage.Alpha     = 0.0f;
                });
            };
        }
Exemple #6
0
        public void CheckAuthentication()
        {
            dic.Clear();
            cuenta.Clear();

            var acerca = new List <string>()
            {
                "Versión 1.0",
                "Aviso de Privacidad",
                "Nosotros",
                "Contáctanos al 800 317 1111"
            };

            if (AppSecurity.IsLogged)
            {
                cuenta.AddRange(new List <string>()
                {
                    "ConSesion",
                    "Productos Favoritos",
                    "Información del cliente",
                    "Direcciones",
                    "Órdenes",
                    "Cerrar Sesión"
                });
            }
            else
            {
                cuenta.Add("SinSesion");
            }

            dic.Add("Cuenta", cuenta);
            dic.Add("Acerca de", acerca);

            MenuSource menuSource = new MenuSource(dic, this);

            menuSource.distributor = AppSecurity.distributorLogged;
            MenuTableView.Source   = menuSource;
            MenuTableView.ReloadData();
            MenuTableView.TableFooterView = new UIView();
        }
Exemple #7
0
        protected override void SetupLayoutConstraints()
        {
            base.SetupLayoutConstraints();

            this.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            this.AddConstraints(
                AvatarImageView.AtTopOf(this, 32),
                AvatarImageView.WithSameCenterX(this),
                AvatarImageView.Width().EqualTo(114),
                AvatarImageView.Height().EqualTo(114),
                NameLabel.Below(AvatarImageView, 18),
                NameLabel.AtLeadingOf(this, 16),
                NameLabel.AtTrailingOf(this, 16),
                MenuDeviderView.AtLeadingOf(this, 0),
                MenuDeviderView.AtTrailingOf(this, 0),
                MenuDeviderView.Height().EqualTo(Theme.Dimensions.DeviderWidth),
                MenuDeviderView.Below(NameLabel, 14),
                MenuTableView.Below(MenuDeviderView),
                MenuTableView.AtLeadingOf(this),
                MenuTableView.AtTrailingOf(this),
                MenuTableView.AtBottomOf(this));
        }
        public void UpdateCellIndex(int index, string subtitle)
        {
            UITableViewCell cell = MenuTableView.CellAt(NSIndexPath.FromRowSection(index, 0));

            cell.DetailTextLabel.Text = subtitle;
        }
        public EmoteButtonPage()
        {
            ManicSlider.Minimum = 0;
            ManicSlider.Maximum = 100;

            DepressedSlider.Minimum = 0;
            DepressedSlider.Maximum = 100;

            NavigationPage.SetHasNavigationBar(this, true);

            InitializeComponent();

            Title = "Emotional Menu";

            StackLayout stackL2 = new StackLayout()
            {
                Padding = new Thickness(20)
            };


            #region Controls

            #region sliders

            ManiaL.Text       = "Mania = " + rawData.maniaVal;
            ManiaL.FontSize   = 20;
            ManicSlider.Value = rawData.maniaVal;

            ManicSlider.ValueChanged += (sender, e) => OnSliderValueChanged(sender, e, 0, ManiaL);

            DepresionL.Text       = "Depression = " + rawData.depressionVal;
            DepresionL.FontSize   = 20;
            DepressedSlider.Value = rawData.depressionVal;

            DepressedSlider.ValueChanged += (sender, e) => OnSliderValueChanged(sender, e, 1, DepresionL);

            #endregion sliders


            #region EntryCells

            EntryCell sleepHours = new EntryCell()
            {
                Label = "Hours of Sleep?",
            };

            Binding sleepBind = new Binding("sleepHours");
            sleepBind.Source = rawData;
            sleepBind.Mode   = BindingMode.TwoWay;
            sleepHours.SetBinding(EntryCell.TextProperty, sleepBind);


            #endregion EntryCells

            #endregion Controls

            var section = new TableSection
            {
                sleepHours,
            };

            var root = new TableRoot {
                section
            };

            var table = new MenuTableView()
            {
                Intent = TableIntent.Menu,
                Root   = root,
            };

            stackL2.Children.Add(ManiaL);
            stackL2.Children.Add(ManicSlider);
            stackL2.Children.Add(DepresionL);
            stackL2.Children.Add(DepressedSlider);
            stackL2.Children.Add(table);

            ScrollView scrollV = new ScrollView();
            scrollV.Content = stackL2;

            Content = scrollV;
        }
Exemple #10
0
        public MenuPage(MasterDetailPage m)
        {
            SessionMenu = new ObservableCollection <MenuModel>();
            SessionMenu.Add(new MenuModel()
            {
                Name = "All by Day", Description = "Show all sessions by day", MenuType = MenuTypes.SessionAllByDay, IconPath = "../Assets/Images/AllByDay.png"
            });
            SessionMenu.Add(new MenuModel()
            {
                Name = "My Agenda", Description = "View my agenda", MenuType = MenuTypes.SessionMyAgenda, IconPath = "../Assets/Images/MyAgenda.png"
            });
            SessionMenu.Add(new MenuModel()
            {
                Name = "By Speaker", Description = "Filter by speaker", MenuType = MenuTypes.SessionBySpeaker, IconPath = "../Assets/Images/BySpeaker.png"
            });
            SessionMenu.Add(new MenuModel()
            {
                Name = "By Time", Description = "Filter by time slot", MenuType = MenuTypes.SessionByTime, IconPath = "../Assets/Images/ByTime.png"
            });
            SessionMenu.Add(new MenuModel()
            {
                Name = "By Track", Description = "Filter by track", MenuType = MenuTypes.SessionByTrack, IconPath = "../Assets/Images/ByTrack.png"
            });
            SessionMenu.Add(new MenuModel()
            {
                Name = "News", Description = "Azure News", MenuType = MenuTypes.News, IconPath = "../Assets/Images/ByTrack.png"
            });
            SessionMenu.Add(new MenuModel()
            {
                Name = "Contact Us", Description = "Contact us", MenuType = MenuTypes.ContactUs, IconPath = "../Assets/Images/ByTrack.png"
            });
            SessionMenu.Add(new MenuModel()
            {
                Name = "About Us", Description = "About us", MenuType = MenuTypes.AboutUs, IconPath = "../Assets/Images/ByTrack.png"
            });

            _master         = m;
            BackgroundColor = App.XamDarkBlue;
            Title           = "menu";
            Icon            = Device.OnPlatform(Utils.GetFile("slideout.png"), Utils.GetFile("hamburgerIcon.png"), Utils.GetFile("slideout.png"));

            ListView      listView  = null;
            MenuTableView tableView = null;

            if (Device.OS == TargetPlatform.Android)
            {
                listView = new ListView
                {
                    RowHeight       = Device.OnPlatform(60, 60, 70),
                    BackgroundColor = App.XamDarkBlue,
                    VerticalOptions = LayoutOptions.FillAndExpand,
                    ItemTemplate    = new DataTemplate(typeof(MenuCell)),
                    ItemsSource     = SessionMenu
                };

                listView.ItemSelected += (sender, e) =>
                {
                    var item = e.SelectedItem as Models.MenuModel;
                    if (item == null)
                    {
                        return;
                    }

                    Selected(item.MenuType);

                    listView.SelectedItem = null;//clear out
                };
            }
            else
            {
                var section = new TableSection();
                foreach (var item in SessionMenu)
                {
                    section.Add(new MenuCell {
                        Text = item.Name, MenuOption = item.MenuType, Host = this
                    });
                }

                var root = new TableRoot {
                    section
                };

                tableView = new MenuTableView
                {
                    Root            = root,
                    RowHeight       = Device.OnPlatform(50, 60, 70),
                    Intent          = TableIntent.Menu,
                    BackgroundColor = App.XamDarkBlue,
                    VerticalOptions = LayoutOptions.FillAndExpand,
                };
            }

            var evolveLogo = new Frame
            {
                HasShadow         = false,
                BackgroundColor   = Color.Transparent,
                Padding           = new Thickness(Device.OnPlatform(25, 25, 40), Device.OnPlatform(0, 0, 20), 0, 0),
                HorizontalOptions = LayoutOptions.Start,
                Content           =
                    new Image
                {
                    Source = new FileImageSource
                    {
                        File = Utils.GetFile("azurelogo_100.png")
                    },
                    Aspect            = Aspect.AspectFit,
                    HorizontalOptions = LayoutOptions.Start,
                    HeightRequest     = Device.OnPlatform(60, 75, 75),
                }
            };

            var stack = new StackLayout
            {
                Padding         = new Thickness(0, Device.OnPlatform(20, 20, 20), 0, 0),
                Spacing         = 0,
                BackgroundColor = App.XamDarkBlue,
                Children        = { evolveLogo }
            };


            if (Device.OS == TargetPlatform.Android)
            {
                stack.Children.Add(listView);
            }
            else
            {
                stack.Children.Add(tableView);
            }

            if (Device.OS == TargetPlatform.WinPhone)
            {
                this.BackgroundColor = App.XamDarkBlue;
            }

            Content = stack;
        }