Hello!
While using a Custom Renderer on Android the vertical scroll of the month calendar seems to be VERY slow, don't know what is happening but seems to me that using a Custom CustomizationRule or a CustomAdapter the Month Calendar behaves more slower than normal.
I am using latest Xamarin.Forms (2.3.5.256 pre-6), Visual Studio for Mac and Latest Xamarin.Android version (updates from 08/14/2017).
I am only using this on the custom renderer to experience the slowlness:
protected
override
void
OnElementChanged(ElementChangedEventArgs<RadCalendar> e)
{
base
.OnElementChanged(e);
if
(Element ==
null
|| e.OldElement !=
null
)
return
;
_element = (CalendarCustomRenderer)Element;
_control = Control;
_control.CustomizationRule =
new
CustomizationRule();
}
public
class
CustomizationRule : Java.Lang.Object, IProcedure
{
Java.Util.Calendar calendar = Java.Util.Calendar.Instance;
public
void
Apply(Java.Lang.Object p0)
{
Calendar.CalendarDayCell cell = p0.JavaCast<Calendar.CalendarDayCell>();
var boldTypeface = Typeface.CreateFromAsset(Forms.Context.Assets,
"Branding-Bold.otf"
);
var mediumTypeface = Typeface.CreateFromAsset(Forms.Context.Assets,
"Branding-Medium.otf"
);
var semiBoldTypeface = Typeface.CreateFromAsset(Forms.Context.Assets,
"Branding-SemiBold.otf"
);
if
(cell
is
CalendarTitleCell titleCell)
{
cell.TextColor = Colors.DarkBlueColor.ToAndroid();
cell.Typeface = boldTypeface;
cell.TextSize = TypedValue.ApplyDimension(ComplexUnitType.Sp, 16, Forms.Context.Resources.DisplayMetrics);
cell.Text = cell.Text.ToUpper();
}
else
if
(cell
is
Calendar.CalendarDayCell dayCell)
{
cell.Typeface = mediumTypeface;
cell.TextSize = TypedValue.ApplyDimension(ComplexUnitType.Sp, 15, Forms.Context.Resources.DisplayMetrics);
}
calendar.TimeInMillis = cell.Date;
}
}