Example #1
0
        private async Task updateCategoryLetterAsync(IMenu menu)
        {
            IMenuItem item      = menu.FindItem(Resource.Id.category);
            string    catString = await FSNotesHandler.getCategoryName();

            item.SetTitle(catString);
        }
Example #2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.NewCommentLayout, container, false);

            Spinner spinner = view.FindViewById <Spinner>(Resource.Id.formationSelectSpinner);
            var     adapter = new ArrayAdapter <string>(this.Activity, Android.Resource.Layout.SimpleSpinnerItem, formations);

            spinner.Adapter = adapter;

            EditText edittext     = view.FindViewById <EditText>(Resource.Id.newCommentText);
            Button   saveButton   = view.FindViewById <Button>(Resource.Id.SaveButton);
            Button   cancelButton = view.FindViewById <Button>(Resource.Id.CancelButton);

            saveButton.Click += async delegate
            {
                string formation = spinner.SelectedItem.ToString();
                await FSNotesHandler.addComment(formation, edittext.Text);

                Dismiss();
            };
            cancelButton.Click += delegate {
                Dismiss();
            };
            return(view);
        }
Example #3
0
        private void updateCategoryPopup()
        {
            PopupMenu catChangePopup = new PopupMenu(this, FindViewById(Resource.Id.category));

            catChangePopup.Inflate(Resource.Menu.category_change_popup);
            catChangePopup.Show();
            catChangePopup.MenuItemClick += (s1, arg1) =>
            {
                string categoryString;
                switch (arg1.Item.ItemId)
                {
                case Resource.Id.rookie:
                    categoryString = FSNotesHandler.ROOKIE_ID;
                    break;

                case Resource.Id.intermediate:
                    categoryString = FSNotesHandler.INTERMEDIATE_ID;
                    break;

                case Resource.Id.advanced:
                    categoryString = FSNotesHandler.ADVANCED_ID;
                    break;

                case Resource.Id.open:
                    categoryString = FSNotesHandler.OPEN_ID;
                    break;

                default:
                    return;
                }
                FSNotesHandler.updateCategory(categoryString);
            };
        }
Example #4
0
        private async Task updateFilterList()
        {
            List <string> filteredList = await FSNotesHandler.getFormationFilterListAsync();

            //filteredList.Add("Skills");
            this.filterList.Clear();
            this.filterList.AddRange(filteredList);
        }
Example #5
0
        private async void requestNewComment()
        {
            List <string> formations = await FSNotesHandler.getFormationFilterListAsync();

            formations.Sort(new FormationSorter());
            AddCommentDialogFragment commentDialog = AddCommentDialogFragment.NewInstance(formations);

            startDialogFragment(commentDialog);
        }
Example #6
0
        private async void openNewJumpDialog()
        {
            List <string> formations = await FSNotesHandler.getFormationFilterListAsync();

            formations.Remove("Skills");
            formations.Sort(new FormationSorter());
            NewJumpDialogFragment newJumpDialog = NewJumpDialogFragment.NewInstance(formations);

            startDialogFragment(newJumpDialog);
        }
Example #7
0
 public override bool OnCreateOptionsMenu(IMenu menu)
 {
     MenuInflater.Inflate(Resource.Menu.top_toolbar, menu);
     //Reload category as
     if (FSNotesHandler.isCategorySet())
     {
         IMenuItem item      = menu.FindItem(Resource.Id.category);
         string    catString = FSNotesHandler.CategoryName;
         item.SetTitle(catString);
     }
     AppEventHandler.CategoryUpdated += this.onCategoryUpdate;
     return(base.OnCreateOptionsMenu(menu));
 }
Example #8
0
        private void initializeMakeJump(View view)
        {
            Button     makeJumpBtn = view.FindViewById <Button>(Resource.Id.makeJumpsBtn);
            RadioGroup radioGroup  = view.FindViewById <RadioGroup>(Resource.Id.categories);
            ListView   listOutput  = view.FindViewById <ListView>(Resource.Id.jumpList);

            makeJumpBtn.Click += async(object sender, EventArgs e) =>
            {
                List <List <string> > jumps = await FSNotesHandler.getRandomizedJumps();

                string[] jumpArray = await convertJumpsToArrayAsync(jumps);

                var adapter = new JumpListViewAdapter(this.Activity, jumps);
                listOutput.Adapter = adapter;
            };
        }
        public override mainApp.Dialog OnCreateDialog(Bundle savedInstanceState)
        {
            mainApp.AlertDialog.Builder builder = new mainApp.AlertDialog.Builder(Activity);
            string formation = Arguments.GetString(FORMATION);
            string comment   = Arguments.GetString(COMMENT);

            builder
            .SetTitle("Confirm delete")
            .SetMessage("Are you sure you want to remove a comment \"" + comment + "\" for formation " + formation)
            .SetPositiveButton("Delete", async(senderAlert, args) =>
            {
                Dismiss();
                await FSNotesHandler.removeComment(formation, comment);
            })
            .SetNegativeButton("Cancel", (senderAlert, args) =>
            {
                AppEventHandler.emitInfoTextUpdate("Delete cancelled");
            });

            return(builder.Create());
        }
Example #10
0
        private bool hasComments(List <string> jump)
        {
            Dictionary <string, List <string> > filteredNotes = FSNotesHandler.getNotesWithFilterList(jump);

            return(filteredNotes.Any(kvp => kvp.Value.Count > 0));
        }
Example #11
0
 private async Task initializeData()
 {
     FileHandler.initialize(this.FilesDir.AbsolutePath);
     await FSNotesHandler.initialize();
 }