For #561 - Adds add tab and menu button to bottom bar
- Adds space between wordmark and session control componentmaster
parent
abbb310ce3
commit
b16754d78a
|
@ -192,10 +192,10 @@ class HomeFragment : Fragment() {
|
||||||
view.homeLayout.applyConstraintSet {
|
view.homeLayout.applyConstraintSet {
|
||||||
sessionControlComponent.view {
|
sessionControlComponent.view {
|
||||||
connect(
|
connect(
|
||||||
TOP to BOTTOM of view.wordmark,
|
TOP to BOTTOM of view.wordmark_spacer,
|
||||||
START to START of PARENT_ID,
|
START to START of PARENT_ID,
|
||||||
END to END of PARENT_ID,
|
END to END of PARENT_ID,
|
||||||
BOTTOM to BOTTOM of PARENT_ID
|
BOTTOM to TOP of view.bottom_bar
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -235,33 +235,32 @@ class HomeFragment : Fragment() {
|
||||||
searchIcon.setBounds(0, 0, iconSize, iconSize)
|
searchIcon.setBounds(0, 0, iconSize, iconSize)
|
||||||
|
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
// TODO: FIXME
|
search_engine_icon?.setImageDrawable(searchIcon)
|
||||||
// search_engine_icon?.setImageDrawable(searchIcon)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// view.menuButton.setOnClickListener {
|
view.menuButton.setOnClickListener {
|
||||||
// homeMenu?.menuBuilder?.build(requireContext())?.show(
|
homeMenu?.menuBuilder?.build(requireContext())?.show(
|
||||||
// anchor = it,
|
anchor = it,
|
||||||
// orientation = BrowserMenu.Orientation.DOWN
|
orientation = BrowserMenu.Orientation.DOWN
|
||||||
// )
|
)
|
||||||
// }
|
}
|
||||||
// view.toolbar.compoundDrawablePadding =
|
view.toolbar.compoundDrawablePadding =
|
||||||
view.resources.getDimensionPixelSize(R.dimen.search_bar_search_engine_icon_padding)
|
view.resources.getDimensionPixelSize(R.dimen.search_bar_search_engine_icon_padding)
|
||||||
// view.toolbar_wrapper.setOnClickListener {
|
view.toolbar_wrapper.setOnClickListener {
|
||||||
// invokePendingDeleteJobs()
|
invokePendingDeleteJobs()
|
||||||
// onboarding.finish()
|
onboarding.finish()
|
||||||
// val directions = HomeFragmentDirections.actionHomeFragmentToSearchFragment(
|
val directions = HomeFragmentDirections.actionHomeFragmentToSearchFragment(
|
||||||
// sessionId = null,
|
sessionId = null,
|
||||||
// showShortcutEnginePicker = true
|
showShortcutEnginePicker = true
|
||||||
// )
|
)
|
||||||
// val extras =
|
val extras =
|
||||||
// FragmentNavigator.Extras.Builder()
|
FragmentNavigator.Extras.Builder()
|
||||||
// .addSharedElement(toolbar_wrapper, "toolbar_wrapper_transition")
|
.addSharedElement(toolbar_wrapper, "toolbar_wrapper_transition")
|
||||||
// .build()
|
.build()
|
||||||
// nav(R.id.homeFragment, directions, extras)
|
nav(R.id.homeFragment, directions, extras)
|
||||||
// requireComponents.analytics.metrics.track(Event.SearchBarTapped(Event.SearchBarTapped.Source.HOME))
|
requireComponents.analytics.metrics.track(Event.SearchBarTapped(Event.SearchBarTapped.Source.HOME))
|
||||||
// }
|
}
|
||||||
|
|
||||||
PrivateBrowsingButtonView(
|
PrivateBrowsingButtonView(
|
||||||
privateBrowsingButton,
|
privateBrowsingButton,
|
||||||
|
|
|
@ -41,12 +41,6 @@ class TabHeaderViewHolder(
|
||||||
}
|
}
|
||||||
|
|
||||||
view.apply {
|
view.apply {
|
||||||
add_tab_button.run {
|
|
||||||
setOnClickListener {
|
|
||||||
actionEmitter.onNext(TabAction.Add)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
share_tabs_button.run {
|
share_tabs_button.run {
|
||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
actionEmitter.onNext(TabAction.ShareTabs)
|
actionEmitter.onNext(TabAction.ShareTabs)
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -33,6 +34,7 @@
|
||||||
android:layout_height="80dp"
|
android:layout_height="80dp"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:layout_marginTop="60dp"
|
android:layout_marginTop="60dp"
|
||||||
|
android:layout_marginBottom="32dp"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:clickable="false"
|
android:clickable="false"
|
||||||
android:contentDescription="@string/app_name"
|
android:contentDescription="@string/app_name"
|
||||||
|
@ -42,5 +44,93 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/wordmark_spacer"
|
||||||
|
android:layout_marginTop="32dp"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/wordmark"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="parent" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/bottom_bar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:background="?homeBackground"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
|
|
||||||
|
<org.mozilla.fenix.home.SearchView
|
||||||
|
android:id="@+id/toolbar_wrapper"
|
||||||
|
android:transitionName="toolbar_wrapper_transition"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:background="@drawable/home_search_background_normal"
|
||||||
|
android:clickable="true"
|
||||||
|
android:contentDescription="@string/search_hint"
|
||||||
|
android:focusable="true"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/add_tab_button"
|
||||||
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/search_engine_icon"
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:layout_margin="12dp"
|
||||||
|
android:clickable="false"
|
||||||
|
android:focusable="false"
|
||||||
|
android:importantForAccessibility="no" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="47dp"
|
||||||
|
android:clickable="false"
|
||||||
|
android:focusable="false"
|
||||||
|
android:importantForAccessibility="no"
|
||||||
|
android:paddingStart="12dp"
|
||||||
|
android:paddingEnd="12dp"
|
||||||
|
android:text="@string/search_hint"
|
||||||
|
android:textColor="?primaryText"
|
||||||
|
android:textSize="15sp" />
|
||||||
|
</org.mozilla.fenix.home.SearchView>
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/add_tab_button"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
|
android:contentDescription="@string/add_tab"
|
||||||
|
android:src="@drawable/ic_new"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/menuButton"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/toolbar_wrapper"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/menuButton"
|
||||||
|
android:layout_width="@dimen/glyph_button_height"
|
||||||
|
android:layout_height="@dimen/glyph_button_height"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
|
android:contentDescription="@string/content_description_menu"
|
||||||
|
android:src="@drawable/ic_menu"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.motion.widget.MotionLayout>
|
</androidx.constraintlayout.motion.widget.MotionLayout>
|
||||||
|
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
@ -18,22 +18,10 @@
|
||||||
android:text="@string/tab_header_label"
|
android:text="@string/tab_header_label"
|
||||||
android:textAppearance="@style/HeaderTextStyle"
|
android:textAppearance="@style/HeaderTextStyle"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@id/add_tab_button"
|
app:layout_constraintEnd_toStartOf="@id/share_tabs_button"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/add_tab_button"
|
|
||||||
android:layout_width="48dp"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
|
||||||
android:contentDescription="@string/add_tab"
|
|
||||||
android:src="@drawable/ic_new"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/share_tabs_button"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/header_text"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/share_tabs_button"
|
android:id="@+id/share_tabs_button"
|
||||||
android:layout_width="48dp"
|
android:layout_width="48dp"
|
||||||
|
@ -43,7 +31,7 @@
|
||||||
android:src="@drawable/ic_hollow_share"
|
android:src="@drawable/ic_hollow_share"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/close_tabs_button"
|
app:layout_constraintEnd_toStartOf="@+id/close_tabs_button"
|
||||||
app:layout_constraintStart_toEndOf="@+id/add_tab_button"
|
app:layout_constraintStart_toEndOf="@+id/header_text"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
<Constraint
|
<Constraint
|
||||||
android:id="@+id/wordmark"
|
android:id="@+id/wordmark"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginBottom="32dp"
|
||||||
android:alpha="0"
|
android:alpha="0"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="80dp"
|
android:layout_height="80dp"
|
||||||
|
|
Loading…
Reference in New Issue