You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
instead of hardcoded short day names, you can use dynamically loaded localized names. In WeekCalendar.java change String[] days = {...} to something like this:
// Get localized short names for days. Index 0 = empty string (always). Rest are name days starting with sundayString[] weekDays = DateFormatSymbols.getInstance().getShortWeekdays();
// Convert into ListList<String> listDays = newArrayList<>(Arrays.asList(weekDays));
// Remove empty stringlistDays.remove(0);
// Remove Sunday from beginningStringsunday = listDays.remove(0);
// Add Sunday to the end of arraylistDays.add(sunday);
// convert back into String[], or just use listDaysString[] days = newString[listDays.size()];
listDays.toArray(days);
On my Locale this will get array, where day names are two characters long, which is ok, they will fit in WeekView. But for example in English locale this will return day names three characters long and it's too long. So day names can be shortened like (before converting to String[]):
for (inti = 0; i < listDays.size(); i++) {
listDays.set(i, listDays.get(i).substring(0, 1));
}
Hope this will help, keep up the good work, this View was exactly what I was looking for!
The text was updated successfully, but these errors were encountered:
Hello,
I am glad that this view helped you.
Yeah I had a few things in mind, and the day names are also in todo list.
I will add options for both 1 char and 3 char days and the day names will be according to Locale.
User version 1.0.3, this issue has be resolved and also you can use dayNameLength xml attribute to get single letter of 3 letter long day name.
Thanks for the tip, it Helped!
Hi,
instead of hardcoded short day names, you can use dynamically loaded localized names. In WeekCalendar.java change String[] days = {...} to something like this:
On my Locale this will get array, where day names are two characters long, which is ok, they will fit in WeekView. But for example in English locale this will return day names three characters long and it's too long. So day names can be shortened like (before converting to String[]):
Hope this will help, keep up the good work, this View was exactly what I was looking for!
The text was updated successfully, but these errors were encountered: