-
Book Overview & Buying
-
Table Of Contents
Xamarin 4.x Cross-Platform Application Development - Third Edition
By :
Now let's implement a conversations list on Android. The Android equivalent of UITableView and UITableViewSource are ListView and BaseAdapter. There are parallel concepts for these Android classes, such as implementing abstract methods and recycling cells during scrolling. There are a few different types of adapters used in Android such as ArrayAdapter or CursorAdaptor, although BaseAdapter is generally best suited for simple lists.
Let's implement our conversations screen. Begin by making a new Android Activity in your Activities folder named ConversationsActivity.cs. Let's start with only a couple of changes to the class definition, as follows:
[Activity(Label = "Conversations")]
public class ConversationsActivity :
BaseActivity<MessageViewModel>
{
//Other code here later
}
Perform the following steps to implement a couple of Android layouts:
Create a new Android Layout in the layout folder of the Resources directory...
Change the font size
Change margin width
Change background colour