public void InitiateQuestionAnswer(int position)
        {
            if (_answeringQuestion)
            {
                Log.Info(TAG, "InitiateQuestionAnswer: Returning because already answering question");
                return;
            }

            try
            {
                Log.Info(TAG, "InitiateQuestionAnswer: _answeringQuestion - TRUE");
                _answeringQuestion = true;
                Log.Info(TAG, "InitiateQuestionAnswer: Creating GenericTextDialogFragment for answering question");
                var textDialog = new GenericTextDialogFragment(this, "Answer", "Please enter an answer to the question", _questionAnswer.Text.Trim(), position);
                FragmentTransaction transaction = FragmentManager.BeginTransaction();
                textDialog.Show(transaction, textDialog.Tag);
            }
            catch (Exception e)
            {
                Log.Error(TAG, "InitiateQuestionAnswer: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, "Answering Question", "ResourcesAppointmentItemActivity.InitiateQuestionAnswer");
                }
            }
        }
Ejemplo n.º 2
0
        private void ListTellMyself_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e)
        {
            try
            {
                var adapter         = _listTellMyself.Adapter;
                var selectedIndexID = (int)adapter.GetItemId(e.Position);
                var genericTextItem = GlobalData.TellMyselfItemsList.Find(gen => gen.ID == selectedIndexID);

                //we don't want to edit a recording really
                if (genericTextItem.TellType == ConstantsAndTypes.TELL_TYPE.Audio)
                {
                    Toast.MakeText(this, Resource.String.TellMyselfAudioNoEditText, ToastLength.Short).Show();
                    return;
                }

                GenericTextDialogFragment genFragment = new GenericTextDialogFragment(this, "Tell Yourself...", GetString(Resource.String.TellMyselfGenericTextTitle), genericTextItem.TellText, selectedIndexID);

                FragmentTransaction transaction = FragmentManager.BeginTransaction();

                genFragment.Show(transaction, genFragment.Tag);
            }
            catch (Exception ex)
            {
                Log.Error(TAG, "ListTellMyself_ItemLongClick: Exception - " + ex.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, ex, GetString(Resource.String.ErrorTellMyselfEditEntry), "TellMyselfActivity.ListTellMyself_ItemLongClick");
                }
            }
        }
Ejemplo n.º 3
0
        private void AddText()
        {
            try
            {
                _genericTextFragment = new GenericTextDialogFragment(this, "Tell Yourself...", GetString(Resource.String.TellMyselfGenericTextTitle));

                var fragmentTransaction = FragmentManager.BeginTransaction();
                _genericTextFragment.Show(fragmentTransaction, _genericTextFragment.Tag);
            }
            catch (Exception ex)
            {
                Log.Error(TAG, "Add_Click: Exception - " + ex.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, ex, GetString(Resource.String.ErrorTellMyselfAddText), "TellMyselfActivity.AddText_Click");
                }
            }
        }
Ejemplo n.º 4
0
        private void Add()
        {
            try
            {
                _genericText = new GenericTextDialogFragment(this, "What worked", GetString(Resource.String.workedPastGenericTextDialogTitle));

                var fragmentTransaction = FragmentManager.BeginTransaction();
                _genericText.Show(fragmentTransaction, _genericText.Tag);
            }
            catch (Exception ex)
            {
                Log.Error(TAG, "Add_Click: Exception - " + ex.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, ex, GetString(Resource.String.ErrorAddingWorkedPastItem), "WorkedPastActivity.Add_Click");
                }
            }
        }
        private void Add()
        {
            try
            {
                GenericTextDialogFragment genericText = new GenericTextDialogFragment(this, "Add Playlist", GetString(Resource.String.MusicTherapyActivityPlayListAddText));

                var transaction = FragmentManager.BeginTransaction();
                genericText.Show(transaction, genericText.Tag);
            }
            catch (Exception ex)
            {
                Log.Error(TAG, "Add_Click: Exception - " + ex.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, ex, GetString(Resource.String.ErrorMusicTherapyActivityAdd), "MusicTherapyActivity.Add_Click");
                }
            }
        }
Ejemplo n.º 6
0
        private void Add()
        {
            try
            {
                _genericText = new GenericTextDialogFragment(this, "Calm Yourself", GetString(Resource.String.howToCalmGenericTextDialogTitle));

                var fragmentTransaction = FragmentManager.BeginTransaction();
                _genericText.Show(fragmentTransaction, _genericText.Tag);
            }
            catch (Exception ex)
            {
                Log.Error(TAG, "Add_Click: Exception - " + ex.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, ex, GetString(Resource.String.ErrorAddingHowToCalmEntry), "HowToCalmActivity.Add_Click");
                }
            }
        }
Ejemplo n.º 7
0
        public void AlertPositiveButtonSelect(object sender, DialogClickEventArgs e, string instanceId)
        {
            if (instanceId == "remove")
            {
                try
                {
                    Imagery image = GlobalData.ImageListItems[_selectedItemIndex];
                    image.Remove();

                    GlobalData.ImageListItems.Remove(image);
                    UpdateGridAdapter();
                    _selectedItemIndex = -1;
                }
                catch (Exception er)
                {
                    Log.Error(TAG, "AlertPositiveButtonSelect (Remove instance): Exception - " + er.Message);
                    if (GlobalData.ShowErrorDialog)
                    {
                        ErrorDisplay.ShowErrorAlert(this, er, "Removing image", "ImageryActivity.AlertPositiveButtonSelect(Remove instance)");
                    }
                }
            }
            if (instanceId == "comment")
            {
                try
                {
                    GenericTextDialogFragment textFragment = new GenericTextDialogFragment(this, "Image Comment", GetString(Resource.String.ImageryActivityCommentGenericTitle));
                    FragmentTransaction       transaction  = FragmentManager.BeginTransaction();
                    textFragment.Show(transaction, textFragment.Tag);
                }
                catch (Exception ex)
                {
                    Log.Error(TAG, "AlertPositiveButtonSelect (Comment instance): Exception - " + ex.Message);
                    if (GlobalData.ShowErrorDialog)
                    {
                        ErrorDisplay.ShowErrorAlert(this, ex, "Adding comment to image selection", "ImageryActivity.AlertPositiveButtonSelect(Comment instance)");
                    }
                }
            }
            if (instanceId == "useMic")
            {
                PermissionsHelper.RequestApplicationPermission(this, ConstantsAndTypes.AppPermission.UseMicrophone);
            }
        }
Ejemplo n.º 8
0
        private void GenericList_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e)
        {
            try
            {
                var adapter         = _genericList.Adapter;
                var selectedIndexID = (int)adapter.GetItemId(e.Position);
                var genericTextItem = GlobalData.GenericTextItemsList.Find(gen => gen.ID == selectedIndexID);

                GenericTextDialogFragment genFragment = new GenericTextDialogFragment(this, "Edit item", GetString(Resource.String.workedPastGenericTextDialogTitle), genericTextItem.TextValue, selectedIndexID);

                FragmentTransaction transaction = FragmentManager.BeginTransaction();

                genFragment.Show(transaction, genFragment.Tag);
            }
            catch (Exception ex)
            {
                Log.Error(TAG, "GenericList_ItemLongClick: Exception - " + ex.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, ex, GetString(Resource.String.ErrorWorkedPastEditEntry), "WorkedPastActivity.GenericList_ItemLongClick");
                }
            }
        }