Example #1
0
        public override View OnCreateView(LayoutInflater inflater,
                                          ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);

            this.view = inflater.Inflate(
                Resource.Layout.Home, container, false);

            this.pictureView = view.FindViewById <ImageView> (Resource.Id.pictureView);
            this.spinner     = view.FindViewById(Resource.Id.spinner);

            // Get our button from the layout resource,
            // and attach an event to it
            View nextButton = view.FindViewById(Resource.Id.nextButton);
            View prevButton = view.FindViewById(Resource.Id.prevButton);

            this.favsButton = view.FindViewById <ImageView> (Resource.Id.favImageButton);

            TextView fullWordText = view.FindViewById <TextView> (Resource.Id.fullWordText);

            nextButton.Click += delegate {
                HandleClickResult(_sharedHomeGUIHandler.NextWord(handler, fullWordText, favsButton, favourites));
            };
            prevButton.Click += delegate {
                HandleClickResult(_sharedHomeGUIHandler.PreviousWord(handler, fullWordText, favsButton, favourites));
            };
            favsButton.Click += delegate {
                _sharedGUIHandler.HandleFavouriteButtonClick(favsButton, this.favourites, handler.CurrentAnimalAdjective);
            };

            nextButton.CallOnClick();

            return(this.view);
        }
Example #2
0
        public override View OnCreateView(LayoutInflater inflater,
                                          ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);

            this.view = inflater.Inflate(
                Resource.Layout.Favourites, container, false);

            this.pictureView = view.FindViewById <ImageView> (Resource.Id.pictureView);
            this.spinner     = view.FindViewById(Resource.Id.spinner);

            // Get our button from the layout resource,
            // and attach an event to it
            View nextButton = view.FindViewById(Resource.Id.nextButton);
            View prevButton = view.FindViewById(Resource.Id.prevButton);

            this.favsButton = view.FindViewById <ImageView> (Resource.Id.favViewFavButton);

            this.fullWordText = view.FindViewById <TextView> (Resource.Id.fullWordText);

            nextButton.Click += delegate {
                HandleShowingImageResult(this._favouritesGUIHandler.
                                         NextFavourite(favourites, fullWordText, this.favsButton));
            };
            prevButton.Click += delegate {
                HandleShowingImageResult(this._favouritesGUIHandler.PreviousFavourite
                                             (favourites, fullWordText, this.favsButton));
            };
            favsButton.Click += delegate {
                _sharedGUIHandler.HandleFavouriteButtonClick
                    (favsButton, this.favourites, this.favourites.GetCurrentFavourite());
            };

            HandleShowingImageResult(_favouritesGUIHandler.ShowCurrentFavourite
                                         (favourites, fullWordText, this.favsButton));
            return(view);
        }