Beispiel #1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            // return inflater.Inflate(Resource.Layout.YourFragment, container, false);
            //return base.OnCreateView(inflater, container, savedInstanceState);

            myView = inflater.Inflate(Resource.Layout.homeMenu, container, false);

            //eatables
            mFoodObject  = new FoodObject(); //passing category id
            mRecycleView = myView.FindViewById <RecyclerView>(Resource.Id.recyclerView);
            mRecycleView.SetLayoutManager(new LinearLayoutManager(myView.Context, LinearLayoutManager.Horizontal, false));
            mAdapter            = new FoodObjectAdapter(mFoodObject);
            mAdapter.ItemClick += MAdapter_ItemClick;
            mRecycleView.SetAdapter(mAdapter);
            //

            //beverage
            mFoodObject1  = new FoodObject1(); //passing category id
            mRecycleView1 = myView.FindViewById <RecyclerView>(Resource.Id.recyclerView1);
            mRecycleView1.SetLayoutManager(new LinearLayoutManager(myView.Context, LinearLayoutManager.Horizontal, false));
            mAdapter1            = new FoodObjectAdapter1(mFoodObject1);
            mAdapter1.ItemClick += MAdapter_ItemClick1;
            mRecycleView1.SetAdapter(mAdapter1);
            //
            return(myView);
        }
 public FoodObjectAdapter1(FoodObject1 fudobj)
 {
     mFoodObject = fudobj;
 }