protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            ViewModel.Title = "Расписание";
            Title           = ViewModel.Title;
            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);
            var tabFree = FindViewById <RadioButton>(Resource.Id.schedule_view_segment_free);

            tabSelect = FindViewById <SegmentedGroup>(Resource.Id.schedule_view_segmentedControl);
            var tabBusy = FindViewById <RadioButton>(Resource.Id.schedule_view_segment_busy);

            tabSelect.Check(Resource.Id.schedule_view_segment_free);
            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            _calendarDate         = DateTime.Now;
            _calendar             = FindViewById <CalendarView>(Resource.Id.schedule_view_calendar);
            _calendar.DateChange += CalendarOnDateChange;

            _segmentedControl = FindViewById <SegmentedGroup>(Resource.Id.schedule_view_segmentedControl);
            _segmentedControl.CheckedChange += SegmentedControlOnCheckedChange;

            //_eventsList= FindViewById<MvxListView>(Resource.Id.schedule_view_eventsList);

            //ViewModel.ReloadRecord(DateTime.Today);
        }
Esempio n. 2
0
        private void CalendarOnDateChange(object sender, CalendarView.DateChangeEventArgs e)
        {
            _progressLoaderService.ShowProgressBar();
            tabSelect.Check(Resource.Id.schedule_view_segment_free);
            _calendarDate = new DateTime(e.Year, e.Month + 1, e.DayOfMonth);
            ViewModel.ReloadRecord(_calendarDate);

            _progressLoaderService.HideProgressBar();
        }
Esempio n. 3
0
        protected override async void OnCreate(Bundle bundle)
        {
            try
            {
                base.OnCreate(bundle);

                _progressLoaderService = Mvx.Resolve <IProgressLoaderService>();
                ViewModel.Title        = "Мои записи";
                Title         = ViewModel.Title;
                _drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);

                SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu);
                var tabFree = FindViewById <RadioButton>(Resource.Id.schedule_view_segment_free);
                tabSelect = FindViewById <SegmentedGroup>(Resource.Id.schedule_view_segmentedControl);
                var tabBusy = FindViewById <RadioButton>(Resource.Id.schedule_view_segment_busy);
                tabSelect.Check(Resource.Id.schedule_view_segment_free);

                _calendarDate         = DateTime.Now;
                _calendar             = FindViewById <CalendarView>(Resource.Id.schedule_view_calendar);
                _calendar.DateChange += CalendarOnDateChange;

                _segmentedControl = FindViewById <SegmentedGroup>(Resource.Id.schedule_view_segmentedControl);
                _segmentedControl.CheckedChange += SegmentedControlOnCheckedChange;


                var config = ImageLoaderConfiguration.CreateDefault(ApplicationContext);
                if (!ImageLoader.Instance.IsInited)
                {
                    ImageLoader.Instance.Init(config);
                }
            }
            catch (Exception ex)
            {
                var m = ex.Message;
            }

            //// Initialize ImageLoader with configuration.
            var imageLoader = ImageLoader.Instance;
            var headerMenu  = FindViewById <NavigationView>(Resource.Id.nav_view).GetHeaderView(0);

            var photoUser = headerMenu.FindViewById <ImageView>(Resource.Id.user_image);
            var nameUser  = headerMenu.FindViewById <TextView>(Resource.Id.user_name);
            await ViewModel.Initialize()
            .ContinueWith(
                task =>
            {
                RunOnUiThread(
                    () => { imageLoader.DisplayImage(ViewModel?.CurrentUser?.photo_100, photoUser); });
            });

            IProfileService profileService;

            Mvx.TryResolve(out profileService);

            var user = await profileService.GetUser();

            nameUser.Text = user.first_name + " " + user.last_name;
            imageLoader.DisplayImage(user.photo_100, photoUser);

            _navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);
            _navigationView.NavigationItemSelected += NavigationViewOnNavigationItemSelected;
        }