コード例 #1
0
        public async override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);
            viewModel = await ProjectListViewModel.Init(WorkspaceId);

            var adapter = new ProjectListAdapter(recyclerView, viewModel.ProjectList);

            adapter.HandleItemSelection = OnItemSelected;
            recyclerView.SetAdapter(adapter);

            ConfigureUIViews();
            CreateWorkspaceTabs();
        }
コード例 #2
0
        public async override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);

            viewModel = new ProjectListViewModel(TimeEntryIds);
            await viewModel.Init();

            var adapter = new ProjectListAdapter(recyclerView, viewModel.ProjectList);

            adapter.HandleProjectSelection = OnItemSelected;
            recyclerView.SetAdapter(adapter);

            OnDataLoaded(null, null);
        }
コード例 #3
0
        public async override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.Apply(Style.Screen);
            EdgesForExtendedLayout = UIRectEdge.None;

            TableView.RowHeight = 60f;
            TableView.RegisterClassForHeaderFooterViewReuse(typeof(SectionHeaderView), ClientHeaderId);
            TableView.RegisterClassForCellReuse(typeof(ProjectCell), ProjectCellId);
            TableView.RegisterClassForCellReuse(typeof(TaskCell), TaskCellId);
            TableView.SeparatorStyle = UITableViewCellSeparatorStyle.None;

            var defaultFooterView = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.Gray);

            defaultFooterView.Frame = new CGRect(0, 0, 50, 50);
            defaultFooterView.StartAnimating();
            TableView.TableFooterView = defaultFooterView;

            viewModel = await ProjectListViewModel.Init(workspaceId);

            TableView.Source = new Source(this, viewModel);

            var addBtn = new UIBarButtonItem(UIBarButtonSystemItem.Add, OnAddNewProject);

            if (viewModel.WorkspaceList.Count > 1)
            {
                var filterBtn = new UIBarButtonItem(UIImage.FromFile("filter_icon.png"), UIBarButtonItemStyle.Plain, OnShowWorkspaceFilter);
                NavigationItem.RightBarButtonItems = new [] { filterBtn, addBtn };
            }
            else
            {
                NavigationItem.RightBarButtonItem = addBtn;
            }

            TableView.TableFooterView = null;
        }
コード例 #4
0
        public async override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);

            if (viewModel == null)
            {
                var timeEntryList = await ProjectListActivity.GetIntentTimeEntryData(Activity.Intent);

                if (timeEntryList.Count == 0)
                {
                    Activity.Finish();
                    return;
                }
                viewModel = new ProjectListViewModel(timeEntryList);
            }

            var adapter = new ProjectListAdapter(recyclerView, viewModel.ProjectList);

            adapter.HandleProjectSelection = OnItemSelected;
            recyclerView.SetAdapter(adapter);

            viewModel.OnIsLoadingChanged += OnModelLoaded;
            await viewModel.Init();
        }