private async void SearchButton_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(searchText.Text))
            {
                progressBar.Visibility = ViewStates.Visible;
                movieModel             = await CoreService.GetMovieService(searchText.Text);

                if (movieModel != null)
                {
                    dataList.Clear();
                    dataList.Add(movieModel);

                    movieAdapter.NotifyDataSetChanged();
                }
                else
                {
                    dataList.Clear();
                    movieAdapter.NotifyDataSetChanged();
                    CustomAlertDialog.ShowAlertDialog(this.Context, "No movies found please try again !");
                }
                Activity.RunOnUiThread(() => {
                    progressBar.Visibility = ViewStates.Gone;
                });
            }
            else
            {
                searchText.SetError("Please enter searching title", null);
            }
        }
        public override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your fragment here
            dataList     = new List <MovieModel>();
            movieAdapter = new MovieRecyclerViewAdapter(this.Context, dataList);
            // inflate view
            rootView               = LayoutInflater.FromContext(this.Context).Inflate(Resource.Layout.fragment_movie_list, null);
            progressBar            = rootView.FindViewById <ProgressBar>(Resource.Id.progress_bar);
            progressBar.Visibility = ViewStates.Visible;
            var defaultTitle = "Russian";

            // check network
            wifiNetwork   = Reachability.IsConnectedWifi(this.Context);
            mobileNetwork = Reachability.IsConnectedMobile(this.Context);
            if (wifiNetwork || mobileNetwork)
            {
                LoadMovieData(defaultTitle);
            }
            else
            {
                CustomAlertDialog.ShowAlertDialog(this.Context, "Please check your network !");
            }
        }
Example #3
0
 public static void Show(Activity owner, string title, string message, string positiveButtonTitle,
                         Action positiveAction, string negativeButtonTitle,
                         Action negativeAction, string neutralButtonTitle,
                         Action neutralAction)
 {
     LatestAlert = new CustomAlertDialog(owner, title, message, positiveButtonTitle, positiveAction,
                                         negativeButtonTitle, negativeAction, neutralButtonTitle, neutralAction);
 }
Example #4
0
 public static Task <string> ShowPromptDialog(Activity owner, string title, string message, Action cancelAction, bool isNumericOnly = false, string inputText = "")
 {
     LatestAlert = new CustomAlertDialog();
     return(LatestAlert.ShowPrompt(owner, title, message, cancelAction, isNumericOnly, inputText));
 }
Example #5
0
 public static void Show(Activity owner, string title, string message, Action onClose = null)
 {
     LatestAlert = new CustomAlertDialog(owner, title, message, onClose);
 }