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

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

Merged
merged 1 commit into from
May 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions app/src/main/java/org/mozilla/fenix/HomeActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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)
}
Expand Down