Пример #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_maket);

            ActionBar.SetHomeButtonEnabled(true);
            ActionBar.SetDisplayHomeAsUpEnabled(true);

            List <String> getRecipeNAME = new List <String>();
            List <String> getRecipeID   = new List <String>();

            getRecipeID   = Intent.Extras.GetStringArrayList("recipeID").ToList();
            getRecipeNAME = Intent.Extras.GetStringArrayList("recipeNAME").ToList();

            int count = 0;

            foreach (string elem in getRecipeNAME)
            {
                String mDrawableName = getRecipeID[count];
                count    += 1;
                prev.Name = elem;
                int resID = Resources.GetIdentifier(mDrawableName, "drawable", PackageName);
                prev.Image = resID;
                preview.Add(prev);
                prev = new Preview();
            }

            rv = FindViewById <RecyclerView>(Resource.Id.list);
            rv.SetLayoutManager(new LinearLayoutManager(this));
            rv.SetItemAnimator(new DefaultItemAnimator());
            adapter = new DataAdapter(this, preview);
            rv.SetAdapter(adapter);

            adapter.ItemClick += OnItemClick;
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_maket);

            ActionBar.SetHomeButtonEnabled(true);
            ActionBar.SetDisplayHomeAsUpEnabled(true);

            String mDrawableName;

            mDrawableName = Intent.GetStringExtra("recID");
            int resID = Resources.GetIdentifier(mDrawableName, "drawable", PackageName);

            String get;

            get        = Intent.GetStringExtra("recCOOKING");
            prev.Name  = get;
            prev.Image = resID;
            preview.Add(prev);
            prev = new Preview();
            rv   = FindViewById <RecyclerView>(Resource.Id.list);
            rv.SetLayoutManager(new LinearLayoutManager(this));
            rv.SetItemAnimator(new DefaultItemAnimator());
            adapter = new DataAdapterRecipe(this, preview);
            rv.SetAdapter(adapter);
        }