Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
For #10453: Use TabsTray API to set divider, avoiding related crashes.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcarare committed May 12, 2020
1 parent 56e0dd8 commit 58df381
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/src/main/java/org/mozilla/fenix/HomeActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -232,17 +232,21 @@ open class HomeActivity : LocaleAwareAppCompatActivity() {
tabsTray
)
}
val tray = BrowserTabsTray(context, attrs, tabsAdapter = adapter, layout = layout)
val decoration = DividerItemDecoration(
context,
DividerItemDecoration.VERTICAL
)
val drawable = AppCompatResources.getDrawable(context, R.drawable.tab_tray_divider)
drawable?.let {
decoration.setDrawable(it)
tray.addItemDecoration(decoration)
}
tray
BrowserTabsTray(
context,
attrs,
tabsAdapter = adapter,
layout = layout,
itemDecoration = decoration
)
}
else -> super.onCreateView(parent, name, context, attrs)
}
Expand Down

0 comments on commit 58df381

Please sign in to comment.