Lassi-Android icon indicating copy to clipboard operation
Lassi-Android copied to clipboard

Customize sorting UI

Open mateustsiqueira opened this issue 2 years ago • 1 comments

There's a way to customize UI sorting? (colors and labels - multi language)

WhatsApp Image 2023-10-11 at 17 09 16

mateustsiqueira avatar Oct 11 '23 20:10 mateustsiqueira

Hello @mateustsiqueira

Thank you for using Lassi. We will provide this customization feature in the upcoming release.

sanjay-mi avatar Oct 12 '23 05:10 sanjay-mi

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!

vrajendraBhavsar avatar Mar 27 '24 13:03 vrajendraBhavsar