Example #1
0
        public NewInheritanceLayout(ActivityDatabase activityDatabase, LayoutStack layoutStack)
        {
            this.activityDatabase = activityDatabase;
            this.layoutStack      = layoutStack;

            this.SetTitle("Relate Two Existing Activities");

            GridLayout bottomGrid = GridLayout.New(new BoundProperty_List(2), BoundProperty_List.Uniform(2), LayoutScore.Zero);

            this.childNameBox = new ActivityNameEntryBox("Activity Name", activityDatabase, layoutStack);
            this.childNameBox.AutoAcceptAutocomplete = false;
            bottomGrid.AddLayout(this.childNameBox);

            this.parentNameBox = new ActivityNameEntryBox("Parent Name", activityDatabase, layoutStack);
            this.parentNameBox.AutoAcceptAutocomplete = false;
            bottomGrid.AddLayout(this.parentNameBox);

            this.okButton          = new Button();
            this.okButton.Clicked += OkButton_Clicked;
            bottomGrid.AddLayout(new ButtonLayout(this.okButton, "OK"));


            LayoutChoice_Set helpWindow = (new HelpWindowBuilder()).AddMessage("This screen is for you to enter activities, to use as future suggestions.")
                                          .AddMessage("The text box on the left is where you type the activity name.")
                                          .AddMessage("The text box on the right is where you type another activity that you want to make be a parent of the given activity.")
                                          .AddMessage("For example, you might specify that Gaming is a child activity of the Fun activity. Grouping activities like this is helpful for two reasons. It gives " +
                                                      "ActivityRecommender more understanding about the relationships between activities and can help it to notice trends. It also means that you can later request a suggestion " +
                                                      "from within Activity \"Fun\" and ActivityRecommender will know what you mean, and might suggest \"Gaming\".")
                                          .AddMessage("If you haven't created the parent activity yet, you'll have to create it first. The only activity that exists at the beginning is the built-in activity " +
                                                      "named \"Activity\".")
                                          .AddMessage("While typing you can press Enter to fill in the autocomplete suggestion.")
                                          .Build();

            HelpButtonLayout helpLayout = new HelpButtonLayout(helpWindow, layoutStack);

            bottomGrid.AddLayout(helpLayout);

            this.feedbackLayout = new TextblockLayout();

            GridLayout mainGrid = new Vertical_GridLayout_Builder()
                                  .AddLayout(this.feedbackLayout)
                                  .AddLayout(bottomGrid)
                                  .Build();

            this.SetContent(mainGrid);
        }
