private void SetupFragment() { var gridPresenter = new VerticalGridPresenter(); gridPresenter.NumberOfColumns = NUM_COLUMNS; this.GridPresenter = gridPresenter; mAdapter = new ArrayObjectAdapter(new CardPresenter()); long seed = System.Diagnostics.Stopwatch.GetTimestamp(); //a pseudorandom seed based on system time var movies = VideoProvider.MovieList; foreach (var entry in movies) { //TODO may need to write Util.Shuffle method, will go in Utils.cs var list = (List <Object>)entry.Value; Collections.Shuffle(list, new Java.Util.Random(seed)); foreach (var movie in list) { mAdapter.Add((Movie)movie); } } this.Adapter = mAdapter; SetOnItemSelectedListener(this); OnItemClickedListener = this; SetOnItemSelectedListener(this); }
private void SetupFragment() { var gridPresenter = new VerticalGridPresenter(); gridPresenter.NumberOfColumns = NUM_COLUMNS; this.GridPresenter = gridPresenter; mAdapter = new ArrayObjectAdapter (new CardPresenter ()); long seed = System.Diagnostics.Stopwatch.GetTimestamp(); //a pseudorandom seed based on system time var movies = VideoProvider.MovieList; foreach (var entry in movies) { //TODO may need to write Util.Shuffle method, will go in Utils.cs var list = (List<Object>)entry.Value; Collections.Shuffle (list, new Java.Util.Random (seed)); foreach (var movie in list) mAdapter.Add ((Movie) movie); } this.Adapter = mAdapter; OnItemViewClickedListener = this; SetOnItemViewSelectedListener (this); }