TouchBoarder / weekdays-buttons-bar

"Weekdays Buttons Bar" is an Android library that makes it easy to integrate weekdays selection in your layout.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enhancement: display full day name

hishambakr opened this issue · comments

In English, it is easy to recognize that SUN mains Sunday. But in Arabic, you need to display full name. this is not possible with weekdays-buttons-bar as it doesn't display full name. Even if it did that, it doesn't wrap to new line or scroll horizontally

Have you tried to change the width of the item in the theme -> see Global Theming, or with the setViewWidth(min width),
with setNumbersOfLetters(min letters)
And change the font size if needed?

It's working for me? when I set the view width to 120 and number of letters to 10 the full** weekday name is displayed and the days gets scrollable on small screens?

weekdaysDataSource = new WeekdaysDataSource(this, R.id.weekdays) .setDrawableType(WeekdaysDrawableProvider.MW_ROUND_RECT) .setViewWidth(120) .setNumberOfLetters(10) .start(this);

** But looks like for some reason I only get the 6 first letters of the name for my Locale?
The source used for the weekday names is:
DateFormatSymbols(getLocale()).getWeekdays()

From the documentation:

Returns the array of strings containing the full names of the days of the week.

Bug: I've found the bug causing this, and will update with a fix later.
if (mNumberOfLetters >= label.length()) mNumberOfLetters = label.length(); ... label.substring(0, mNumberOfLetters)
Fix:
int subStringLength = label.length(); if (subStringLength > mNumberOfLetters) subStringLength = mNumberOfLetters; ... label.substring(0, subStringLength)

Library has now been updated to supports full name on weekdays buttons

compile 'com.github.TouchBoarder:weekdays-buttons-bar:v1.0.1'