Example #2
0
 public AddInheritance_Feature(ActivityDatabase activityDatabase)
 {
     this.activityDatabase = activityDatabase;
 }
 public UserEnteredARating_Feature(ActivityDatabase activityDatabase)
 {
     this.activityDatabase = activityDatabase;
 }
        public ParticipationEntryView(ActivityDatabase activityDatabase, LayoutStack layoutStack)
        {
            this.activityDatabase           = activityDatabase;
            activityDatabase.ActivityAdded += ActivityDatabase_ActivityAdded;
            this.layoutStack = layoutStack;

            BoundProperty_List rowHeights = new BoundProperty_List(6);

            rowHeights.BindIndices(0, 1);
            rowHeights.BindIndices(0, 2);
            rowHeights.BindIndices(0, 3);
            rowHeights.SetPropertyScale(0, 5);   // activity name and feedback
            rowHeights.SetPropertyScale(1, 5);   // rating, comments, and metrics
            rowHeights.SetPropertyScale(2, 2.3); // start and end times
            rowHeights.SetPropertyScale(3, 2);   // buttons

            // activity name and feedback
            Vertical_GridLayout_Builder nameAndFeedback_builder = new Vertical_GridLayout_Builder();

            GridLayout contents = GridLayout.New(rowHeights, BoundProperty_List.Uniform(1), LayoutScore.Zero);

            this.nameBox = new ActivityNameEntryBox("What Have You Been Doing?", activityDatabase, layoutStack);
            this.nameBox.AutoAcceptAutocomplete      = false;
            this.nameBox.PreferSuggestibleActivities = true;
            this.nameBox.NameTextChanged            += this.ActivityNameText_Changed;
            nameAndFeedback_builder.AddLayout(this.nameBox);

            this.promptHolder = new ContainerLayout();
            nameAndFeedback_builder.AddLayout(this.promptHolder);

            Button responseButton = new Button();

            responseButton.Clicked += ResponseButton_Clicked;
            this.participationFeedbackButtonLayout = new ButtonLayout(responseButton);
            contents.AddLayout(nameAndFeedback_builder.BuildAnyLayout());

            Button acceptSuggestion_button = new Button();

            acceptSuggestion_button.Clicked += AcceptSuggestions_button_Clicked;

            Button visitSuggestions_button = new Button();

            visitSuggestions_button.Clicked += VisitSuggestions_button_Clicked;
            this.suggestionLayout            = new TextblockLayout();

            this.suggestionsLayout = new Vertical_GridLayout_Builder()
                                     .AddLayout(suggestionLayout)
                                     .AddLayout(new Horizontal_GridLayout_Builder().Uniform()
                                                .AddLayout(new ButtonLayout(acceptSuggestion_button, "Yes"))
                                                .AddLayout(new ButtonLayout(visitSuggestions_button, "More ideas"))
                                                .BuildAnyLayout()
                                                )
                                     .BuildAnyLayout();

            Button experimentFeedbackButton = new Button();

            experimentFeedbackButton.Clicked += ExperimentFeedbackButton_Clicked;
            this.experimentFeedbackLayout     = new ButtonLayout(experimentFeedbackButton, "Experiment Complete!");

            Vertical_GridLayout_Builder detailsBuilder = new Vertical_GridLayout_Builder();

            GridLayout commentAndRating_grid = GridLayout.New(BoundProperty_List.Uniform(1), BoundProperty_List.Uniform(2), LayoutScore.Zero);

            this.ratingBox = new RelativeRatingEntryView();
            this.ratingBox.RatingRatioChanged += RatingBox_RatingRatioChanged;
            commentAndRating_grid.AddLayout(this.ratingBox);
            this.commentBox = new PopoutTextbox("Comment", layoutStack);
            this.commentBox.Placeholder("(Optional)");
            commentAndRating_grid.AddLayout(this.commentBox);

            detailsBuilder.AddLayout(commentAndRating_grid);
            this.todoCompletionStatusHolder = new ContainerLayout();
            this.metricChooser = new ChooseMetric_View(true);
            this.metricChooser.ChoseNewMetric += TodoCompletionLabel_ChoseNewMetric;

            LayoutChoice_Set metricLayout = new Vertical_GridLayout_Builder().Uniform()
                                            .AddLayout(this.metricChooser)
                                            .AddLayout(this.todoCompletionStatusHolder)
                                            .Build();

            this.helpStatusHolder = new ContainerLayout();
            GridLayout_Builder centered_todoInfo_builder = new Horizontal_GridLayout_Builder().Uniform();

            centered_todoInfo_builder.AddLayout(metricLayout);
            centered_todoInfo_builder.AddLayout(this.helpStatusHolder);
            GridLayout_Builder offset_todoInfo_builder = new Horizontal_GridLayout_Builder();

            offset_todoInfo_builder.AddLayout(metricLayout);
            offset_todoInfo_builder.AddLayout(this.helpStatusHolder);

            LayoutChoice_Set metricStatusLayout = new LayoutUnion(
                centered_todoInfo_builder.Build(),
                new ScoreShifted_Layout(
                    offset_todoInfo_builder.Build(),
                    LayoutScore.Get_UnCentered_LayoutScore(1)
                    )
                );

            this.helpStatusPicker = new HelpDurationInput_Layout(this.layoutStack);
            detailsBuilder.AddLayout(metricStatusLayout);
            contents.AddLayout(detailsBuilder.BuildAnyLayout());

            GridLayout grid3 = GridLayout.New(BoundProperty_List.Uniform(1), BoundProperty_List.Uniform(2), LayoutScore.Zero);

            this.startDateBox = new DateEntryView("Start Time", this.layoutStack);
            this.startDateBox.Add_TextChanged_Handler(new EventHandler <TextChangedEventArgs>(this.DateText_Changed));
            grid3.AddLayout(this.startDateBox);
            this.endDateBox = new DateEntryView("End Time", this.layoutStack);
            this.endDateBox.Add_TextChanged_Handler(new EventHandler <TextChangedEventArgs>(this.DateText_Changed));
            grid3.AddLayout(this.endDateBox);
            contents.AddLayout(grid3);
            this.setStartdateButton = new Button();
            this.setEnddateButton   = new Button();

            this.okButton = new Button();

            LayoutChoice_Set helpWindow = (new HelpWindowBuilder()).AddMessage("Use this screen to record participations.")
                                          .AddMessage("1. Type the name of the activity that you participated in, and press Enter if you want to take the autocomplete suggestion.")
                                          .AddMessage("You must have entered some activities in the activity name entry screen in order to enter them here.")
                                          .AddMessage("Notice that once you enter an activity name, ActivityRecommender will tell you how it estimates this will affect your longterm happiness.")
                                          .AddMessage("2. You may enter a rating (this is strongly recommended). The rating is a measurement of how much happiness you received per unit time from "
                                                      + "this participation divided by the amount of happiness you received per unit time for the previous. "
                                                      + "(The ratio that you enter will be combined with ActivityRecommender's previous expectations of how much you would enjoy these two "
                                                      + "participations, and will be used to create an appropriate absolute rating from 0 to 1 for this participation.)")
                                          .AddMessage("If this Activity is a ToDo, you will see a box asking you to specify whether you completed the ToDo. Press the box if you completed it.")
                                          .AddMessage("3. Enter a start date and an end date. If you use the \"End = Now\" button right when the activity completes, you don't even need to type the date in. If you " +
                                                      "do have to type the date in, press the white box.")
                                          .AddMessage("4. Enter a comment if you like.")
                                          .AddMessage("5. Lastly, press OK.")
                                          .AddMessage("It's up to you how many participations you log, how often you rate them, and how accurate the start and end dates are. ActivityRecommender will be able to " +
                                                      "provide more useful help to you if you provide more accurate data, but even just a few participations per day should still be enough for meaningful feedback.")
                                          .AddLayout(new CreditsButtonBuilder(layoutStack)
                                                     .AddContribution(ActRecContributor.AARON_SMITH, new DateTime(2019, 8, 17), "Pointed out out that it was hard to tell when the participation and suggestion screens are not yet relevant due to not having any activities")
                                                     .AddContribution(ActRecContributor.ANNI_ZHANG, new DateTime(2019, 11, 10), "Suggested disallowing entering participations having empty durations")
                                                     .AddContribution(ActRecContributor.ANNI_ZHANG, new DateTime(2019, 11, 28), "Mentioned that the keyboard was often in the way of text boxes on iOS")
                                                     .AddContribution(ActRecContributor.ANNI_ZHANG, new DateTime(2020, 1, 26), "Pointed out that feedback should be relative to average rather happiness than relative to the previous participation")
                                                     .AddContribution(ActRecContributor.ANNI_ZHANG, new DateTime(2020, 4, 19), "Discussed participation feedback messages")
                                                     .AddContribution(ActRecContributor.ANNI_ZHANG, new DateTime(2020, 7, 12), "Pointed out that the time required to log a participation can cause the end time of the next participation to be a couple minutes after the previous one")
                                                     .AddContribution(ActRecContributor.ANNI_ZHANG, new DateTime(2020, 8, 15), "Suggested that if the participation feedback recommends a different time, then it should specify which time")
                                                     .AddContribution(ActRecContributor.ANNI_ZHANG, new DateTime(2020, 8, 30), "Pointed out that participation feedback was missing more often than it should have been.")
                                                     .AddContribution(ActRecContributor.ANNI_ZHANG, new DateTime(2020, 8, 30), "Pointed out that the text in the starttime box had stopped fitting properly.")
                                                     .AddContribution(ActRecContributor.ANNI_ZHANG, new DateTime(2020, 10, 3), "Pointed out that it was possible record participations in the future.")
                                                     .AddContribution(ActRecContributor.ANNI_ZHANG, new DateTime(2021, 3, 9), "Suggested making different metrics appear more distinct.")
                                                     .AddContribution(ActRecContributor.ANNI_ZHANG, new DateTime(2021, 3, 21), "Pointed out that the participation feedback had stopped finding a better activity")
                                                     .AddContribution(ActRecContributor.ANNI_ZHANG, new DateTime(2021, 6, 6), "Suggested showing suggestions in the participation entry view")
                                                     .AddContribution(ActRecContributor.ANNI_ZHANG, new DateTime(2021, 7, 2), "Suggested shortening the text in the rating entry view")
                                                     .Build()
                                                     )
                                          .Build();

            GridLayout grid4 = GridLayout.New(BoundProperty_List.Uniform(1), BoundProperty_List.Uniform(4), LayoutScore.Zero);

            grid4.AddLayout(new ButtonLayout(this.setStartdateButton, "Start = now", 16));
            grid4.AddLayout(new ButtonLayout(this.okButton));
            grid4.AddLayout(new HelpButtonLayout(helpWindow, this.layoutStack));
            grid4.AddLayout(new ButtonLayout(this.setEnddateButton, "End = now", 16));
            contents.AddLayout(grid4);

            this.mainLayout = LayoutCache.For(contents);

            Vertical_GridLayout_Builder noActivities_help_builder = new Vertical_GridLayout_Builder();

            noActivities_help_builder.AddLayout(new TextblockLayout("This screen is where you will be able to record having participated in an activity.\n"));
            noActivities_help_builder.AddLayout(
                new HelpButtonLayout("Recording a participation is deceptively easy",
                                     new HelpWindowBuilder()
                                     .AddMessage("Autocomplete is everywhere in ActivityRecommender and is very fast. You will be impressed.")
                                     .AddMessage("Autocomplete is one of the reasons that you must enter an Activity before you can record a participation, so " +
                                                 "ActivityRecommender can know which activity you're referring to, usually after you type only one or two letters.")
                                     .Build()
                                     ,
                                     layoutStack
                                     )
                );
            noActivities_help_builder.AddLayout(
                new HelpButtonLayout("You get feedback!",
                                     new HelpWindowBuilder()
                                     .AddMessage("Nearly every time you record a participation, ActivityRecommender will give you feedback on what you're doing. " +
                                                 "This feedback will eventually contain suggestions of other things you could be doing now, and alternate times for what you " +
                                                 "did do. This feedback gets increasingly specific and increasingly accurate as you record more data, eventually including " +
                                                 "current happiness, future happiness, and future efficiency. Wow!")
                                     .Build()
                                     ,
                                     layoutStack
                                     )
                );

            noActivities_help_builder.AddLayout(new TextblockLayout("Before you can record a participation, ActivityRecommender needs you to go back " +
                                                                    "and add some activities first. Here is a convenient button for jumping directly to the Activities screen:"));

            Button activitiesButton = new Button();

            activitiesButton.Text     = "Activities";
            activitiesButton.Clicked += ActivitiesButton_Clicked;
            noActivities_help_builder.AddLayout(new ButtonLayout(activitiesButton));

            this.noActivities_explanationLayout = noActivities_help_builder.BuildAnyLayout();
        }
 public UserLoggedAParticipation_Feature(ActivityDatabase activityDatabase)
 {
     this.activityDatabase = activityDatabase;
 }
 public UserEnteredAComment_Feature(ActivityDatabase activityDatabase)
 {
     this.activityDatabase = activityDatabase;
 }
