Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gaba
fenix
Commits
f3edce5f
Unverified
Commit
f3edce5f
authored
Nov 12, 2020
by
Codrut Topliceanu
Committed by
GitHub
Nov 12, 2020
Browse files
For #11376 - Reverse tabs list order (#16245)
parent
ae407a73
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt
View file @
f3edce5f
...
...
@@ -193,13 +193,11 @@ class TabTrayView(
tabsAdapter
.
tabTrayInteractor
=
interactor
tabsAdapter
.
onTabsUpdated
=
{
if
(
view
.
context
.
settings
().
gridTabView
)
{
concatAdapter
.
addAdapter
(
collectionsButtonAdapter
)
concatAdapter
.
addAdapter
(
syncedTabsController
.
adapter
)
concatAdapter
.
addAdapter
(
collectionsButtonAdapter
)
}
else
{
// Put the 'Add to collections' button after the tabs have loaded.
concatAdapter
.
addAdapter
(
0
,
collectionsButtonAdapter
)
// Put the Synced Tabs adapter at the end.
concatAdapter
.
addAdapter
(
syncedTabsController
.
adapter
)
concatAdapter
.
addAdapter
(
collectionsButtonAdapter
)
}
if
(
hasAccessibilityEnabled
)
{
...
...
@@ -442,10 +440,7 @@ class TabTrayView(
private
fun
setupListTabView
()
{
view
.
tabsTray
.
apply
{
layoutManager
=
LinearLayoutManager
(
container
.
context
).
apply
{
reverseLayout
=
true
stackFromEnd
=
true
}
layoutManager
=
LinearLayoutManager
(
container
.
context
)
}
}
...
...
@@ -730,19 +725,11 @@ class TabTrayView(
view
.
context
.
components
.
core
.
store
.
state
.
normalTabs
}
val
selectedBrowserTabIndex
=
if
(
sessionId
!=
null
)
{
return
if
(
sessionId
!=
null
)
{
tabs
.
indexOfFirst
{
it
.
id
==
sessionId
}
}
else
{
tabs
.
indexOfFirst
{
it
.
id
==
view
.
context
.
components
.
core
.
store
.
state
.
selectedTabId
}
}
// We offset the tab index by the number of items in the other adapters.
// We add the offset, because the layoutManager is initialized with `reverseLayout`.
return
if
(
view
.
context
.
settings
().
listTabView
)
{
selectedBrowserTabIndex
+
collectionsButtonAdapter
.
itemCount
+
syncedTabsController
.
adapter
.
itemCount
}
else
{
selectedBrowserTabIndex
}
}
companion
object
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment