コード例 #1
0
 public void ReportExperiment(string actionKey, string actionValue)
 {
     if (HasItems != CollectionState.NotEmpty && ServiceContainer.Resolve <ISettingsStore> ().ShowWelcome)
     {
         OBMExperimentManager.Send(actionKey, actionValue);
     }
 }
コード例 #2
0
        private async void OnActionButtonTouchUpInside(object sender, EventArgs e)
        {
            if (isActing)
            {
                return;
            }
            isActing = true;

            try {
                if (currentTimeEntry != null && currentTimeEntry.State == TimeEntryState.Running)
                {
                    await TimeEntryModel.StopAsync(currentTimeEntry);

                    // Ping analytics
                    ServiceContainer.Resolve <ITracker>().SendTimerStopEvent(TimerStopSource.App);
                }
                else if (timeEntryManager != null)
                {
                    currentTimeEntry = (TimeEntryModel)timeEntryManager.ActiveTimeEntry;
                    if (currentTimeEntry == null)
                    {
                        return;
                    }

                    OBMExperimentManager.Send(OBMExperimentManager.HomeEmptyState, "startButton", "click");
                    await TimeEntryModel.StartAsync(currentTimeEntry);

                    var controllers = new List <UIViewController> (parentController.NavigationController.ViewControllers);
                    controllers.Add(new EditTimeEntryViewController((TimeEntryModel)currentTimeEntry));
                    if (ServiceContainer.Resolve <SettingsStore> ().ChooseProjectForNew)
                    {
                        controllers.Add(new ProjectSelectionViewController((TimeEntryModel)currentTimeEntry));
                    }
                    parentController.NavigationController.SetViewControllers(controllers.ToArray(), true);

                    // Ping analytics
                    ServiceContainer.Resolve <ITracker>().SendTimerStartEvent(TimerStartSource.AppNew);
                }
            } finally {
                isActing = false;
            }
        }
コード例 #3
0
        public async void StartStopClick(object sender, EventArgs e)
        {
            var timeEntryData = await ViewModel.StartStopTimeEntry();

            if (ViewModel.HasMoreItems)
            {
                OBMExperimentManager.Send(OBMExperimentManager.HomeWithTEListState, "startButton", "click");
            }

            if (timeEntryData.State == Toggl.Phoebe.Data.TimeEntryState.Running)
            {
                NewTimeEntryStartedByFAB = true;

                var ids = new List <string> {
                    timeEntryData.Id.ToString()
                };
                var intent = new Intent(Activity, typeof(EditTimeEntryActivity));
                intent.PutStringArrayListExtra(EditTimeEntryActivity.ExtraGroupedTimeEntriesGuids, ids);
                intent.PutExtra(EditTimeEntryActivity.IsGrouped, false);
                StartActivity(intent);
            }
        }