Example #1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);

            var view = inflater.Inflate(Resource.Layout.EventCommentList, container, false);

            // Service
            uService = new UserService(DataBase.current_user);

            // views
            // Comment content
            comContentET = view.FindViewById <EditText>(Resource.Id.event_comment_text);

            // valid button
            comValidButton = view.FindViewById <ImageButton>(Resource.Id.event_commentSend_btn);
            if (comValidButton != null)
            {
                comValidButton.Click += delegate
                {
                    Comment comment = publishComment();

                    // Ajout du commentaire dans l'événement
                    commentList = DataBase.currentEvent.addComment(comment);

                    // Refresh the list
                    EventCommentAdapter newAdapter = new EventCommentAdapter(Activity, commentList);
                    listView.Adapter = newAdapter;
                }
            }
            ;

            // ListView
            listView = view.FindViewById <ListView>(Resource.Id.event_comment_listView);

            // Notifications list : liste de commentaires des événements
            commentList = DataBase.currentEvent.comments;

            // Create and set the adapter
            EventCommentAdapter adapter = new EventCommentAdapter(Activity, commentList);

            if (listView != null)
            {
                listView.Adapter = adapter;
            }

            // Return
            return(view);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);

            var view = inflater.Inflate(Resource.Layout.EventCommentList, container, false);

            // Service
            uService = new UserService(DataBase.current_user);

            // views
            // Comment content
            comContentET = view.FindViewById<EditText>(Resource.Id.event_comment_text);

            // valid button
            comValidButton = view.FindViewById<ImageButton>(Resource.Id.event_commentSend_btn);
            if (comValidButton != null)
                comValidButton.Click += delegate
                {
                    Comment comment = publishComment();

                    // Ajout du commentaire dans l'événement
                    commentList = DataBase.currentEvent.addComment(comment);

                    // Refresh the list
                    EventCommentAdapter newAdapter = new EventCommentAdapter(Activity, commentList);
                    listView.Adapter = newAdapter;
                };

            // ListView
            listView = view.FindViewById<ListView>(Resource.Id.event_comment_listView);

            // Notifications list : liste de commentaires des événements
            commentList = DataBase.currentEvent.comments;

            // Create and set the adapter
            EventCommentAdapter adapter = new EventCommentAdapter(Activity, commentList);

            if (listView != null)
                listView.Adapter = adapter;

            // Return
            return view;
        }
Example #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "group" layout resource
            SetContentView(Resource.Layout.Group);

            string group_name = GroupManagerActivity.current_group_selected.groupName;

            //on affecte le groupe courant au groupe selectionné
            foreach (Group grp in DataBase.current_user.groups)
            {
                if (grp.groupName == group_name)
                {
                    current_group = grp;

                    if (grp != null)
                    {
                        Title = current_group.groupName;
                    }
                }
            }

            //click sur Membres
            TextView membres = FindViewById <TextView>(Resource.Id.groupMembersTextView);

            membres.Click += delegate
            {
                FragmentTransaction  tx             = FragmentManager.BeginTransaction();
                GroupMembersFragment contactsDialog = new GroupMembersFragment();
                contactsDialog.Show(tx, "Membres");
            };

            //click sur Admins
            TextView admins = FindViewById <TextView>(Resource.Id.groupAdminsTextView);

            admins.Click += delegate
            {
                FragmentTransaction tx             = FragmentManager.BeginTransaction();
                GroupAdminsFragment contactsDialog = new GroupAdminsFragment();
                contactsDialog.Show(tx, "Admins");
            };

            //click sur évènements
            TextView ev = FindViewById <TextView>(Resource.Id.groupEventsTextView);

            ev.Click += delegate
            {
                UserService uService = new UserService(DataBase.current_user);
                StartActivity(typeof(GroupEventsActivity));
            };


            //


            // Service
            uService = new UserService(DataBase.current_user);

            // views
            // Comment content
            comContentET = FindViewById <EditText>(Resource.Id.group_comment_text);

            // valid button
            comValidButton = FindViewById <ImageButton>(Resource.Id.group_commentSend_btn);

            if (comValidButton != null)
            {
                comValidButton.Click += delegate
                {
                    if (comContentET != null)
                    {
                        Comment comment = publishComment();

                        // Ajout du commentaire dans l'événement

                        if (current_group != null)
                        {
                            commentList = current_group.AddComment(comment);
                        }

                        // Refresh the list
                        EventCommentAdapter newAdapter = new EventCommentAdapter(this, commentList);
                        listView.Adapter = newAdapter;
                    }
                }
            }
            ;

            // ListView
            listView = FindViewById <ListView>(Resource.Id.group_comment_listView);

            // Notifications list : liste de commentaires des événements
            commentList = current_group.GetAllComments();

            // Create and set the adapter
            EventCommentAdapter adapter = new EventCommentAdapter(this, commentList);

            if (listView != null)
            {
                listView.Adapter = adapter;
            }
        }
Example #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "group" layout resource
            SetContentView(Resource.Layout.Group);

            string group_name = GroupManagerActivity.current_group_selected.groupName;
            //on affecte le groupe courant au groupe selectionné
            foreach (Group grp in DataBase.current_user.groups)
            {
                if (grp.groupName == group_name)
                {
                    current_group = grp;

                    if (grp != null)
                    Title = current_group.groupName;
                }
            }

            //click sur Membres
            TextView membres = FindViewById<TextView>(Resource.Id.groupMembersTextView);
            membres.Click += delegate 
            {
                FragmentTransaction tx = FragmentManager.BeginTransaction();
                GroupMembersFragment contactsDialog = new GroupMembersFragment();
                contactsDialog.Show(tx, "Membres");
            };

            //click sur Admins
            TextView admins = FindViewById<TextView>(Resource.Id.groupAdminsTextView);
            admins.Click += delegate
            {
                FragmentTransaction tx = FragmentManager.BeginTransaction();
                GroupAdminsFragment contactsDialog = new GroupAdminsFragment();
                contactsDialog.Show(tx, "Admins");
            };

            //click sur évènements
            TextView ev = FindViewById<TextView>(Resource.Id.groupEventsTextView);
            ev.Click += delegate 
            {
                UserService uService = new UserService(DataBase.current_user);
                StartActivity(typeof(GroupEventsActivity));
            };


            // 


            // Service
            uService = new UserService(DataBase.current_user);

            // views
            // Comment content
            comContentET =FindViewById<EditText>(Resource.Id.group_comment_text);

            // valid button
            comValidButton = FindViewById<ImageButton>(Resource.Id.group_commentSend_btn);

            if (comValidButton != null)
                comValidButton.Click += delegate
                {
                    if (comContentET != null)
                    { 
                        Comment comment = publishComment();

                    // Ajout du commentaire dans l'événement

                    if (current_group != null)
                        commentList = current_group.AddComment(comment);

                    // Refresh the list
                    EventCommentAdapter newAdapter = new EventCommentAdapter(this, commentList);
                    listView.Adapter = newAdapter;
                    }
                };

            // ListView
            listView = FindViewById<ListView>(Resource.Id.group_comment_listView);

            // Notifications list : liste de commentaires des événements
            commentList = current_group.GetAllComments();

            // Create and set the adapter
            EventCommentAdapter adapter = new EventCommentAdapter(this, commentList);

            if (listView != null)
                listView.Adapter = adapter;


        }