Search code examples
androidandroid-jetpackandroid-jetpack-compose

Edge padding for scrollable tab row


I have a question regarding ScrollableTabRow and edge padding

is there a possibility to set padding only for the items inside, and not the left and right edge?

simplified code: https://gist.github.com/a/4cd4994c91b4de2c59d7f6a1f5f1da12

What i need is:

https://i.sstatic.net/B4nkS.jpg

but i get something like this,

https://i.sstatic.net/QhXtr.jpg

maybe i’m setting something wrong, or there is some internal padding that i cannot change? (Basically i need to set the padding between items to be 16.dp)

i managed to get something like i want using lazy row: https://gist.github.com/a/4fdb1b124e067e5ec8d50b933477bea7

https://i.sstatic.net/YxMYy.jpg

but that would mean implementing logic for the indicator, and if possible i’d like to avoid that


Solution

  • Couldnt find a solution, so i went with lazy row and custom indicator