public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { base.OnCreateView(inflater, container, savedInstanceState); var view = inflater.Inflate(Resource.Layout.CustomView, container, false); searchView = view.FindViewById <SearchView>(Resource.Id.searchView1); db = new ProductDBHelper(context); db.Open(); db1 = new DBHelper(context); db1.Open(); //db.InsertMovieInfo("Alladin", "Disney", "PG", Resource.Drawable.Alladin); // db.InsertMovieInfo("Boxtroll", "Disney", "PG", Resource.Drawable.Boxtroll); // db.InsertMovieInfo("goodDianosour", "Disney", "PG", Resource.Drawable.gooddianosour); // db.InsertMovieInfo("Zutopia", "Disney", "PG", Resource.Drawable.zutopia); listView = view.FindViewById <ListView>(Resource.Id.list); cursor = db.WritableDatabase.RawQuery("SELECT * FROM productInfo", null); context.StartManagingCursor(cursor); adapter = new CustomLayoutAdaptor(context, cursor); listView.Adapter = adapter; searchView.QueryTextChange += (sender, e) => adapter.Filter.InvokeFilter(e.NewText); searchView.QueryTextSubmit += (sender, e) => { Toast.MakeText(icActivity, "Searched for : " + e.Query, ToastLength.Short).Show(); e.Handled = true; }; listView.ItemClick += OnListItemClick; db.Close(); return(view); }
//public SampleTabFragment2(IcActivity icActivity,CustomLayoutAdaptor adapter,ProductDBHelper db) public SampleTabFragment2(IcActivity icActivity, CustomLayoutAdaptor adapter, Activity context) { this.icActivity = icActivity; this.adapter = adapter; //this.db = db; this.context = context; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Ictab); this.ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; CustomLayoutAdaptor adapter = new CustomLayoutAdaptor(this, cursor); //ProductDBHelper db = new ProductDBHelper(this); //db.Open(); AddTab("Profile", Resource.Drawable.ic_tab_white, new SampleTabFragment(this)); AddTab("Product", Resource.Drawable.ic_tab_white, new SampleTabFragment2(this, adapter, this)); AddTab("Cart List", Resource.Drawable.ic_tab_white, new SampleTabFragment3(this)); if (bundle != null) { this.ActionBar.SelectTab(this.ActionBar.GetTabAt(bundle.GetInt("tab"))); } }
public ProductFilter(CustomLayoutAdaptor adapter, ProductDBHelper DB) { this.adapter = adapter; this.DB = DB; }