TouchBoarder / weekdays-buttons-bar

"Weekdays Buttons Bar" is an Android library that makes it easy to integrate weekdays selection in your layout.
MIT License
146 stars 25 forks source link

Enhancement: display full day name #3

Closed hishambakr closed 8 years ago

hishambakr commented 8 years ago

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

TouchBoarder commented 8 years ago

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?

TouchBoarder commented 8 years ago

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)

TouchBoarder commented 8 years ago

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

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