1
0
Fork 0

For #141 - Cleans up search UI

master
Jeff Boek 2019-01-29 16:55:37 -08:00 committed by Colin Lee
parent f78b62751d
commit ebb5da7f4e
4 changed files with 8 additions and 30 deletions

View File

@ -41,19 +41,10 @@ class HomeFragment : Fragment() {
toolbar.setCompoundDrawablesWithIntrinsicBounds(searchIcon, null, null, null)
toolbar.compoundDrawablePadding = (12f * Resources.getSystem().displayMetrics.density).roundToInt()
toolbar.setOnClickListener { it ->
val extras = FragmentNavigator.Extras.Builder().addSharedElement(
toolbar, ViewCompat.getTransitionName(toolbar)!!
).build()
Navigation.findNavController(it).navigate(R.id.action_homeFragment_to_searchFragment, null, null, extras)
Navigation.findNavController(it).navigate(R.id.action_homeFragment_to_searchFragment, null, null)
}
SessionsComponent(homeLayout, ActionBusFactory.get(this)).setup()
layoutComponents(homeLayout)
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enterTransition = TransitionInflater.from(context).inflateTransition(android.R.transition.fade)
exitTransition = TransitionInflater.from(context).inflateTransition(android.R.transition.fade)
}
}

View File

@ -31,11 +31,6 @@ class SearchFragment : Fragment() {
return inflater.inflate(R.layout.fragment_search, container, false)
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
sharedElementEnterTransition = TransitionInflater.from(context).inflateTransition(android.R.transition.move)
}
override fun onResume() {
super.onResume()
toolbar.editMode()
@ -50,7 +45,7 @@ class SearchFragment : Fragment() {
toolbar,
ShippedDomainsProvider().also { it.initialize(requireContext()) },
requireComponents.core.historyStorage
)
)
)
awesomeBarFeature = AwesomeBarFeature(awesomeBar, toolbar, null, onEditComplete = ::userDidSearch)
@ -74,9 +69,6 @@ class SearchFragment : Fragment() {
}
private fun userDidSearch() {
val extras = FragmentNavigator.Extras.Builder().addSharedElement(
toolbar, ViewCompat.getTransitionName(toolbar)!!
).build()
Navigation.findNavController(toolbar).navigate(R.id.action_searchFragment_to_browserFragment, null, null, extras)
Navigation.findNavController(toolbar).navigate(R.id.action_searchFragment_to_browserFragment, null, null)
}
}

View File

@ -67,8 +67,7 @@
android:gravity="center_vertical"
android:text="@string/search_hint"
android:textColor="@color/searchText"
android:textSize="14sp"
android:transitionName="firstTransitionName"/>
android:textSize="14sp" />
</org.mozilla.fenix.home.SearchView>
<androidx.recyclerview.widget.RecyclerView

View File

@ -14,12 +14,10 @@
android:id="@+id/toolbar_wrapper"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:layout_marginRight="16dp"
android:background="@drawable/home_search_background_light"
android:clipToPadding="false"
android:elevation="5dp"
android:layout_marginEnd="16dp"
android:background="@drawable/home_search_background_dark_no_border"
android:outlineProvider="paddedBounds"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@ -30,11 +28,9 @@
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_margin="8dp"
android:background="@android:color/white"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:transitionName="firstTransitionName" />
android:focusableInTouchMode="true" />
</FrameLayout>
<mozilla.components.browser.awesomebar.BrowserAwesomeBar