Toggl.Joey.UI.Fragments.ProjectListFragment.EnsureCorrectState C# (CSharp) Method

EnsureCorrectState() private method

private EnsureCorrectState ( ) : void
return void
        private void EnsureCorrectState ()
        {
            // Set toolbar scrollable or not.
            var _params = new AppBarLayout.LayoutParams (toolBar.LayoutParameters);

            if (viewModel.ProjectList.Workspaces.Count > 1) {
                tabLayout.Visibility = ViewStates.Visible;
                _params.ScrollFlags  = AppBarLayout.LayoutParams.ScrollFlagScroll | AppBarLayout.LayoutParams.ScrollFlagEnterAlways;
            } else {
                tabLayout.Visibility = ViewStates.Gone;
                _params.ScrollFlags = 0;
            }

            toolBar.LayoutParameters = _params;
            recyclerView.Visibility = viewModel.ProjectList.IsEmpty ? ViewStates.Gone : ViewStates.Visible;
            emptyStateLayout.Visibility = viewModel.ProjectList.IsEmpty ? ViewStates.Visible : ViewStates.Gone;
        }