Beispiel #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.ActivityMyTaskTodo);

            userid = Intent.Extras.GetString("UserID");

            var lv_tasks = FindViewById <ListView>(Resource.Id.listViewMyTaskTodo);

            var btn_menu = FindViewById <Button>(Resource.Id.buttonBackToMenuMyTaskToDo);

            var btn_add = FindViewById <Button>(Resource.Id.buttonMyTaskToDoToAdd);

            btn_menu.Click += Btn_menu_Click;

            btn_add.Click += Btn_add_Click;

            TaskDownloader TaskDownloader = new TaskDownloader();


            tasksList = TaskDownloader.GetAllMyTasks(Intent.Extras.GetString("UserID")).ToList();

            var taskAdapter = new TaskAdapter(tasksList, this);

            lv_tasks.Adapter = taskAdapter;


            lv_tasks.ItemClick += (sender, e) =>
            {
                Tasks TasksSelectionned = tasksList[e.Position];



                var intent = new Intent(this, typeof(DetailTaskActivity));


                intent.PutExtra("TaskContent", TasksSelectionned.Note);
                intent.PutExtra("TaskDeadline", TasksSelectionned.DeadLine.ToString());
                intent.PutExtra("TaskID", TasksSelectionned.ID.ToString());
                intent.PutExtra("Task", TasksSelectionned.ID.ToString());
                intent.PutExtra("UserID", userid);
                intent.PutExtra("TaskState", taskstate);

                StartActivity(intent);
            };

            // Create your application here
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.ActivityTaskTodo);
            userid = Intent.Extras.GetString("UserID");

            var lv_tasks = FindViewById <ListView>(Resource.Id.listViewTaskTodo);

            var btn_menu = FindViewById <Button>(Resource.Id.buttonBackToMenuToDo);

            var btn_add = FindViewById <Button>(Resource.Id.buttonToDoToAdd);

            btn_menu.Click += Btn_menu_Click;

            btn_add.Click += Btn_add_Click;

            //    var swipeRefresh = FindViewById<SwipeRefreshLayout>(Resource.Id.swipeRefreshLayoutTasks);


            // swipeRefresh.Refresh += async (sender, e) =>
            // {
            //    swipeRefresh.Refreshing = true;

            //var newArticles = await rssDownloader.Get(url);
            // lv_tasks.Adapter = new TaskAdapter( newArticles,this);

            //    swipeRefresh.Refreshing = false;
            //   };

            TaskDownloader TaskDownloader = new TaskDownloader();


            tasksList = TaskDownloader.GetTodoAllTasks().ToList();



            //foreach(Tasks s in tall)
            //{
            //    tasksList.Add(s);
            //}

            // progressbar.Visibility = ViewStates.Gone;

            var taskAdapter = new TaskAdapter(tasksList, this);

            lv_tasks.Adapter = taskAdapter;
            // tasksList.Add(new Tasks(Intent.Extras.GetString("addedtaskscontent")));



            //tasksList.Add(new Tasks("hsdlhfklsdhkf"));
            //tasksList.Add(new Tasks("hsdlhfklsdhkf"));
            //tasksList.Add(new Tasks("hsdlhfklsdhkf"));
            //tasksList.Add(new Tasks("hsdlhfklsdhkf"));
            //tasksList.Add(new Tasks("hsdlhfklsdhkf"));
            //tasksList.Add(new Tasks("hsdlhfklsdhkf"));
            //tasksList.Add(new Tasks("hsdlhfklsdhkf"));
            //tasksList.Add(new Tasks("hsdlhfklsdhkf"));
            //tasksList.Add(new Tasks("hsdlhfklsdhkf"));
            //tasksList.Add(new Tasks("hsdlhfklsdhkf"));

            // var taskAdapter = new TaskAdapter( tasksList, this);
            //lv_tasks.Adapter = taskAdapter;


            lv_tasks.ItemClick += (sender, e) =>
            {
                Tasks TasksSelectionned = tasksList[e.Position];



                var intent = new Intent(this, typeof(DetailTaskActivity));


                intent.PutExtra("TaskContent", TasksSelectionned.Note);
                intent.PutExtra("TaskDeadline", TasksSelectionned.DeadLine.ToString());
                intent.PutExtra("TaskID", TasksSelectionned.ID.ToString());
                intent.PutExtra("Task", TasksSelectionned.ID.ToString());
                intent.PutExtra("UserID", userid);
                intent.PutExtra("TaskState", taskstate);

                StartActivity(intent);
            };


            // Create your application here
        }