Esempio n. 1
0
        private async void DownloadLecturersAsync()
        {
            ScheduleApplication application = ApplicationContext as ScheduleApplication;

            IEnumerable <String> lecturers = await application.Manager.DownloadLecturersAsync();

            if (lecturers == null)
            {
                application.SaveLog();

                TextView error = FindViewById <TextView>(Resource.Id.downloadLecturersErrorTextView);
                error.Visibility = ViewStates.Visible;
            }
            else
            {
                Int32 layoutId = Resource.Layout.support_simple_spinner_dropdown_item;
                _downloadRequest.Adapter = new ArrayAdapter <String>(this, layoutId, lecturers.ToArray());
            }
        }
Esempio n. 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            ScheduleApplication application = ApplicationContext as ScheduleApplication;

            application.Preferences.ThemeChanged += Recreate;

            SetTheme(application.Preferences.UseDarkTheme ? Resource.Style.Theme_SmtuSchedule_Dark
                : Resource.Style.Theme_SmtuSchedule_Light);

            SetContentView(Resource.Layout.preferencesActivity);

            Toolbar toolbar = FindViewById <Toolbar>(Resource.Id.preferencesActivityToolbar);

            toolbar.NavigationClick += (s, e) => OnBackPressed();

            SupportFragmentManager.BeginTransaction()
            .Replace(Resource.Id.preferencesContentFrameLayout, new PreferencesFragment())
            .Commit();
        }
        //static SchedulesPagerAdapter()
        //{
        //    _cachedFragments = new Dictionary<(DateTime, Int32), ScheduleFragment>();
        //}

        public SchedulesPagerAdapter(FragmentManager manager, ScheduleApplication application)
            : base(manager)
        {
            _application       = application;
            RenderingDateRange = new DateRange(application.Preferences.CurrentScheduleDate);
        }