Пример #1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            var rootView       = inflater.Inflate(Resource.Layout.TitleInput, container, false);
            var titleText      = rootView.FindViewById <EditText>(Resource.Id.searchMovieText);
            var nameListButton = rootView.FindViewById <Button>(Resource.Id.nameListButton);
            var progressBar    = rootView.FindViewById <ProgressBar>(Resource.Id.MovieProgress);

            progressBar.Visibility = ViewStates.Invisible;
            nameListButton.Click  += async(sender, args) =>
            {
                progressBar.Visibility = ViewStates.Visible;
                var manager = (InputMethodManager)this.Context.GetSystemService(Context.InputMethodService);
                manager.HideSoftInputFromWindow(titleText.WindowToken, 0);
                _movieList = await _movieService.GetMoviesByTitle(titleText.Text);

                progressBar.Visibility = ViewStates.Gone;
                var intent = new Intent(this.Context, typeof(MovieListActvity));
                intent.PutExtra("movieList", JsonConvert.SerializeObject(_movieList));
                this.StartActivity(intent);
            };

            return(rootView);
        }
Пример #2
0
        public async Task FetchMoviesByTitle(string title)
        {
            this.ActivityRunning = true;
            this.Movies          = await _service.GetMoviesByTitle(title);

            this.Movies = await LoadActors();

            this.ActivityRunning = false;
        }