Exemplo n.º 1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            RequestWindowFeature(WindowFeatures.CustomTitle);                              // BETTER: http://www.anddev.org/my_own_titlebar_backbutton_like_on_the_iphone-t4591.html
            SetContentView(Resource.Layout.Session);
            Window.SetFeatureInt(WindowFeatures.CustomTitle, Resource.Layout.WindowTitle); // http://www.londatiga.net/it/how-to-create-custom-window-title-in-android/

            _favouriteButton        = FindViewById <Button>(Resource.Id.FavouriteButton);
            _favouriteButton.Click += new EventHandler(_favouriteButton_Click);

            _code = Intent.GetStringExtra("Code");
            Console.WriteLine("[SessionActivity] " + _code);

            _session = (from s in Conf.Current.ConfItem.Sessions
                        where s.Code == _code
                        select s).FirstOrDefault();

            if (_session.Code != "")
            {
                FindViewById <TextView>(Resource.Id.Title).Text       = _session.Title;
                FindViewById <TextView>(Resource.Id.SpeakerList).Text = _session.SpeakerList;
                if (_session.Room != "")
                {
                    FindViewById <TextView>(Resource.Id.Room).Text = _session.Room + " room";
                }
                FindViewById <TextView>(Resource.Id.DateTimeDisplay).Text = _session.DateTimeDisplay;
                FindViewById <TextView>(Resource.Id.Brief).Text           = _session.Brief;
                FindViewById <TextView>(Resource.Id.TagList).Text         = _session.TagList;


                var sess = from s in Conf.Current.FavoriteSessions
                           where s.Code == _session.Code
                           select s;
                foreach (var s in sess)
                {
                    isFavourite = true;
                    break;
                }

                if (isFavourite)
                {
                    _favouriteButton.Text = "Un favorite";
                }
                else
                {
                    _favouriteButton.Text = "Add favorite";
                }
            }
        }
Exemplo n.º 2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            RequestWindowFeature(WindowFeatures.CustomTitle); // BETTER: http://www.anddev.org/my_own_titlebar_backbutton_like_on_the_iphone-t4591.html
            SetContentView(Resource.Layout.Session);
            Window.SetFeatureInt(WindowFeatures.CustomTitle, Resource.Layout.WindowTitle); // http://www.londatiga.net/it/how-to-create-custom-window-title-in-android/

            _favouriteButton = FindViewById<Button>(Resource.Id.FavouriteButton);
            _favouriteButton.Click += new EventHandler(_favouriteButton_Click);

            _code = Intent.GetStringExtra("Code");
            Console.WriteLine("[SessionActivity] " + _code);

            _session = (from s in Conf.Current.ConfItem.Sessions
                       where s.Code == _code
                       select s).FirstOrDefault();

            if (_session.Code != "")
            {
                FindViewById<TextView>(Resource.Id.Title).Text = _session.Title;
                FindViewById<TextView>(Resource.Id.SpeakerList).Text = _session.SpeakerList;
                if (_session.Room != "")
                    FindViewById<TextView>(Resource.Id.Room).Text = _session.Room + " room";
                FindViewById<TextView>(Resource.Id.DateTimeDisplay).Text = _session.DateTimeDisplay;
                FindViewById<TextView>(Resource.Id.Brief).Text = _session.Brief;
                FindViewById<TextView>(Resource.Id.TagList).Text = _session.TagList;

                var sess = from s in Conf.Current.FavoriteSessions
                           where s.Code == _session.Code
                           select s;
                foreach (var s in sess)
                {
                    isFavourite = true;
                    break;
                }

                if (isFavourite) _favouriteButton.Text = "Un favorite";
                else _favouriteButton.Text = "Add favorite";
            }
        }