Exemplo n.º 1
0
        private void AchievementList_LongClick(object sender, View.LongClickEventArgs e)
        {
            try
            {
                if (_selectedItemIndex == -1 && GlobalData.AchievementChartItems.Count > 0)
                {
                    Toast.MakeText(this, Resource.String.AchievementChartActivitySelectNoEdit, ToastLength.Short).Show();
                    return;
                }
                if (GlobalData.AchievementChartItems.Count == 0)
                {
                    Toast.MakeText(this, Resource.String.AchievementChartActivityEditNoItems, ToastLength.Short).Show();
                    return;
                }

                int achievementID = GlobalData.AchievementChartItems[_selectedItemIndex].AchievementId;
                AchievementChartDialogFragment chartFragment = new AchievementChartDialogFragment(this, "Enter an Achievement", achievementID);
                var transaction = FragmentManager.BeginTransaction();
                chartFragment.Show(transaction, chartFragment.Tag);
            }
            catch (Exception ex)
            {
                Log.Error(TAG, "AchievementList_LongClick: Exception - " + ex.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, ex, GetString(Resource.String.ErrorCreatingAchievementChartFragment), "AchievementChartActivity.AchievementList_LongClick");
                }
            }
        }
Exemplo n.º 2
0
        private void EnterAchievement()
        {
            try
            {
                _achievement = new AchievementChartDialogFragment(this, "Enter Achievement");

                var fragmentTransaction = FragmentManager.BeginTransaction();
                _achievement.Show(fragmentTransaction, _achievement.Tag);
            }
            catch (Exception ex)
            {
                Log.Error(TAG, "EnterAchievement_Click: Exception - " + ex.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, ex, GetString(Resource.String.ErrorEnterAchievement), "AchievementChartActivity.EnterAchievement_Click");
                }
            }
        }