private void TagPickerFacadeOnSourceChanged(Status obj)
        {
            if (!IsInitialized)
            {
                return;
            }

            Activity.RunOnUiThread(() =>
            {
                _tagsAdapter.NotifyDataSetChanged();
            });
        }
        private void PresenterSourceChanged(Status status)
        {
            if (!IsInitialized)
            {
                return;
            }

            Activity.RunOnUiThread(() =>
            {
                _tagsAdapter.NotifyDataSetChanged();
            });
        }
Exemple #3
0
        private void PresenterSourceChanged(Status status)
        {
            if (IsFinishing || IsDestroyed)
            {
                return;
            }

            RunOnUiThread(() =>
            {
                _tagsAdapter.NotifyDataSetChanged();
            });
        }
        private void TagsPresenterSourceChanged(Status status)
        {
            if (!IsInitialized)
            {
                return;
            }

            Activity.RunOnUiThread(() =>
            {
                _tagSpinner.Visibility = ViewStates.Gone;
                _categoriesAdapter.NotifyDataSetChanged();
            });
        }
        protected View OnCreateDialogView()
        {
            tags.Clear();
            foreach (var currentTag in currentTags)
            {
                tags.Add(currentTag);
            }

            View view = base.OnCreateDialogView();

            listView         = (ListView)view.FindViewById(Resource.Id.tags_list);
            adapter          = new TagsAdapter(this, Context, Resource.Layout.tag_preference_item);
            listView.Adapter = adapter;

            EditText editText = (EditText)view.FindViewById(Resource.Id.new_tag_text);

            ImageButton button = (ImageButton)view.FindViewById(Resource.Id.new_tag_button);

            button.Click += delegate {
                String newTag = editText.Text.ToString();
                editText.Text = null;
                InputMethodManager imm = (InputMethodManager)Context.GetSystemService(
                    Context.InputMethodService);
                imm.HideSoftInputFromWindow(editText.WindowToken, 0);

                if (!UAStringUtil.IsEmpty(newTag))
                {
                    if (tags.Contains(newTag))
                    {
                        ShowDuplicateItemToast();
                    }
                    else
                    {
                        tags.Insert(0, newTag);
                        adapter.NotifyDataSetChanged();
                    }
                }
            };

            return(view);
        }
Exemple #6
0
        protected override View OnCreateDialogView()
        {
            tags.Clear();
            tags.AddRange(currentTags);

            View     view     = base.OnCreateDialogView();
            ListView listView = (ListView)view.FindViewById(Resource.Id.tags_list);

            tagsAdapter      = new TagsAdapter(Context, Resource.Layout.tag_preference_item, this);
            listView.Adapter = tagsAdapter;

            EditText editText = (EditText)view.FindViewById(Resource.Id.new_tag_text);

            ImageButton button = (ImageButton)view.FindViewById(Resource.Id.new_tag_button);

            button.Click += (sender, e) =>
            {
                String newTag = editText.Text;
                editText.Text = null;
                InputMethodManager imm = (InputMethodManager)Context.GetSystemService(Context.InputMethodService);
                imm.HideSoftInputFromWindow(editText.WindowToken, 0);

                if (!String.IsNullOrEmpty(newTag))
                {
                    if (tags.Contains(newTag))
                    {
                        Toast.MakeText(Context, Resource.String.duplicate_tag_warning, ToastLength.Short).Show();
                    }
                    else
                    {
                        tags.Add(newTag);
                        tagsAdapter.NotifyDataSetChanged();
                    }
                }
            };

            return(view);
        }