Ejemplo n.º 1
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            ShowsViewHolder vh = holder as ShowsViewHolder;

            //vh.Image.SetImageBitmap(GetBitmap(shows[position].PosterLink));
            vh.Image.SetImageBitmap(IMDBShowsManager.ShowsBitmaps[position]);
            vh.Name.Text        = shows[position].Name;
            vh.Genre.Text       = shows[position].Genre;
            vh.ShowsModel       = shows[position];
            vh.RatingBar.Rating = shows[position].Rating;

            if (position == shows.Count - 1)
            {
                IMDBShowsManager.LoadShows(IMDBShowsManager.ShowsLoadCount.Middle);
            }
        }
Ejemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.activity_shows);

            mRecyclerView = FindViewById <RecyclerView>(Resource.Id.rv);
            layoutManager = new LinearLayoutManager(this);
            mRecyclerView.SetLayoutManager(layoutManager);
            sAdapter = new ShowsAdapter(this, IMDBShowsManager.Shows);
            mRecyclerView.SetAdapter(sAdapter);
            IMDBShowsManager.ShowsAdd   += sAdapter.RefreshRecyclerView;
            IMDBShowsManager.ShowsClear += sAdapter.RefreshRecyclerView;
            Accelerometer.ShakeDetected += (s, e) =>
            {
                Toast.MakeText(this, "Shake detected", ToastLength.Short).Show();
                IMDBShowsManager.Init();
            };
            SensorSpeed speed = SensorSpeed.Game;

            Accelerometer.Start(speed);
            IMDBShowsManager.Init();
        }