This is a migrated thread and some comments may be shown as answers.

Change Appointment Text Color on Android

4 Answers 143 Views
Calendar & Scheduling
This is a migrated thread and some comments may be shown as answers.
Anders
Top achievements
Rank 1
Anders asked on 31 Aug 2017, 04:59 PM

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?

4 Answers, 1 is accepted

Sort by
0
Accepted
Stefan Nenchev
Telerik team
answered on 05 Sep 2017, 10:11 AM
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
0
Anders
Top achievements
Rank 1
answered on 11 Sep 2017, 04:00 PM

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.

0
Accepted
Stefan Nenchev
Telerik team
answered on 13 Sep 2017, 03:02 PM
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
0
Anders
Top achievements
Rank 1
answered on 22 Sep 2017, 04:32 PM
Thanks, that worked great!
Tags
Calendar & Scheduling
Asked by
Anders
Top achievements
Rank 1
Answers by
Stefan Nenchev
Telerik team
Anders
Top achievements
Rank 1
Share this question
or