Skip to content

Commit 8b1790a

Browse files
committed
Add a new tab manager popup menu for bottom toolbar that lists items in reverse order
1 parent 4d57d8b commit 8b1790a

File tree

2 files changed

+115
-1
lines changed

2 files changed

+115
-1
lines changed

app/src/main/java/com/duckduckgo/app/tabs/ui/TabSwitcherActivity.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,11 @@ class TabSwitcherActivity : DuckDuckGoActivity(), TabSwitcherListener, Coroutine
216216

217217
private val binding: ActivityTabSwitcherBinding by viewBinding()
218218
private val popupMenu by lazy {
219-
PopupMenu(layoutInflater, R.layout.popup_tabs_menu)
219+
if (settingsDataStore.omnibarPosition == OmnibarPosition.BOTTOM && viewModel.isNewDesignEnabled) {
220+
PopupMenu(layoutInflater, R.layout.popup_tabs_menu_bottom)
221+
} else {
222+
PopupMenu(layoutInflater, R.layout.popup_tabs_menu)
223+
}
220224
}
221225

222226
override fun onCreate(savedInstanceState: Bundle?) {
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
<?xml version="1.0" encoding="utf-8"?><!--
2+
~ Copyright (c) 2025 DuckDuckGo
3+
~
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" BASIS,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
-->
16+
17+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
18+
xmlns:app="http://schemas.android.com/apk/res-auto"
19+
android:layout_width="match_parent"
20+
android:layout_height="wrap_content"
21+
android:background="@drawable/popup_menu_bg"
22+
android:orientation="vertical">
23+
24+
<com.duckduckgo.common.ui.view.PopupMenuItemView
25+
android:id="@+id/closeSelectedTabsMenuItem"
26+
android:layout_width="match_parent"
27+
android:layout_height="wrap_content"
28+
app:primaryTextType="destructive" />
29+
30+
<com.duckduckgo.common.ui.view.PopupMenuItemView
31+
android:id="@+id/closeOtherTabsMenuItem"
32+
android:layout_width="match_parent"
33+
android:layout_height="wrap_content"
34+
app:primaryText="@string/closeOtherTabsMenuItem"
35+
app:primaryTextType="destructive" />
36+
37+
<com.duckduckgo.common.ui.view.PopupMenuItemView
38+
android:id="@+id/closeAllTabsMenuItem"
39+
android:layout_width="match_parent"
40+
android:layout_height="wrap_content"
41+
app:primaryText="@string/closeAllTabsMenuItem"
42+
app:primaryTextType="destructive" />
43+
44+
<com.duckduckgo.common.ui.view.divider.HorizontalDivider
45+
android:id="@+id/closeAllTabsDivider"
46+
android:layout_width="match_parent"
47+
android:layout_height="wrap_content"
48+
app:defaultPadding="false" />
49+
50+
<com.duckduckgo.common.ui.view.PopupMenuItemView
51+
android:id="@+id/selectTabsMenuItem"
52+
android:layout_width="match_parent"
53+
android:layout_height="wrap_content"
54+
app:primaryText="@string/selectTabsMenuItem" />
55+
56+
<com.duckduckgo.common.ui.view.divider.HorizontalDivider
57+
android:id="@+id/selectTabsDivider"
58+
android:layout_width="match_parent"
59+
android:layout_height="wrap_content"
60+
app:defaultPadding="false" />
61+
62+
<com.duckduckgo.common.ui.view.PopupMenuItemView
63+
android:id="@+id/shareSelectedLinksMenuItem"
64+
android:layout_width="match_parent"
65+
android:layout_height="wrap_content" />
66+
67+
<com.duckduckgo.common.ui.view.PopupMenuItemView
68+
android:id="@+id/bookmarkSelectedTabsMenuItem"
69+
android:layout_width="match_parent"
70+
android:layout_height="wrap_content" />
71+
72+
<com.duckduckgo.common.ui.view.divider.HorizontalDivider
73+
android:id="@+id/selectionActionsDivider"
74+
android:layout_width="match_parent"
75+
android:layout_height="wrap_content"
76+
app:defaultPadding="false" />
77+
78+
<com.duckduckgo.common.ui.view.PopupMenuItemView
79+
android:id="@+id/deselectAllMenuItem"
80+
android:layout_width="match_parent"
81+
android:layout_height="wrap_content"
82+
app:primaryText="@string/deselectAllTabsMenuItem" />
83+
84+
<com.duckduckgo.common.ui.view.PopupMenuItemView
85+
android:id="@+id/selectAllMenuItem"
86+
android:layout_width="match_parent"
87+
android:layout_height="wrap_content"
88+
app:primaryText="@string/selectAllTabsMenuItem" />
89+
90+
<com.duckduckgo.common.ui.view.PopupMenuItemView
91+
android:id="@+id/listLayoutMenuItem"
92+
android:layout_width="match_parent"
93+
android:layout_height="wrap_content"
94+
app:primaryText="@string/tabSwitcherListViewMenu"
95+
app:trailingIcon="@drawable/ic_check_24" />
96+
97+
<com.duckduckgo.common.ui.view.PopupMenuItemView
98+
android:id="@+id/gridLayoutMenuItem"
99+
android:layout_width="match_parent"
100+
android:layout_height="wrap_content"
101+
app:primaryText="@string/tabSwitcherGridViewMenu"
102+
app:trailingIcon="@drawable/ic_check_24" />
103+
104+
<com.duckduckgo.common.ui.view.PopupMenuItemView
105+
android:id="@+id/newTabMenuItem"
106+
android:layout_width="match_parent"
107+
android:layout_height="wrap_content"
108+
app:primaryText="@string/newTabMenuItem" />
109+
110+
</LinearLayout>

0 commit comments

Comments
 (0)