예제 #1
0
        private void InitUI()
        {
            _baseLayout = new StackLayout()
            {
                BackgroundColor = Color.FromRgb(0, 0, 0),
                VerticalOptions = LayoutOptions.Fill,
                Padding         = 20
            };

            _headerImage = new Image
            {
                Aspect        = Aspect.AspectFit,
                Source        = ImageSource.FromFile("Images/cinnamon.png"),
                HeightRequest = 150
            };

            _questionLabel = new Label
            {
                FontSize = 30,
                HorizontalTextAlignment = TextAlignment.Center,
                TextColor         = Color.White,
                VerticalOptions   = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.Center,
                Margin            = new Thickness(20, 20, 20, 60)
            };

            _baseLayout.Children.Add(_headerImage);
            _baseLayout.Children.Add(_questionLabel);


            List <string> emojiIconList = new List <string>
            {
                "Images/angry.png",
                "Images/sad.png",
                "Images/shy.png",
                "Images/surprise.png",
                "Images/love.png"
            };

            List <string> emojiDescList = new List <string>
            {
                "Highly Dissatisfied",
                "Dissatisfied",
                "Neutral",
                "Satisfied",
                "Highly Satisfied"
            };

            ComponentEmoji ecv = new ComponentEmoji();
            StackLayout    sl  = ecv.EmojiCompLayout(emojiIconList, emojiDescList);

            ComponentNavPane npv = new ComponentNavPane();
            RelativeLayout   sl2 = npv.GetNavPane();

            _messageLabel       = npv.GetMessageLabel();
            sl2.VerticalOptions = LayoutOptions.EndAndExpand;

            ComponentProgressPane cpp = new ComponentProgressPane();
            StackLayout           sl3 = cpp.GetProgressPane();

            ComponentHeatBarList chbl = new ComponentHeatBarList();

            _childLayout           = chbl.GetHeatBarListLayout(_currQuesIndex);
            _childLayout.IsVisible = false;

            _baseLayout.Children.Add(sl);
            _baseLayout.Children.Add(_childLayout);
            _baseLayout.Children.Add(sl2);
            _baseLayout.Children.Add(sl3);


            _scrollView = new ScrollView()
            {
                Content         = _baseLayout,
                BackgroundColor = Color.Black,
                VerticalOptions = LayoutOptions.Fill
            };


            Content = _scrollView;
        }
예제 #2
0
        private void InitUI(int buttonCount)
        {
            _baseLayout = new StackLayout()
            {
                BackgroundColor = Color.FromRgb(0, 0, 0),
                VerticalOptions = LayoutOptions.Fill,
                Padding         = 20
            };

            _headerImage = new Image
            {
                Aspect        = Aspect.AspectFit,
                Source        = ImageSource.FromFile("Images/cinnamon.png"),
                HeightRequest = 150
            };

            _questionLabel = new Label
            {
                Text     = "How satisfied are you",
                FontSize = 30,
                HorizontalTextAlignment = TextAlignment.Center,
                TextColor         = Color.White,
                HorizontalOptions = LayoutOptions.Center,
                Margin            = new Thickness(20, 20, 20, 60)
            };

            _baseLayout.Children.Add(_headerImage);
            _baseLayout.Children.Add(_questionLabel);

            ComponentHeatBar chb = new ComponentHeatBar();
            StackLayout      sl  = chb.GetHeatBarLayout(buttonCount);

            sl.VerticalOptions = LayoutOptions.StartAndExpand;

            ComponentNavPane cnp = new ComponentNavPane();
            RelativeLayout   sl2 = cnp.GetNavPane();

            _messageLabel       = cnp.GetMessageLabel();
            sl2.VerticalOptions = LayoutOptions.EndAndExpand;

            ComponentProgressPane cpp = new ComponentProgressPane();
            StackLayout           sl3 = cpp.GetProgressPane();

            ComponentHeatBarList chbl = new ComponentHeatBarList();

            _childLayout           = chbl.GetHeatBarListLayout(_currQuesIndex);
            _childLayout.IsVisible = false;

            _baseLayout.Children.Add(sl);
            _baseLayout.Children.Add(_childLayout);
            _baseLayout.Children.Add(sl2);
            _baseLayout.Children.Add(sl3);

            _scrollView = new ScrollView()
            {
                Content         = _baseLayout,
                BackgroundColor = Color.Black,
                VerticalOptions = LayoutOptions.Fill
            };


            Content = _scrollView;
        }