mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-09 19:10:42 +00:00
For #10453: Do not set item decoration when creating ViewHolder
This commit is contained in:
parent
77705d1a27
commit
57eb2b9549
@ -223,15 +223,6 @@ open class HomeActivity : LocaleAwareAppCompatActivity() {
|
|||||||
TabsTray::class.java.name -> {
|
TabsTray::class.java.name -> {
|
||||||
val layout = LinearLayoutManager(context)
|
val layout = LinearLayoutManager(context)
|
||||||
val adapter = TabsAdapter { parentView, tabsTray ->
|
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(
|
DefaultTabViewHolder(
|
||||||
LayoutInflater.from(parentView.context).inflate(
|
LayoutInflater.from(parentView.context).inflate(
|
||||||
@ -241,7 +232,17 @@ open class HomeActivity : LocaleAwareAppCompatActivity() {
|
|||||||
tabsTray
|
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)
|
else -> super.onCreateView(parent, name, context, attrs)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user