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

Commit

Permalink
For #10453: Add item decoration after setAdapter() is called.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcarare committed May 7, 2020
1 parent 9177871 commit 074b4ec
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions app/src/main/java/org/mozilla/fenix/HomeActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -223,16 +223,6 @@ open class HomeActivity : LocaleAwareAppCompatActivity() {
TabsTray::class.java.name -> {
val layout = LinearLayoutManager(context)
val adapter = TabsAdapter { parentView, tabsTray ->
val decoration = DividerItemDecoration(
context,
DividerItemDecoration.VERTICAL
)
val drawable = AppCompatResources.getDrawable(context, R.drawable.tab_tray_divider)
drawable?.let {
decoration.setDrawable(it)
tabsTray.addItemDecoration(decoration)
}

DefaultTabViewHolder(
LayoutInflater.from(parentView.context).inflate(
R.layout.tab_tray_item,
Expand All @@ -241,7 +231,17 @@ open class HomeActivity : LocaleAwareAppCompatActivity() {
tabsTray
)
}
BrowserTabsTray(context, attrs, tabsAdapter = adapter, layout = layout)
val browserTabsTray = 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)
}
browserTabsTray.addItemDecoration(decoration)
browserTabsTray
}
else -> super.onCreateView(parent, name, context, attrs)
}
Expand Down

0 comments on commit 074b4ec

Please sign in to comment.