Commit 57eb2b95 authored by Jonathan Almeida's avatar Jonathan Almeida Committed by Jonathan Almeida
Browse files

For #10453: Do not set item decoration when creating ViewHolder

parent 77705d1a
......@@ -223,15 +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(
......@@ -241,7 +232,17 @@ open class HomeActivity : LocaleAwareAppCompatActivity() {
tabsTray
)
}
BrowserTabsTray(context, attrs, tabsAdapter = adapter, layout = layout)
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
}
else -> super.onCreateView(parent, name, context, attrs)
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment