Ejemplo n.º 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();
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
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 ();
        }
Ejemplo n.º 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();
        }
        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);
        }
Ejemplo n.º 6
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 ();
        }
Ejemplo n.º 7
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);

            EnsureCorrectState ();

            // Create tabs
            if (viewModel.ProjectList.Workspaces.Count > 1) {
                int i = 0;
                foreach (var ws in viewModel.ProjectList.Workspaces) {
                    var tab = tabLayout.NewTab().SetText (ws.Data.Name);
                    tabLayout.AddTab (tab);
                    if (ws.Data.Id == viewModel.TimeEntryList[0].WorkspaceId) {
                        viewModel.ProjectList.CurrentWorkspaceIndex = i;
                        tab.Select();
                    }
                    i++;
                }
            }
        }