private void btnPost_Click(object sender, EventArgs e)
        {
            Android.App.AlertDialog.Builder dialog = new Android.App.AlertDialog.Builder(mainContext);
            Android.App.AlertDialog         alert  = dialog.Create();
            alert.SetTitle("Confirmation");
            alert.SetMessage("Are you sure you want to upload this recording?");
            alert.SetButton("OK", async(c, ev) =>
            {
                await videoRecord.UploadRecordedResponse(editDescription.Text);
                var tabbedActivity = TabbedMainActivity.GetInstance();
                if (tabbedActivity != null)
                {
                    int UnseenResponseCount = API.UserResponseAPI.GetUnseenResponseNotification();
                    if (UnseenResponseCount > 0)
                    {
                        tabbedActivity.MyChannelFragment.UnSeenReponse = UnseenResponseCount;
                        tabbedActivity.FragmentBottomNavigator.txtUnSeenCount.Visibility = ViewStates.Visible;
                        tabbedActivity.FragmentBottomNavigator.txtUnSeenCount.Text       = UnseenResponseCount.ToString();
                    }
                    else
                    {
                        tabbedActivity.FragmentBottomNavigator.txtUnSeenCount.Visibility = ViewStates.Gone;
                    }
                }

                alert.Hide();
                this.Dismiss();
            });
            alert.SetButton2("CANCEL", (c, ev) => { alert.Hide(); });
            alert.Show();
        }
Пример #2
0
        private void btnPost_Click(object sender, EventArgs e)
        {
            Android.App.AlertDialog.Builder dialog = new Android.App.AlertDialog.Builder(mainContext);
            Android.App.AlertDialog         alert  = dialog.Create();
            alert.SetTitle("Confirmation");
            alert.SetMessage("Are you sure you want to upload the selected file?");
            alert.SetButton("OK", async(c, ev) =>
            {
                var array = Helpers.VideoHelper.GetSelectedMediaData((Activity)mainContext, intentData.Data);

                if (tabbed != null)
                {
                    await tabbed.UploadSelectedResponse(array, editDescription.Text);
                }
                else if (global != null)
                {
                    await global.UploadSelectedResponse(array, editDescription.Text);
                }

                alert.Hide();
                this.Dismiss();
            });
            alert.SetButton2("CANCEL", (c, ev) => { alert.Hide(); });
            alert.Show();
        }
 public void CloseMenu()
 {
     try
     {
         dialog.Hide();
     }
     catch (Exception e)
     {
         Crashes.TrackError(e);
     }
 }
Пример #4
0
        public void PresentAlert(string content)
        {
            var         dialogVal = new AlertDialog.Builder(this, Resource.Style.AlertDialog);
            AlertDialog alertVal  = dialogVal.Create();

            alertVal.SetTitle("Información");
            alertVal.SetMessage(content);
            alertVal.SetButton("Aceptar", (c, ev) =>
            {
                alertVal.Hide();
            });
            alertVal.Show();
        }
Пример #5
0
        //private void txtHideComment_Click(object sender, EventArgs e)
        //{
        //    txtHideComment.Visibility = ViewStates.Gone;
        //    FragmentTransaction ftvideo = SupportFragmentManager.BeginTransaction();
        //    ftvideo.AddToBackStack(null);
        //    ftvideo.SetCustomAnimations(Resource.Animation.slide_up, Resource.Animation.slide_down);
        //    ftvideo.Hide(CommentsFragment).Commit();
        //}

        private void BtnDelete_Click(object sender, EventArgs e)
        {
            Android.App.AlertDialog.Builder dialog = new Android.App.AlertDialog.Builder(this);
            Android.App.AlertDialog         alert  = dialog.Create();
            alert.SetTitle("Confirmation");
            alert.SetMessage("Are you sure you want to delete the response?");
            alert.SetButton("OK", (c, ev) =>
            {
                DeleteLatestVideo().FireAndForgetSafeAsync();
            });
            alert.SetButton2("CANCEL", (c, ev) => { alert.Hide(); });
            alert.Show();
        }
