Lassi-Android
Lassi-Android copied to clipboard
Customize sorting UI
There's a way to customize UI sorting? (colors and labels - multi language)
Hello @mateustsiqueira
Thank you for using Lassi. We will provide this customization feature in the upcoming release.
Hello @mateustsiqueira,
We have rolled out new version 1.4.0 where Customisable Sorting UI feature is available. Two options we are providing for multi-language support.
Option - 1:
- To set language's text programmatically based on the current language set on the device follow below mentioned approach of setting strings in your desired language.
- getMultiLngBuilder() exposes params which you can use to set texts.
val currentLang = Locale.getDefault().language.toString()
if (currentLang == "es") {
lassi.getMultiLngBuilder(
setOkLbl = "d'accord",
setCancelLbl = "Annuler",
setSortAscendingLbl = "Ascendant",
setSortDescendingLbl = "Descendant",
setSortByDateLbl = "Trier par date"
)
}
Option - 2:
- To localize text content of Lassi picker with multiple language options, define language-specific string resource file in your project and update values of string resource keys mentioned in below link with your desired language.
Refer: Lassi String Resources
For more detail please check readme, Thank you!