Skip to content

Commit 697f6fb

Browse files
committed
Add mock split omnibar
1 parent b43e1c8 commit 697f6fb

File tree

7 files changed

+564
-219
lines changed

7 files changed

+564
-219
lines changed

app/src/main/java/com/duckduckgo/app/browser/BrowserActivity.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,12 @@ open class BrowserActivity : DuckDuckGoActivity() {
993993
},
994994
300,
995995
)
996+
Handler(Looper.getMainLooper()).postDelayed(
997+
{
998+
binding.navigationBarMockup.root.gone()
999+
},
1000+
2000,
1001+
)
9961002
}
9971003

9981004
override fun toggleFullScreen() {
@@ -1412,6 +1418,11 @@ open class BrowserActivity : DuckDuckGoActivity() {
14121418
if (Build.VERSION.SDK_INT >= 28) {
14131419
omnibarToolbarMockupBinding.mockOmniBarContainerShadow.addBottomShadow()
14141420
}
1421+
1422+
if (settingsDataStore.omnibarType == OmnibarType.SPLIT) {
1423+
binding.topMockupSingleToolbar.iconsContainer.gone()
1424+
binding.navigationBarMockup.root.show()
1425+
}
14151426
}
14161427

14171428
OmnibarType.SINGLE_BOTTOM -> {

app/src/main/res/layout-w600dp/view_browser_navigation_bar.xml

Lines changed: 129 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -13,156 +13,172 @@
1313
~ See the License for the specific language governing permissions and
1414
~ limitations under the License.
1515
-->
16-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
16+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
1717
xmlns:app="http://schemas.android.com/apk/res-auto"
1818
xmlns:tools="http://schemas.android.com/tools"
19-
android:id="@+id/barView"
19+
android:id="@+id/rootView"
2020
android:layout_width="match_parent"
21-
android:layout_height="wrap_content"
22-
android:background="?attr/preferredNavigationBarColor"
23-
android:gravity="center"
24-
android:orientation="horizontal"
25-
android:paddingTop="@dimen/navigationBarPaddingTop"
26-
android:paddingBottom="@dimen/navigationBarPaddingBottom"
27-
app:layout_constraintTop_toTopOf="parent"
28-
tools:parentTag="androidx.coordinatorlayout.widget.CoordinatorLayout">
21+
android:layout_height="wrap_content">
2922

30-
<Space
31-
android:layout_width="0dp"
32-
android:layout_height="match_parent"
33-
android:layout_weight="1" />
23+
<LinearLayout
24+
android:id="@+id/barView"
25+
android:layout_width="match_parent"
26+
android:layout_height="wrap_content"
27+
android:background="?attr/preferredNavigationBarColor"
28+
android:gravity="center"
29+
android:orientation="horizontal"
30+
android:paddingTop="@dimen/navigationBarPaddingTop"
31+
android:paddingBottom="@dimen/navigationBarPaddingBottom"
32+
app:layout_constraintTop_toTopOf="parent"
33+
tools:parentTag="androidx.coordinatorlayout.widget.CoordinatorLayout">
3434

35+
<Space
36+
android:layout_width="0dp"
37+
android:layout_height="match_parent"
38+
android:layout_weight="1" />
3539

36-
<Space
37-
android:layout_width="0dp"
38-
android:layout_height="match_parent"
39-
android:layout_weight="1" />
4040

41+
<Space
42+
android:layout_width="0dp"
43+
android:layout_height="match_parent"
44+
android:layout_weight="1" />
4145

42-
<FrameLayout
43-
android:layout_width="wrap_content"
44-
android:layout_height="wrap_content">
4546

4647
<FrameLayout
47-
android:id="@+id/newTabButton"
48+
android:layout_width="wrap_content"
49+
android:layout_height="wrap_content">
50+
51+
<FrameLayout
52+
android:id="@+id/newTabButton"
53+
android:layout_width="@dimen/toolbarIcon"
54+
android:layout_height="@dimen/toolbarIcon"
55+
android:background="@drawable/selectable_item_experimental_background"
56+
android:visibility="gone"
57+
tools:visibility="visible">
58+
59+
<ImageView
60+
android:id="@+id/newTabButtonImageView"
61+
android:layout_width="@dimen/toolbarIcon"
62+
android:layout_height="@dimen/toolbarIcon"
63+
android:layout_gravity="center"
64+
android:contentDescription="@string/newTabMenuItem"
65+
android:scaleType="center"
66+
android:src="@drawable/ic_add_24" />
67+
</FrameLayout>
68+
69+
<FrameLayout
70+
android:id="@+id/autofillButton"
71+
android:layout_width="@dimen/toolbarIcon"
72+
android:layout_height="@dimen/toolbarIcon"
73+
android:background="@drawable/selectable_item_experimental_background"
74+
android:visibility="gone"
75+
tools:visibility="visible">
76+
77+
<ImageView
78+
android:id="@+id/autofillButtonImageView"
79+
android:layout_width="@dimen/toolbarIcon"
80+
android:layout_height="@dimen/toolbarIcon"
81+
android:layout_gravity="center"
82+
android:contentDescription="@string/autofillManagementScreenTitle"
83+
android:scaleType="center"
84+
android:src="@drawable/ic_key_24" />
85+
</FrameLayout>
86+
87+
</FrameLayout>
88+
89+
<Space
90+
android:layout_width="0dp"
91+
android:layout_height="match_parent"
92+
android:layout_weight="1" />
93+
94+
<FrameLayout
95+
android:id="@+id/bookmarksButton"
4896
android:layout_width="@dimen/toolbarIcon"
4997
android:layout_height="@dimen/toolbarIcon"
50-
android:background="@drawable/selectable_item_experimental_background"
51-
android:visibility="gone"
52-
tools:visibility="visible">
98+
android:background="@drawable/selectable_item_experimental_background">
5399

54100
<ImageView
55-
android:id="@+id/newTabButtonImageView"
101+
android:id="@+id/bookmarksImageView"
56102
android:layout_width="@dimen/toolbarIcon"
57103
android:layout_height="@dimen/toolbarIcon"
58104
android:layout_gravity="center"
59-
android:contentDescription="@string/newTabMenuItem"
105+
android:contentDescription="@string/bookmarksMenuTitle"
60106
android:scaleType="center"
61-
android:src="@drawable/ic_add_24" />
107+
android:src="@drawable/ic_bookmarks_24" />
62108
</FrameLayout>
63109

110+
<Space
111+
android:layout_width="0dp"
112+
android:layout_height="match_parent"
113+
android:layout_weight="1" />
114+
64115
<FrameLayout
65-
android:id="@+id/autofillButton"
116+
android:id="@+id/fireButton"
66117
android:layout_width="@dimen/toolbarIcon"
67118
android:layout_height="@dimen/toolbarIcon"
68-
android:background="@drawable/selectable_item_experimental_background"
69-
android:visibility="gone"
70-
tools:visibility="visible">
119+
android:background="@drawable/selectable_item_experimental_background">
71120

72121
<ImageView
73-
android:id="@+id/autofillButtonImageView"
122+
android:id="@+id/fireIconImageView"
74123
android:layout_width="@dimen/toolbarIcon"
75124
android:layout_height="@dimen/toolbarIcon"
76125
android:layout_gravity="center"
77-
android:contentDescription="@string/autofillManagementScreenTitle"
126+
android:contentDescription="@string/fireMenu"
78127
android:scaleType="center"
79-
android:src="@drawable/ic_key_24" />
128+
android:src="@drawable/ic_fire_24" />
80129
</FrameLayout>
81130

82-
</FrameLayout>
131+
<Space
132+
android:layout_width="0dp"
133+
android:layout_height="match_parent"
134+
android:layout_weight="1" />
83135

84-
<Space
85-
android:layout_width="0dp"
86-
android:layout_height="match_parent"
87-
android:layout_weight="1" />
136+
<com.duckduckgo.browser.ui.tabs.NewTabSwitcherButton
137+
android:id="@+id/tabsButton"
138+
android:layout_width="@dimen/toolbarIcon"
139+
android:layout_height="@dimen/toolbarIcon" />
88140

89-
<FrameLayout
90-
android:id="@+id/bookmarksButton"
91-
android:layout_width="@dimen/toolbarIcon"
92-
android:layout_height="@dimen/toolbarIcon"
93-
android:background="@drawable/selectable_item_experimental_background">
141+
<Space
142+
android:layout_width="0dp"
143+
android:layout_height="match_parent"
144+
android:layout_weight="1" />
94145

95-
<ImageView
96-
android:id="@+id/bookmarksImageView"
97-
android:layout_width="@dimen/toolbarIcon"
98-
android:layout_height="@dimen/toolbarIcon"
99-
android:layout_gravity="center"
100-
android:contentDescription="@string/bookmarksMenuTitle"
101-
android:scaleType="center"
102-
android:src="@drawable/ic_bookmarks_24" />
103-
</FrameLayout>
104-
105-
<Space
106-
android:layout_width="0dp"
107-
android:layout_height="match_parent"
108-
android:layout_weight="1" />
109-
110-
<FrameLayout
111-
android:id="@+id/fireButton"
112-
android:layout_width="@dimen/toolbarIcon"
113-
android:layout_height="@dimen/toolbarIcon"
114-
android:background="@drawable/selectable_item_experimental_background">
115-
116-
<ImageView
117-
android:id="@+id/fireIconImageView"
118-
android:layout_width="@dimen/toolbarIcon"
119-
android:layout_height="@dimen/toolbarIcon"
120-
android:layout_gravity="center"
121-
android:contentDescription="@string/fireMenu"
122-
android:scaleType="center"
123-
android:src="@drawable/ic_fire_24" />
124-
</FrameLayout>
125-
126-
<Space
127-
android:layout_width="0dp"
128-
android:layout_height="match_parent"
129-
android:layout_weight="1" />
130-
131-
<com.duckduckgo.browser.ui.tabs.NewTabSwitcherButton
132-
android:id="@+id/tabsButton"
133-
android:layout_width="@dimen/toolbarIcon"
134-
android:layout_height="@dimen/toolbarIcon" />
135-
136-
<Space
137-
android:layout_width="0dp"
138-
android:layout_height="match_parent"
139-
android:layout_weight="1" />
140-
141-
<FrameLayout
142-
android:id="@+id/menuButton"
143-
android:layout_width="@dimen/toolbarIcon"
144-
android:layout_height="@dimen/toolbarIcon"
145-
android:background="@drawable/selectable_item_experimental_background">
146-
147-
<ImageView
148-
android:id="@+id/menuIconImageView"
146+
<FrameLayout
147+
android:id="@+id/menuButton"
149148
android:layout_width="@dimen/toolbarIcon"
150149
android:layout_height="@dimen/toolbarIcon"
151-
android:layout_gravity="center"
152-
android:contentDescription="@string/browserPopupMenu"
153-
android:scaleType="center"
154-
android:src="@drawable/ic_menu_vertical_24" />
155-
</FrameLayout>
150+
android:background="@drawable/selectable_item_experimental_background">
151+
152+
<ImageView
153+
android:id="@+id/menuIconImageView"
154+
android:layout_width="@dimen/toolbarIcon"
155+
android:layout_height="@dimen/toolbarIcon"
156+
android:layout_gravity="center"
157+
android:contentDescription="@string/browserPopupMenu"
158+
android:scaleType="center"
159+
android:src="@drawable/ic_menu_vertical_24" />
160+
</FrameLayout>
161+
162+
<Space
163+
android:layout_width="0dp"
164+
android:layout_height="match_parent"
165+
android:layout_weight="1" />
166+
167+
<Space
168+
android:layout_width="0dp"
169+
android:layout_height="match_parent"
170+
android:layout_weight="1" />
156171

157-
<Space
158-
android:layout_width="0dp"
159-
android:layout_height="match_parent"
160-
android:layout_weight="1" />
161172

162-
<Space
163-
android:layout_width="0dp"
164-
android:layout_height="match_parent"
165-
android:layout_weight="1" />
173+
</LinearLayout>
166174

175+
<View
176+
android:id="@+id/shadowView"
177+
android:layout_width="match_parent"
178+
android:layout_height="0.5dp"
179+
android:background="?attr/daxColorShadeSolid"
180+
app:layout_constraintEnd_toEndOf="parent"
181+
app:layout_constraintStart_toStartOf="parent"
182+
app:layout_constraintTop_toTopOf="parent" />
167183

168-
</LinearLayout>
184+
</androidx.constraintlayout.widget.ConstraintLayout>

0 commit comments

Comments
 (0)