public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { base.OnCreateView(inflater, container, savedInstanceState); var view = inflater.Inflate(Resource.Layout.EventNotifList, container, false); // Service uService = new UserService(DataBase.current_user); // ListView listView = view.FindViewById <ListView>(Resource.Id.event_notif_listView); // Masquer l'éditeur de texte if (DataBase.currentEvent.userAdmin != DataBase.current_user) { LinearLayout linearLayout = view.FindViewById <LinearLayout>(Resource.Id.evm_writeNotif_layout); if (linearLayout != null) { linearLayout.Visibility = ViewStates.Gone; } } // views // Comment content notifContentET = view.FindViewById <EditText>(Resource.Id.event_notifWrite_text); // valid button notifValidButton = view.FindViewById <ImageButton>(Resource.Id.event_notifSend_btn); if (notifValidButton != null) { notifValidButton.Click += delegate { Notification notif = publishNotification(); // Ajout du commentaire dans l'événement notifList = DataBase.currentEvent.addNotification(notif); // Refresh the list EventNotifAdapter newAdapter = new EventNotifAdapter(Activity, notifList); listView.Adapter = newAdapter; } } ; // Notifications list : liste des notifications de l'événement courant notifList = DataBase.currentEvent.notifications; // Create and set the adapter EventNotifAdapter adapter = new EventNotifAdapter(Activity, notifList); 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.EventNotifList, container, false); // Service uService = new UserService(DataBase.current_user); // ListView listView = view.FindViewById<ListView>(Resource.Id.event_notif_listView); // Masquer l'éditeur de texte if (DataBase.currentEvent.userAdmin != DataBase.current_user) { LinearLayout linearLayout = view.FindViewById<LinearLayout>(Resource.Id.evm_writeNotif_layout); if (linearLayout != null) linearLayout.Visibility = ViewStates.Gone; } // views // Comment content notifContentET = view.FindViewById<EditText>(Resource.Id.event_notifWrite_text); // valid button notifValidButton = view.FindViewById<ImageButton>(Resource.Id.event_notifSend_btn); if (notifValidButton != null) notifValidButton.Click += delegate { Notification notif = publishNotification(); // Ajout du commentaire dans l'événement notifList = DataBase.currentEvent.addNotification(notif); // Refresh the list EventNotifAdapter newAdapter = new EventNotifAdapter(Activity, notifList); listView.Adapter = newAdapter; }; // Notifications list : liste des notifications de l'événement courant notifList = DataBase.currentEvent.notifications; // Create and set the adapter EventNotifAdapter adapter = new EventNotifAdapter(Activity, notifList); if (listView != null) listView.Adapter = adapter; // Return return view; }