예제 #1
0
        public override void OnCreateView(LayoutInflater inflater, ViewGroup container)
        {
            base.OnCreateView(inflater, container);

            #region Desinger Stuff

            SetContentView(Resource.Layout.FragmentChat, inflater, container);

            ResizeToShowKeyboard();

            this.HasOptionsMenu = true;

            #endregion

            this.Title = "Chat";

            this.ActionBar.Show();

            this.HeaderLayout.Clickable = true;
            this.HeaderLayout.SetOnTouchListener(GestureListener.ForSingleTapUp(this.Activity,
                                                                                (e) =>
            {
                var f       = new IssueFragment();
                f.Arguments = new Bundle();
                f.Arguments.PutInt("GimmickId", _gimmickId);
                f.Arguments.PutObject <Issue>("Issue", _issue);
                this.FragmentManager.BeginTransaction()
                .AddToBackStack("BeforeIssueFragment")
                .Replace(Resource.Id.ContentLayout, f, "IssueFragment")
                .Commit();
            }));

            this.MessageList.SetAdapter(_adapter);

            this.SendButton.Click += SendButton_Click;

            if (_issue != null)
            {
                LoadIssue();
            }

            RefreshMessages();
        }
예제 #2
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
            case 1:

                var f = new IssueFragment();
                f.Arguments = new Bundle();
                f.Arguments.PutInt("GimmickId", _gimmickId);
                this.FragmentManager.BeginTransaction()
                .AddToBackStack("BeforeIssueFragment")
                .Replace(Resource.Id.ContentLayout, f, "IssueFragment")
                .Commit();

                return(true);

            default:
                return(base.OnOptionsItemSelected(item));
            }
        }
예제 #3
0
        public override void OnCreateView(LayoutInflater inflater, ViewGroup container)
        {
            base.OnCreateView(inflater, container);

            #region Desinger Stuff

            SetContentView(Resource.Layout.FragmentIssues, inflater, container);

            this.FilterButtons = new[] { this.FilterOpenedButton, this.FilterWorkingButton, this.FilterClosedButton };

            this.HasOptionsMenu = true;

            #endregion

            this.Title = "Issues";

            this.FilterOpenedButton.Click  += FilterButton_Click;
            this.FilterWorkingButton.Click += FilterButton_Click;
            this.FilterClosedButton.Click  += FilterButton_Click;

            _adapter = new IssueAdapter(this, new Issue[0]);
            this.IssueList.SetAdapter(_adapter);
            this.IssueList.ItemSelected += IssueList_ItemSelected;

            if (_addNew)
            {
                _addNew = false;

                var f = new IssueFragment();
                f.Arguments = new Bundle();
                f.Arguments.PutInt("GimmickId", _gimmickId);
                this.FragmentManager.BeginTransaction()
                .AddToBackStack("BeforeIssueFragment")
                .Replace(Resource.Id.ContentLayout, f, "IssueFragment")
                .Commit();
            }
            else
            {
                RefreshIssues(_filter);
            }
        }