Пример #6
0
        private void DisplayAlert(string title, string message, bool returnHome = false)
        {
            Android.App.AlertDialog.Builder dialog = new Android.App.AlertDialog.Builder(this);
            Android.App.AlertDialog         alert  = dialog.Create();
            alert.SetTitle(title);
            alert.SetMessage(message);
            alert.SetButton("OK", (c, ev) =>
            {
                alert.Hide();

                if (returnHome)
                {
                    Intent mainPage = new Intent(this, typeof(MainActivity));
                    StartActivity(mainPage);
                }
            });
            alert.Show();
        }
Пример #7
0
        public void PresentAlert(string content, bool backActivity)
        {
            var         dialogVal = new AlertDialog.Builder(this, Resource.Style.AlertDialog);
            AlertDialog alertVal  = dialogVal.Create();

            alertVal.SetCanceledOnTouchOutside(false);
            alertVal.SetTitle("Información");
            alertVal.SetMessage(content);
            alertVal.SetButton("Aceptar", (c, ev) =>
            {
                alertVal.Hide();
                if (backActivity)
                {
                    StartActivity(new Intent(Application.Context, typeof(HomeActivity)));
                    Finish();
                }
            });
            alertVal.Show();
        }
Пример #8
0
 private void UpdateAdapter()
 {
     try //loading works to adapter
     {
         MainListViewAdapter adapter = new MainListViewAdapter(this, worksList);
         mainListView.Adapter = adapter;
     }
     catch (Exception exception)
     {
         AlertDialog.Builder dialog = new AlertDialog.Builder(this);
         AlertDialog         alert  = dialog.Create();
         alert.SetTitle(exception.Source);
         alert.SetMessage(exception.Message);
         alert.SetButton("OK", (c, ev) =>
         {
             alert.Hide();
         });
         alert.Show();
     }
 }
Пример #9
0
 private void TurnOn()
 {
     user = SQLiteDb.GetUser();
     if (user.Email == "failed")
     {
         var intent = new Intent(this, typeof(SignInActivity));
         StartActivityForResult(intent, 1);
         Finish();
     }
     else if (CrossConnectivity.Current.IsConnected)
     {
         if (user.RememberMe && DateTime.Now.Subtract(user.AuthorizationTime).TotalSeconds >= 86399)
         {
             //Remember me, Authorization key not actve
             var logged = WebApiDataController.LogIn(user).Result;
             if (logged)
             {
                 //logged in
                 var intent = new Intent(this, typeof(LoadDataActivity));
                 StartActivity(intent);
                 Finish();
             }
             else
             {
                 //not logged in
                 AlertDialog.Builder dialog = new AlertDialog.Builder(this);
                 AlertDialog         alert  = dialog.Create();
                 alert.SetTitle("Błąd");
                 alert.SetMessage("Logowanie nie było możliwe. Wprowadź dane logowania.");
                 alert.SetButton("OK", (c, ev) =>
                 {
                     alert.Hide();
                     var intent = new Intent(this, typeof(SignInActivity));
                     StartActivity(intent);
                     Finish();
                 });
                 alert.Show();
             }
         }
         else if (!user.RememberMe && DateTime.Now.Subtract(user.AuthorizationTime).TotalSeconds >= 86399)
         {
             //Dont remember me
             var intent = new Intent(this, typeof(SignInActivity));
             StartActivityForResult(intent, 1);
             Finish();
         }
         else
         {   //Authorization key still active
             var intent = new Intent(this, typeof(LoadDataActivity));
             StartActivity(intent);
             Finish();
         }
     }
     else
     {
         AlertDialog.Builder dialog = new AlertDialog.Builder(this);
         AlertDialog         alert  = dialog.Create();
         alert.SetTitle("Błąd");
         alert.SetMessage("Brak połączenia z internetem");
         alert.SetButton("SPRÓBUJ PONOWNIE", (c, ev) =>
         {
             alert.Hide();
             TurnOn();
         });
         alert.SetButton2("OK", (c, ev) =>
         {
             alert.Hide();
             Finish();
         });
         alert.Show();
     }
 }