Example #7
0
 public CreateSolution_Feature(ActivityDatabase activityDatabase)
 {
     this.activityDatabase = activityDatabase;
 }
Example #8
0
 public CreateProblem_Feature(ActivityDatabase activityDatabase)
 {
     this.activityDatabase = activityDatabase;
 }
Example #9
0
 public CreateTodo_Feature(ActivityDatabase activityDatabase)
 {
     this.activityDatabase = activityDatabase;
 }
Example #10
0
        public ActivityCreationLayout(ActivityDatabase activityDatabase, LayoutStack layoutStack)
        {
            this.activityDatabase = activityDatabase;
            this.layoutStack      = layoutStack;

            this.SetTitle("New Activity");
            SingleSelect typeSelector = new SingleSelect("Type:", this.typeChoices);

            GridLayout mainGrid = GridLayout.New(new BoundProperty_List(3), new BoundProperty_List(1), LayoutScore.Zero);

            mainGrid.AddLayout(typeSelector);
            this.feedbackLayout = new TextblockLayout("", 18).AlignVertically(TextAlignment.Center);
            mainGrid.AddLayout(this.feedbackLayout);

            GridLayout bottomGrid = GridLayout.New(new BoundProperty_List(2), BoundProperty_List.Uniform(2), LayoutScore.Zero);

            mainGrid.AddLayout(bottomGrid);

            this.typePicker       = typeSelector;
            typeSelector.Updated += TypeSelector_Clicked;

            this.childNameBox = new ActivityNameEntryBox("Activity Name", activityDatabase, layoutStack, true);
            this.childNameBox.AutoAcceptAutocomplete = false;
            bottomGrid.AddLayout(this.childNameBox);

            this.parentNameBox = new ActivityNameEntryBox("Parent Name", activityDatabase, layoutStack);
            this.parentNameBox.AutoAcceptAutocomplete = false;
            // for first-time users, make it extra obvious that the root activity exists
            this.parentNameBox.autoselectRootActivity_if_noCustomActivities();
            bottomGrid.AddLayout(this.parentNameBox);

            this.okButton          = new Button();
            this.okButton.Clicked += OkButton_Clicked;
            bottomGrid.AddLayout(new ButtonLayout(this.okButton, "OK"));

            LayoutChoice_Set helpWindow = (new HelpWindowBuilder()).AddMessage("This screen is for you to enter activities to do, to use as future suggestions.")
                                          .AddMessage("In the left text box, choose a name for the activity.")
                                          .AddMessage("In the right text box, specify another activity to assign as its parent.")
                                          .AddMessage("For example, you might specify that Gaming is a child activity of the Fun activity. Grouping activities like this is helpful for two reasons. It gives " +
                                                      "ActivityRecommender more understanding about the relationships between activities and can help it to notice trends. It also means that you can later request a suggestion " +
                                                      "from within Activity \"Fun\" and ActivityRecommender will know what you mean, and might suggest \"Gaming\".")
                                          .AddMessage("If you haven't created the parent activity yet, you'll have to create it first. The only activity that exists at the beginning is the built-in activity " +
                                                      "named \"Activity\".")
                                          .AddMessage("While typing you can press Enter to fill in the autocomplete suggestion.")
                                          .AddMessage("If the thing you're creating is something you plan to do many times (or even if you want it to be able to be the parent of another Activity), then select the type " +
                                                      "Category. For example, Sleeping would be a Category.")
                                          .AddMessage("If the thing you're creating is something you plan to complete once and don't plan to do again, then select the type ToDo. For example, \"Reading " +
                                                      "ActivityRecommender's Built-In Features Overview\" would be a ToDo.")
                                          .AddMessage("If the thing you're creating is something measureable that you might try to solve repeatedly but in different ways, then select the type Problem. For example, " +
                                                      "\"Headache\" (or \"Fixing my Headache\") would be a Problem because it may be addressed in several ways: resting, drinking water, or adjusting your posture")
                                          .AddMessage("If the thing you're creating is something that solves a Problem, then select the type Category and choose the appropriate Problem as a parent. Note " +
                                                      "that there is also a choice named \"Solution\", which is another name for Category, to emphasize this.")
                                          .AddLayout(new CreditsButtonBuilder(layoutStack)
                                                     .AddContribution(ActRecContributor.AARON_SMITH, new DateTime(2019, 8, 17), "Suggested that if Activity is the only valid choice then it should autopopulate")
                                                     .AddContribution(ActRecContributor.DAGOBERT_RENOUF, new DateTime(2021, 06, 14), "Mentioned that it was difficult to determine how to create a new activity without " +
                                                                      "visual hierarchy among the elements on the screen")
                                                     .Build()
                                                     )
                                          .Build();

            HelpButtonLayout helpLayout = new HelpButtonLayout(helpWindow, layoutStack);

            bottomGrid.AddLayout(helpLayout);

            this.explainActivityType();

            this.SetContent(mainGrid);
        }