Change Appointment Text Color on Android

5 posts, 2 answers
  1. Anders
    Anders avatar
    8 posts
    Member since:
    Feb 2017

    Posted 31 Aug Link to this post

    I have a Xamarin Forms project where I am using calendar.

    But I am having problems figuring out how to change the text color of the appointments on Android.

    How do I do that?

  2. Answer
    Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    503 posts

    Posted 05 Sep Link to this post

    Hello Anders,

    You can set the AppointmentsStyle property of the RadCalendar to a custom CalendarAppointmentsStyle:

    private void cal_NativeControlLoaded(object sender, EventArgs e)
    {
        cal.AppointmentsStyle = new CalendarAppointmentsStyle
        {
            DisplayMode = AppointmentDisplayMode.Text,
            TextColor = Color.DarkOrange,
            Padding = new Thickness(5, 5, 5, 5),
        };
    }

    Note that I am setting it in the NativeControlLoaded event of the RadCalendar. This is due to a bug that we have recently logged in our internal system - Calendar[Android]: Setting the AppointmentsStyle before the control is loaded is not respected. I have increased its priority as per your report. Please have a look at the sample I have attached and consider such approach as well.

    Have a great rest of the week.

    Regards,
    Stefan Nenchev
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Anders
    Anders avatar
    8 posts
    Member since:
    Feb 2017

    Posted 11 Sep Link to this post

    I am trying to change the event text color in day view. AndI can't get this working with your provided code.

    The all-day events will get the new text color, but the timed events does not change.

  4. Answer
    Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    503 posts

    Posted 13 Sep Link to this post

    Hi Anders,

    Please have a look at the DayViewCustomViewsFragment from the Android Samples Application(located in the Examples/Android folder of your local installation). As shown there, you need to create a custom EventDayViewAdapter as well as a custom DayEventView where you can override the color. 

    Regards,
    Stefan Nenchev
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. Anders
    Anders avatar
    8 posts
    Member since:
    Feb 2017

    Posted 22 Sep in reply to Stefan Nenchev Link to this post

    Thanks, that worked great!
Back to Top