private void SetCollectionState()
        {
            // TODO RX OfflineMode needs to show the experiment screen.
            if (ViewModel.HasItems != LogTimeEntriesViewModel.CollectionState.NotReady)
            {
                View emptyView      = emptyMessageView;
                var  isWelcome      = ServiceContainer.Resolve <ISettingsStore> ().ShowWelcome;
                var  isInExperiment = OBMExperimentManager.IncludedInExperiment();
                var  hasItems       = ViewModel.HasItems == LogTimeEntriesViewModel.CollectionState.NotEmpty;

                if (isWelcome && isInExperiment)
                {
                    emptyView = experimentEmptyView;
                }
                else
                {
                    // always keeps this view hidden if it is not needed.
                    experimentEmptyView.Visibility = ViewStates.Gone;
                }

                // According to settings, show welcome message or no.
                welcomeMessage.Visibility = isWelcome ? ViewStates.Visible : ViewStates.Gone;
                noItemsMessage.Visibility = isWelcome ? ViewStates.Gone : ViewStates.Visible;

                emptyView.Visibility    = hasItems ? ViewStates.Gone : ViewStates.Visible;
                recyclerView.Visibility = hasItems ? ViewStates.Visible : ViewStates.Gone;
            }
        }
Exemple #2
0
        private void ShowEmptyState()
        {
            //Empty state is experimental.
            if (!OBMExperimentManager.IncludedInExperiment(OBMExperimentManager.HomeEmptyState))
            {
                return;
            }

            recyclerView.Visibility     = ViewModel.HasMoreItems ? ViewStates.Visible : ViewStates.Gone;
            emptyMessageView.Visibility = ViewModel.HasMoreItems ? ViewStates.Gone : ViewStates.Visible;
        }
        private void SetCollectionState()
        {
            if (ViewModel.HasItems != LogTimeEntriesViewModel.CollectionState.NotReady)
            {
                UIView emptyView      = defaultEmptyView; // Default empty view.
                var    isWelcome      = ServiceContainer.Resolve <ISettingsStore> ().ShowWelcome;
                var    isInExperiment = OBMExperimentManager.IncludedInExperiment();
                var    hasItems       = ViewModel.HasItems == LogTimeEntriesViewModel.CollectionState.NotEmpty;

                // According to settings, show welcome message or no.
                ((SimpleEmptyView)emptyView).Title = isWelcome ? "LogWelcomeTitle".Tr() : "LogEmptyTitle".Tr();

                if (isWelcome && isInExperiment)
                {
                    emptyView = obmEmptyView;
                }

                TableView.TableFooterView = hasItems ? new UIView() : emptyView;
            }
        }
Exemple #4
0
 protected virtual void UpdateFooter()
 {
     if (dataView.HasMore || dataView.IsLoading)
     {
         if (defaultFooterView == null)
         {
             defaultFooterView       = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.Gray);
             defaultFooterView.Frame = new CGRect(0, 0, 50, 50);
         }
         tableView.TableFooterView = defaultFooterView;
         defaultFooterView.StartAnimating();
     }
     else if (IsEmpty && OBMExperimentManager.IncludedInExperiment(OBMExperimentManager.HomeEmptyState))
     {
         tableView.TableFooterView = OBMEmptyView;
     }
     else if (IsEmpty)
     {
         tableView.TableFooterView = EmptyView;
     }
 }