Exemplo n.º 1
0
        public async override void OnActivityCreated(Bundle savedInstanceState)
        {
            base.OnActivityCreated(savedInstanceState);
            List <Book> books = await Book.GetAll();

            RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this.Activity);
            bookListView.SetLayoutManager(layoutManager);
            var adapter = new AllBooksAdapter(Context, books, bookListView);

            bookListView.SetAdapter(adapter);
        }
Exemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.booksList);

            ListView    bookListView = FindViewById <ListView>(Resource.Id.bookListView);
            List <Book> books        = new List <Book>();
            Book        book1        = new Book("111111111", "Balta droble", "Antanas Skema", DateTime.Parse("1962-09-01"));
            Book        book2        = new Book("111111112", "Metai", "Danelaitis", DateTime.Parse("1922-09-01"));
            Book        book3        = new Book("111111113", "Metai", "Danelaitis", DateTime.Parse("1922-09-01"));

            books.Add(book1);
            books.Add(book2);
            books.Add(book3);

            var adapter = new AllBooksAdapter(this, books);

            bookListView.Adapter = adapter;

            //PopulateList();
        }