Example #1
0
        /// <summary>
        /// Bind view
        /// </summary>
        /// <param name="view">View.</param>
        void BindView(View view, Bundle savedInstanceState)
        {
            GetData(savedInstanceState);


            _adapter = new CallsAdapter(_calls, CallViewMode.View, OnCallAction);

            _layoutManager = new LinearLayoutManager(view.Context);

            _recyclerView = view.FindViewById <RecyclerView>(Resource.Id.recyclerView);
            _recyclerView.SetLayoutManager(_layoutManager);
            _recyclerView.SetAdapter(_adapter);

            HasOptionsMenu = true;

            Activity.ActionBar.SetDisplayHomeAsUpEnabled(true);
            Activity.ActionBar.Title = Resources.GetString(Resource.String.title_calls);

            _runNameEditText = view.FindViewById <EditText>(Resource.Id.runNameEditText);

            if (_run != null)
            {
                _runNameEditText.Text = _run.Name;
            }

            _placeholder = view.FindViewById <RelativeLayout>(Resource.Id.placeholder);

            _addCustomerButton        = view.FindViewById <FloatingActionButton>(Resource.Id.addCustomerButton);
            _addCustomerButton.Click += OnAddCustomer;

            TogglePlaceholderVisibility();
        }
Example #2
0
        /// <summary>
        /// Binds the view.
        /// </summary>
        /// <param name="view">View.</param>
        void BindView(View view)
        {
            _mode = (CallsMode)Arguments.GetInt(BundleArguments.Mode);

            var callViewMode = _mode == CallsMode.ManageRun ? CallViewMode.Edit : CallViewMode.View;

            _adapter = new CallsAdapter(_calls, callViewMode, OnCallViewHolderAction);

            _layoutManager = new LinearLayoutManager(view.Context);

            _recyclerView = view.FindViewById <RecyclerView>(Resource.Id.recyclerView);
            _recyclerView.SetLayoutManager(_layoutManager);
            _recyclerView.SetAdapter(_adapter);

            HasOptionsMenu = true;

            Activity.ActionBar.SetDisplayHomeAsUpEnabled(true);
            Activity.ActionBar.Title = Resources.GetString(Resource.String.title_calls);

            _placeholder = view.FindViewById <RelativeLayout>(Resource.Id.placeholder);

            RefreshData();
        }