mozilla-mobile / reference-browser

A full-featured browser reference implementation using Mozilla Android Components.
Mozilla Public License 2.0
581 stars 166 forks source link

Add a DividerItemDecoration to match the new Browser TabsTray design #1112

Closed gabrielluong closed 4 years ago

gabrielluong commented 4 years ago

In BrowserActivity.kt, you have a reference to the BrowserTabsTray which is a RecyclerView so you can call tray.addItemDecoration(..) and define the ItemDecoration you need to show the divider.

darkwing commented 4 years ago

Note: Fenix uses:

addItemDecoration(
                DividerItemDecoration(
                    context,
                    DividerItemDecoration.VERTICAL
                )
            )
gabrielluong commented 4 years ago

I will note that the designs doesn't actually have a perfect vertical divider. There is an offset and begins wherever the title starts.

darkwing commented 4 years ago

@boek Should we use this programmatic DividerItemDecoration or can we put a 1dp view with constraints and a background color to make it look as it should?

darkwing commented 4 years ago

Fenix uses a basic view for dividers, so we could do something like this:

<View
        android:id="@+id/divider"
        android:layout_width="0dp"
        android:layout_height="1dp"
        android:background="#ff0000"
        app:layout_constraintEnd_toStartOf="@id/mozac_browser_tabstray_close"
        app:layout_constraintStart_toEndOf="@id/mozac_browser_tabstray_thumbnail"
        app:layout_constraintTop_toTopOf="parent"
        android:importantForAccessibility="no" />
jonalmeida commented 4 years ago

@boek Should we use this programmatic DividerItemDecoration or can we put a 1dp view with constraints and a background color to make it look as it should?

Please do not do this, it's a big performance loss.

gabrielluong commented 4 years ago

Probably not worthwhile, closing this issue.