From d44abbcf9348bf6d49b72b2a78f84c3f4bf010ec Mon Sep 17 00:00:00 2001 From: Jeff Boek Date: Fri, 20 Sep 2019 11:33:00 -0700 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/561 - Removes the toolbar from the home screen - Removes the menu button - Fixes motionlayout animation with the wordmark/private browsing button --- .../org/mozilla/fenix/home/HomeFragment.kt | 50 ++++---- app/src/main/res/layout/fragment_home.xml | 84 +------------ app/src/main/res/xml/home_scene.xml | 119 +----------------- 3 files changed, 35 insertions(+), 218 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt b/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt index 44944bff9c..2c7ee9203a 100644 --- a/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt @@ -192,7 +192,7 @@ class HomeFragment : Fragment() { view.homeLayout.applyConstraintSet { sessionControlComponent.view { connect( - TOP to BOTTOM of view.homeDivider, + TOP to BOTTOM of view.wordmark, START to START of PARENT_ID, END to END of PARENT_ID, BOTTOM to BOTTOM of PARENT_ID @@ -235,32 +235,33 @@ class HomeFragment : Fragment() { searchIcon.setBounds(0, 0, iconSize, iconSize) withContext(Dispatchers.Main) { - search_engine_icon?.setImageDrawable(searchIcon) + // TODO: FIXME +// search_engine_icon?.setImageDrawable(searchIcon) } } - view.menuButton.setOnClickListener { - homeMenu?.menuBuilder?.build(requireContext())?.show( - anchor = it, - orientation = BrowserMenu.Orientation.DOWN - ) - } - view.toolbar.compoundDrawablePadding = +// view.menuButton.setOnClickListener { +// homeMenu?.menuBuilder?.build(requireContext())?.show( +// anchor = it, +// orientation = BrowserMenu.Orientation.DOWN +// ) +// } +// view.toolbar.compoundDrawablePadding = view.resources.getDimensionPixelSize(R.dimen.search_bar_search_engine_icon_padding) - view.toolbar_wrapper.setOnClickListener { - invokePendingDeleteJobs() - onboarding.finish() - val directions = HomeFragmentDirections.actionHomeFragmentToSearchFragment( - sessionId = null, - showShortcutEnginePicker = true - ) - val extras = - FragmentNavigator.Extras.Builder() - .addSharedElement(toolbar_wrapper, "toolbar_wrapper_transition") - .build() - nav(R.id.homeFragment, directions, extras) - requireComponents.analytics.metrics.track(Event.SearchBarTapped(Event.SearchBarTapped.Source.HOME)) - } +// view.toolbar_wrapper.setOnClickListener { +// invokePendingDeleteJobs() +// onboarding.finish() +// val directions = HomeFragmentDirections.actionHomeFragmentToSearchFragment( +// sessionId = null, +// showShortcutEnginePicker = true +// ) +// val extras = +// FragmentNavigator.Extras.Builder() +// .addSharedElement(toolbar_wrapper, "toolbar_wrapper_transition") +// .build() +// nav(R.id.homeFragment, directions, extras) +// requireComponents.analytics.metrics.track(Event.SearchBarTapped(Event.SearchBarTapped.Source.HOME)) +// } PrivateBrowsingButtonView( privateBrowsingButton, @@ -278,9 +279,6 @@ class HomeFragment : Fragment() { ) } } - - // We need the shadow to be above the components. - homeDividerShadow.bringToFront() } override fun onDestroyView() { diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 15f0e57b5c..d8f02d9e15 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -16,33 +16,23 @@ app:layoutDescription="@xml/home_scene" tools:context=".home.HomeFragment"> - - + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - - - - - - - - - - - + app:layout_constraintTop_toTopOf="parent" /> \ No newline at end of file diff --git a/app/src/main/res/xml/home_scene.xml b/app/src/main/res/xml/home_scene.xml index 268eaa21f1..3f99db7e4d 100644 --- a/app/src/main/res/xml/home_scene.xml +++ b/app/src/main/res/xml/home_scene.xml @@ -16,79 +16,14 @@ motion:onTouchUp="stop"/> - - - - - - - - - - - - - - - - - - - - @@ -99,64 +34,22 @@ - - - - + motion:layout_constraintBottom_toTopOf="parent" /> - - - - + android:layout_height="@dimen/glyph_button_height" + android:layout_marginEnd="12dp" + android:translationY="-32dp" + motion:layout_constraintEnd_toEndOf="parent" + motion:layout_constraintTop_toTopOf="parent"/>