예제 #1
0
 private View createItem(Context context, int width, Events ev)
 {
     TableRow row = new TableRow(context);
     row.SetVerticalGravity(GravityFlags.CenterVertical);
     int rowWidth = (width / 10);
     if (ev.IsHeader)
         row.AddView(createHeader(context,ev),rowWidth*10,50);
     else if (ev.Type == "PAA" || ev.Type == "ELASH")
     {
         row.AddView(createColumn(context, ev.Date), rowWidth * 8, 40);
         row.AddView(createHour(context, ev.Hour), rowWidth * 2, 40);
     }
     else
     {
         row.AddView(createDoubleColumn(context, ev.Event,ev.Date), rowWidth * 8, 80);
         if (ev.Type == "PREU")
             row.AddView(createDoubleHour(context, ev.Hour), rowWidth * 2, 80);
         else
             row.AddView(createHour(context, ev.Hour), rowWidth * 2, 80);
     }
     return row;
 }
예제 #2
0
 private View createHeader(Context context, Events ev)
 {
     TextView view = new TextView(context);
     if (ev.Type=="YEAR")
     {
         view.SetBackgroundColor(Android.Graphics.Color.ParseColor("#3B3477"));
         view.Text = ev.Event;
         view.SetTextColor(Android.Graphics.Color.White);
         view.Gravity = GravityFlags.Center;
     }
     else
     {
         view.SetBackgroundColor(Android.Graphics.Color.ParseColor("#F9B129"));
         view.Text = ev.Event;
         view.SetTextColor(Android.Graphics.Color.ParseColor("#3B3477"));
         view.Gravity = GravityFlags.Center;
     }
     //#F9B129 amarillo
     //#3B3477 azul
     return view;
 }