mozilla-mobile / android-components

⚠️ This project moved to a new repository. It is now developed and maintained at: https://github.com/mozilla-mobile/firefox-android
https://github.com/mozilla-mobile/firefox-android
Mozilla Public License 2.0
2.02k stars 472 forks source link

Add optional DividerItemDecoration parameters in Browser TabsTray #6552

Closed gabrielluong closed 4 years ago

gabrielluong commented 4 years ago

In the [Tabs Tray Design], we need to be able to add a divider in between each items in the RecyclerView. We can achieve this by adding a DividerItemDecoration in BrowserTabsTray.

┆Issue is synchronized with this Jira Task

gabrielluong commented 4 years ago

Closing as WONTFIX. We don't need to expose the ItemDecoration bit of the BrowserTabsTray's RecyclerView, because BrowserTabsTray is a RecyclerView. You can simply add the decoration on to the view itself.

val tray = BrowserTabsTray(context, attrs)
tray.addItemDecoration(object : RecyclerView.ItemDecoration() {
    override fun getItemOffsets(
        outRect: Rect,
        view: View,
        parent: RecyclerView,
        state: RecyclerView.State
    ) {
        // Do things here.
    }
})