Exemplo n.º 1
0
        private void SearchCategory(string query)
        {
            var result = objCategories.Where(o => o.Category.Contains(query)).ToList();

            Adapter = new Category_Adapter(this, result);
            recyclerView.SetAdapter(Adapter);
        }
Exemplo n.º 2
0
        private void GetCategories()
        {
            FirebaseDatabase database = FirebaseDatabase.Instance;
            FirebaseCallback p        = new FirebaseCallback();

            p.GetCategoriesAll(database);
            p.Categories += (sender, obj) =>
            {
                progressBar.Visibility = ViewStates.Invisible;

                objCategories = obj;
                Adapter       = new Category_Adapter(this, obj);
                recyclerView.SetAdapter(Adapter);
                Adapter.ItemClick += (s, o) =>
                {
                    p.Dispose();
                    database.Dispose();

                    Intent intent = new Intent(this, typeof(Activity_SubCategory));
                    ActivityOptionsCompat option = ActivityOptionsCompat.MakeSceneTransitionAnimation(this);
                    intent.PutExtra("CategoryID", Adapter.category[o].CategoryID);
                    intent.PutExtra("Category", Adapter.category[o].Category);
                    intent.PutExtra("Translation", Adapter.category[o].Translation);

                    StartActivity(intent, option.ToBundle());
                };
            };
        }