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

            SetContentView(Resource.Layout.Main);

            // TODO Add user facebook id and token
            User user = new User("", "");

            _behavior = new UserBehavior(user, this);

            _isLiking = false;

            _likeCount       = FindViewById <TextView>(Resource.Id.like_count);
            _profileName     = FindViewById <TextView>(Resource.Id.contact_name);
            _profileImage    = FindViewById <ImageView>(Resource.Id.contact_image);
            _startStopButton = FindViewById <Button>(Resource.Id.start_stop_button);

            _startStopButton.Click += delegate
            {
                if (_isLiking)
                {
                    _startStopButton.Text = GetString(Resource.String.StartLikingButton);
                    _behavior.StopAutoLiking();
                }
                else
                {
                    _startStopButton.Text = GetString(Resource.String.StopLikingButton);
                    _behavior.StartAutoLiking();
                }
                _isLiking = !_isLiking;
            };
        }
Beispiel #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            // TODO Add user facebook id and token
            User user = new User("", "");

            _behavior = new UserBehavior(user, this);

            _isLiking = false;

            var v = FindViewById <WatchViewStub>(Resource.Id.watch_view_stub);

            v.LayoutInflated += delegate
            {
                _likeCount       = FindViewById <TextView>(Resource.Id.like_count);
                _profileName     = FindViewById <TextView>(Resource.Id.profile_name);
                _startStopButton = FindViewById <Button>(Resource.Id.myButton);

                _startStopButton.Click += delegate
                {
                    if (_isLiking)
                    {
                        _behavior.StopAutoLiking();
                        _startStopButton.Text = GetString(Resource.String.StartLikingButton);
                    }
                    else
                    {
                        _behavior.StartAutoLiking();
                        _startStopButton.Text = GetString(Resource.String.StopLikingButton);
                    }
                    _isLiking = !_isLiking;
                };
            };
        }