Last active
August 29, 2015 14:13
-
-
Save dshookowsky/3679a6bdc83fc4f9f285 to your computer and use it in GitHub Desktop.
Using font icons in Xamarin.Android
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override View GetView (int position, View convertView, ViewGroup parent) | |
{ | |
var item = items [position]; | |
View view = convertView; | |
TextView details = null; | |
if (view == null) { // no view to re-use, create new | |
view = context.LayoutInflater.Inflate (Resource.Layout.Room, null); | |
Typeface tf = Typeface.CreateFromAsset(Application.Context.Assets, "icomoon.ttf"); | |
view.FindViewById<TextView>(Resource.Id.status).SetTypeface(tf, TypefaceStyle.Normal); | |
details = view.FindViewById<TextView>(Resource.Id.details); | |
details.SetTypeface(tf, TypefaceStyle.Normal); | |
details.Text = '\xe953'.ToString(); | |
} | |
TextView statusTextView = view.FindViewById<TextView>(Resource.Id.status); | |
statusTextView.SetTextColor(_freeBusyColor[item.free]); | |
statusTextView.Text = _freeBusyChar[item.free].ToString(); | |
view.FindViewById<TextView>(Resource.Id.roomName).Text = item.roomName; | |
details = view.FindViewById<TextView>(Resource.Id.details); | |
details.SetOnTouchListener(this); | |
details.Tag = item.emailAddress; | |
return view; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment