question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hello,

First of all, I really appreciate all of your hard work in putting together this great library. We’ve been most fortunate to be able to use it in our project because it’s been of great help. I’ve been going over all the documentation to customize the library to fit some requirements but have run into an issue as I’m not able to change the typeface of the weekday labels (Sun/Mon/etc). I was able to work around this issue for the headers by calling .setTopbarVisible(false); and using my own label inside a FrameLayout but I was wondering if there is anything I could do to set a custom typeface for the weekday labels.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
firozecommented, Oct 4, 2016
        materialCalendarView.setWeekDayFormatter(dayOfWeek -> {
            SpannableString daySpan = new SpannableString(days[dayOfWeek - 1]);
            daySpan.setSpan(new TypefaceSpan(getApplicationContext(), "Regular-Book.ttf"), 0, daySpan.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
            daySpan.setSpan(new ForegroundColorSpan(ContextCompat.getColor(getApplicationContext(), R.color.dateStroke)), 0, daySpan.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
            daySpan.setSpan(new RelativeSizeSpan(1.5f), 0, daySpan.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
            return daySpan;
        });
1reaction
riadhnetcommented, Oct 10, 2016

In my case changing color / font is not working i’m using like this calendarView.setWeekDayFormatter(new WeekDayViewDecorator(this));

@Override public CharSequence format(int dayOfWeek) { String[] daysOfWeek = context.getResources().getStringArray(R.array.custom_weekdays); SpannableString daySpan = new SpannableString(daysOfWeek[dayOfWeek - 1]); daySpan.setSpan(new TypefaceSpan(context.getString(R.string.opensans_bold)), 0, daySpan.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); daySpan.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.red)), 0, daySpan.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); return daySpan; }

any suggestion ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Weekday font download | MaisFontes.com
Weekday is the perfect font for all your fun designs. The Weekday font was designed by Paula Type. The font subfamily is Regular....
Read more >
Weekday matchbooks - Fonts In Use - Pinterest
A fun set of matchbooks made by the Ohio Match Company showing days of the week set in different typefaces. Monday is set...
Read more >
Weekday matchbooks - Fonts In Use
A fun set of matchbooks made by the Ohio Match Company showing days of the week set in different typefaces. Monday is set...
Read more >
Weekday Mornings Font - Fontspring
Designed by Jakob Fischer, Weekday Mornings is a hand display and hand drawn font family. This typeface has two styles and was published...
Read more >
Weekday - A Fun Handwritten Font
Weekday is a fun caps font! This font is perfect for quotes, shirt designs, websites, branding, children's designs, svg designs, blogs, logos, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found