示例#1
0
 public RecyclerViewAdapter(Android.App.Activity activity, List <Recipe> items, Context context, RecipeListFragment recipeListFragment)
 {
     this.recipeListFragment = recipeListFragment;
     parent       = activity;
     this.context = context;
     activity.Theme.ResolveAttribute(Resource.Attribute.selectableItemBackground, typedValue, true);
     background = typedValue.ResourceId;
     values     = items;
 }
示例#2
0
        private void SetupViewPager(Android.Support.V4.View.ViewPager viewPager)
        {
            var adapter     = new Adapter(((AppCompatActivity)Activity).SupportFragmentManager);
            var recipeLinks = new RecipeLinks();
            var newFragment = new RecipeListFragment(recipeLinks.links[0].Item1, LoadType.LoadSearchRecipes, view, mChecked);

            adapter.AddFragment(newFragment, recipeLinks.links[0].Item2);
            viewPager.Adapter = adapter;
            //adapter.AddFragment(new RecipeListFragment(), "Category 1");
            //adapter.AddFragment(new RecipeListFragment(), "Category 3");
            //adapter.AddFragment(new RecipeListFragment(), "Category 3");
            //((AppCompatActivity)Activity).RunOnUiThread(() => viewPager.Adapter = adapter);
        }
示例#3
0
文件: ViewHolders.cs 项目: Markuuss/-
        RecipeListFragment recipeListFragment;//копия объекта листа
        //public EventHandler ClickHundler { get; set; }

        public ViewDescHolder(View view, Context context, RecipeListFragment recipeListFragment) : base(view)
        {
            this.view               = view;
            this.context            = context;
            this.recipeListFragment = recipeListFragment;
            spinner = view.FindViewById <Spinner>(Resource.Id.spinner);
            var adapter = ArrayAdapter.CreateFromResource(context, Resource.Array.recipes_array, Android.Resource.Layout.SimpleSpinnerItem);

            spinner.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(Spinner_ItemSelected);
            adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            spinner.Adapter = adapter;
            textView        = view.FindViewById <TextView>(Resource.Id.textView);

            spinner1 = view.FindViewById <Spinner>(Resource.Id.spinner2);
            adapter  = ArrayAdapter.CreateFromResource(context, Resource.Array.recipes_criter, Android.Resource.Layout.SimpleSpinnerItem);
            spinner1.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(Spinner_ItemSelectedSorted);
            adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            spinner1.Adapter = adapter;
            textView1        = view.FindViewById <TextView>(Resource.Id.textView2);
            Animation animation = AnimationUtils.LoadAnimation(view.Context, Resource.Animation.item_animation_from_left);

            view.StartAnimation(animation);
        }