Esempio n. 1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.NewsItem);
            var toolbar = FindViewById<Toolbar> (Resource.Id.toolbar);
            //Toolbar will now take on default actionbar characteristics
            SetSupportActionBar (toolbar);
            SupportActionBar.Title = "Nachrichten";
            SupportActionBar.SetDisplayHomeAsUpEnabled (true);
            SupportActionBar.SetHomeButtonEnabled (true);
            _settings = new Settings (this);
            _thatThing = _settings.ReadNews ("lastClick");

            var type  = Typeface.CreateFromAsset (Assets, "SourceSansPro-Regular.ttf");
            var bold  = Typeface.CreateFromAsset (Assets, "SourceSansPro-Bold.ttf");

            Title = _thatThing.SourcePrint;

            _main = FindViewById<TextView> (Resource.Id.mainText);
            _title = FindViewById<TextView> (Resource.Id.title);
            _icon = FindViewById<ImageView> (Resource.Id.icon);
            _main.Text = _thatThing.Content;
            _main.Typeface = type;
            _title.Text = _thatThing.Title;
            _title.Typeface = bold;
            _icon.SetUrlDrawable (_thatThing.Image, Resource.Drawable.notifications);
        }
Esempio n. 2
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			_settings = new Settings (this);
			SetContentView (Resource.Layout.News);
			var toolbar = FindViewById<Toolbar> (Resource.Id.toolbar);
			//Toolbar will now take on default actionbar characteristics
			SetSupportActionBar (toolbar);
			SupportActionBar.Title = "Nachrichten";
			SupportActionBar.SetDisplayHomeAsUpEnabled (true);
			SupportActionBar.SetHomeButtonEnabled (true);
			_lv = FindViewById<ListView>(Resource.Id.lv);
			_lv.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs e) {
				var t = _globNews.ElementAt(e.Position);
				_settings.WriteNews ("lastClick", t);
				var set = new Intent(this, typeof(NewsItemActivity));
				StartActivity(set);
			};
		    try
		    {
		        _groupn = (int) _settings.Read("group");
		    }
		    catch (Exception e)
		    {
		        if (e is InvalidCastException || e is NullReferenceException)
		            _groupn = 7;
		        throw;
		    }
		    GetFreshNews ();

			// Create your application here
		}
Esempio n. 3
0
        public override void OnCreate()
        {
            base.OnCreate ();
            _settings = new Settings (this);
            _fetcher = new Fetcher (2);
            _fetcher.RaiseErrorMessage += (sender, args) =>
            {
                StopSelf();
            };

            _fetcher.RaiseRetreivedScheduleItems += (sender, args) =>
            {
                OnReceive(args.Schedule);
            };

            try
            {
                _group = (int)_settings.Read ("group");
            } catch {
                StopSelf ();
                return;
            }
            try {
                _firstStart = (int)_settings.Read("firstStart");
                _lastState = (int)_settings.Read("lastState");
            }
            catch
            {
                // ignored
            }
        }
Esempio n. 4
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            SetContentView (Resource.Layout.Settings);
            _setti = new Settings (this);
            var toolbar = FindViewById<Toolbar> (Resource.Id.toolbar);
            //Toolbar will now take on default actionbar characteristics
            SetSupportActionBar (toolbar);
            #if LEHRER
            SupportActionBar.Title = "Kürzel";
            #else
            SupportActionBar.Title = "Klasse / Kurs";
            #endif
            if (_setti.Read ("group") != null) {
                SupportActionBar.SetHomeButtonEnabled (true);
                SupportActionBar.SetDefaultDisplayHomeAsUpEnabled (true);
            }
            _lv = FindViewById<ListView>(Resource.Id.lv);

            _fetcher = new Fetcher ();
            _fetcher.RaiseErrorMessage += (sender, args) =>
            {
                Toast(args.MessageBody);
            };
            _fetcher.RaiseRetreivedGroupItems += (sender, args) =>
            {
                Refresh(args.Groups);
            };
            #if LEHRER
            try {
                if ((bool)_setti.Read("Teacher") == false)
                    throw new NullReferenceException();
                _pd = new ProgressDialog (this);
                _pd.SetMessage("Kürzel werden geladen");
                _pd.Show ();

                _fetcher.GetClasses();
            } catch (NullReferenceException) {
                ShowAuthDialogue();
            }
            #endif
            #if !LEHRER
            _pd = new ProgressDialog (this);
            _pd.SetMessage("Klassen werden geladen");
            _pd.Show ();

            _fetcher.GetClasses();
            #endif
        }