示例#1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.LifeNoteCardEdit);

            input_Title      = FindViewById <EditText>(Resource.Id.titleEditText);
            input_Title.Text = LifeNoteActivity.selectedLifeNoteItem.title;

            input_Description      = FindViewById <EditText>(Resource.Id.desciptionEditText);
            input_Description.Text = LifeNoteActivity.selectedLifeNoteItem.description;

            time      = FindViewById <TextView>(Resource.Id.Time);
            time.Text = LifeNoteActivity.selectedLifeNoteItem.time;

            date      = FindViewById <TextView>(Resource.Id.Date);
            date.Text = LifeNoteActivity.selectedLifeNoteItem.date;

            datePicker_btn = FindViewById <Button>(Resource.Id.btnDatePicker);
            timePicker_btn = FindViewById <Button>(Resource.Id.btnTimePicker);

            datePicker_btn.Click += delegate
            {
                Calendar now = Calendar.Instance;
                Com.Wdullaer.Materialdatetimepicker.Date.DatePickerDialog datePicker = Com.Wdullaer.Materialdatetimepicker.Date.DatePickerDialog.NewInstance(
                    this,
                    now.Get(CalendarField.Year),
                    now.Get(CalendarField.Month),
                    now.Get(CalendarField.DayOfMonth));
                datePicker.SetTitle("Date Time");
                datePicker.Show(FragmentManager, "DatePicker");
            };
            timePicker_btn.Click += delegate
            {
                Calendar now = Calendar.Instance;
                Com.Wdullaer.Materialdatetimepicker.Time.TimePickerDialog timePicker = Com.Wdullaer.Materialdatetimepicker.Time.TimePickerDialog.NewInstance(
                    this,
                    now.Get(CalendarField.HourOfDay),
                    now.Get(CalendarField.Minute), true);


                timePicker.Title = "Time";
                timePicker.Show(FragmentManager, "timePicker");
            };

            Button saveButton = FindViewById <Button>(Resource.Id.SaveChangesbtn);

            saveButton.Click += SaveChangesbtn_Click;

            Button cancelbtn = FindViewById <Button>(Resource.Id.CancelEventbtn);

            cancelbtn.Click += CancelEventbtn_Click;

            Button deleteBtn = FindViewById <Button>(Resource.Id.DeleteEventbtn);

            deleteBtn.Click += Deletebtn_Click;

            CheckBox shareBtn = FindViewById <CheckBox>(Resource.Id.shareCheckBox);
        }
示例#2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.LifeNoteCard);

            FirebaseApp.InitializeApp(this);
            storage    = FirebaseStorage.Instance;
            storageRef = storage.GetReferenceFromUrl("gs://lifenote-32743.appspot.com/");


            input_Title       = FindViewById <EditText>(Resource.Id.titleEditText);
            input_Description = FindViewById <EditText>(Resource.Id.desciptionEditText);
            time            = FindViewById <TextView>(Resource.Id.Time);
            date            = FindViewById <TextView>(Resource.Id.Date);
            datePicker_btn  = FindViewById <Button>(Resource.Id.btnDatePicker);
            timePicker_btn  = FindViewById <Button>(Resource.Id.btnTimePicker);
            imagePicker_btn = FindViewById <Button>(Resource.Id.pickImageBtn);
            image           = FindViewById <ImageView>(Resource.Id.pickedImage);

            imagePicker_btn.Click += delegate {
                ChooseImage();
            };

            datePicker_btn.Click += delegate
            {
                Calendar now = Calendar.Instance;
                Com.Wdullaer.Materialdatetimepicker.Date.DatePickerDialog datePicker = Com.Wdullaer.Materialdatetimepicker.Date.DatePickerDialog.NewInstance(
                    this,
                    now.Get(CalendarField.Year),
                    now.Get(CalendarField.Month),
                    now.Get(CalendarField.DayOfMonth));
                datePicker.SetTitle("Date Time");
                datePicker.Show(FragmentManager, "DatePicker");
            };
            timePicker_btn.Click += delegate
            {
                Calendar now = Calendar.Instance;
                Com.Wdullaer.Materialdatetimepicker.Time.TimePickerDialog timePicker = Com.Wdullaer.Materialdatetimepicker.Time.TimePickerDialog.NewInstance(
                    this,
                    now.Get(CalendarField.HourOfDay),
                    now.Get(CalendarField.Minute), true);


                timePicker.Title = "Time";
                timePicker.Show(FragmentManager, "timePicker");
            };

            Button button = FindViewById <Button>(Resource.Id.AddEventbtn);

            button.Click += AddEventbtn_Click;

            Button cancelbtn = FindViewById <Button>(Resource.Id.CancelEventbtn);

            cancelbtn.Click += CancelEventbtn_Click;

            CheckBox shareBtn = FindViewById <CheckBox>(Resource.Id.shareCheckBox);
        }