Ejemplo n.º 1
0
        internal void ShowSelectFirstEmotionalStatusPage()
        {
            if (emoticonOrder == null)
            {
                emoticonOrder   = Enum.GetValues(typeof(EmotionalStatus)).Cast <EmotionalStatus>().ToList(); // typeof(EmotionalStatus).Randomize<EmotionalStatus>();
                emoticonMessage = "¿Cómo te encuentras hoy?";                                                //PositiveThingsConfiguration.CurrentConfigurationMessages.InitialEmotionalState.RandomItem();
                emoticonSet     = 'z';                                                                       // "abcdefghijkl".ToCharArray().RandomItem();
            }
            else
            {
                emoticonMessage = "¿Cómo te encuentras hoy?"; //PositiveThingsConfiguration.CurrentConfigurationMessages.InitialEmotionalState.RandomItem();
                emoticonSet     = 'z';                        // "abcdefghijkl".ToCharArray().RandomItem();
            }

            SelectEmotionalStatusPage selectEmotionalStatusPage = new SelectEmotionalStatusPage(_configuration, emoticonMessage, emoticonSet, emoticonOrder, true);

            selectEmotionalStatusPage.EmoticonOffset           = -50;
            selectEmotionalStatusPage.EmotionalStatusSelected += (emotionalStatus) =>
            {
                ShowChallengePage();
                SaveEventData(new DistractionEventData()
                {
                    EventType = DistractionEventType.SelectFirstEmotionalStatus,
                    Time      = DateTime.UtcNow,
                    UserId    = _configuration.UserId,
                    Data      = emotionalStatus.ToString(),
                });

                //ShowSelectChallengeTypePage(emotionalStatus);
            };
            _configuration.FirstEmoticons = "false";
            //selectEmotionalStatusPage.BackButtonPressed += () => { Xamarin.Forms.Application.Current.MainPage = new MainPage(); };

            selectEmotionalStatusPage.Initialize();

            Device.BeginInvokeOnMainThread(() => { Xamarin.Forms.Application.Current.MainPage = selectEmotionalStatusPage; });

            currentPage = selectEmotionalStatusPage;
        }
Ejemplo n.º 2
0
        internal void ShowSelectEndEmotionalStatusPage() //string positiveThought)
        {
            //_sessionData.PositiveThoughtSelected = positiveThought;
            //_sessionData.PositiveThoughtSelectedDate = DateTime.UtcNow;

            // SaveData(_sessionData);

            SelectEmotionalStatusPage selectEmotionalStatusPage = new SelectEmotionalStatusPage(_configuration, "¿Y cómo te sientes ahora?", emoticonSet, emoticonOrder, true);

            selectEmotionalStatusPage.EmotionalStatusSelected += EndProcess;
            //selectEmotionalStatusPage.BackButtonPressed += () => { ShowSelectFirstEmotionalStatusPage(); };
            selectEmotionalStatusPage.EnableBackButton = false;

            selectEmotionalStatusPage.ShowNavigationBarOnEntry    = false;
            selectEmotionalStatusPage.AnimateNavigationBarOnEntry = false;
            selectEmotionalStatusPage.AnimateNavigationBarOnBack  = false;
            selectEmotionalStatusPage.AnimateNavigationBarOnNext  = false;

            selectEmotionalStatusPage.Initialize();

            Device.BeginInvokeOnMainThread(() => { Xamarin.Forms.Application.Current.MainPage = selectEmotionalStatusPage; });

            currentPage = selectEmotionalStatusPage;
        }