For #141 - Cleans up search UI
parent
f78b62751d
commit
ebb5da7f4e
|
@ -41,19 +41,10 @@ class HomeFragment : Fragment() {
|
||||||
toolbar.setCompoundDrawablesWithIntrinsicBounds(searchIcon, null, null, null)
|
toolbar.setCompoundDrawablesWithIntrinsicBounds(searchIcon, null, null, null)
|
||||||
toolbar.compoundDrawablePadding = (12f * Resources.getSystem().displayMetrics.density).roundToInt()
|
toolbar.compoundDrawablePadding = (12f * Resources.getSystem().displayMetrics.density).roundToInt()
|
||||||
toolbar.setOnClickListener { it ->
|
toolbar.setOnClickListener { it ->
|
||||||
val extras = FragmentNavigator.Extras.Builder().addSharedElement(
|
Navigation.findNavController(it).navigate(R.id.action_homeFragment_to_searchFragment, null, null)
|
||||||
toolbar, ViewCompat.getTransitionName(toolbar)!!
|
|
||||||
).build()
|
|
||||||
Navigation.findNavController(it).navigate(R.id.action_homeFragment_to_searchFragment, null, null, extras)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SessionsComponent(homeLayout, ActionBusFactory.get(this)).setup()
|
SessionsComponent(homeLayout, ActionBusFactory.get(this)).setup()
|
||||||
layoutComponents(homeLayout)
|
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)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,11 +31,6 @@ class SearchFragment : Fragment() {
|
||||||
return inflater.inflate(R.layout.fragment_search, container, false)
|
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() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
toolbar.editMode()
|
toolbar.editMode()
|
||||||
|
@ -50,7 +45,7 @@ class SearchFragment : Fragment() {
|
||||||
toolbar,
|
toolbar,
|
||||||
ShippedDomainsProvider().also { it.initialize(requireContext()) },
|
ShippedDomainsProvider().also { it.initialize(requireContext()) },
|
||||||
requireComponents.core.historyStorage
|
requireComponents.core.historyStorage
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
awesomeBarFeature = AwesomeBarFeature(awesomeBar, toolbar, null, onEditComplete = ::userDidSearch)
|
awesomeBarFeature = AwesomeBarFeature(awesomeBar, toolbar, null, onEditComplete = ::userDidSearch)
|
||||||
|
@ -74,9 +69,6 @@ class SearchFragment : Fragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun userDidSearch() {
|
private fun userDidSearch() {
|
||||||
val extras = FragmentNavigator.Extras.Builder().addSharedElement(
|
Navigation.findNavController(toolbar).navigate(R.id.action_searchFragment_to_browserFragment, null, null)
|
||||||
toolbar, ViewCompat.getTransitionName(toolbar)!!
|
|
||||||
).build()
|
|
||||||
Navigation.findNavController(toolbar).navigate(R.id.action_searchFragment_to_browserFragment, null, null, extras)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,8 +67,7 @@
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:text="@string/search_hint"
|
android:text="@string/search_hint"
|
||||||
android:textColor="@color/searchText"
|
android:textColor="@color/searchText"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp" />
|
||||||
android:transitionName="firstTransitionName"/>
|
|
||||||
</org.mozilla.fenix.home.SearchView>
|
</org.mozilla.fenix.home.SearchView>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
|
|
@ -14,12 +14,10 @@
|
||||||
android:id="@+id/toolbar_wrapper"
|
android:id="@+id/toolbar_wrapper"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:layout_marginTop="24dp"
|
android:layout_marginTop="24dp"
|
||||||
android:layout_marginRight="16dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:background="@drawable/home_search_background_light"
|
android:background="@drawable/home_search_background_dark_no_border"
|
||||||
android:clipToPadding="false"
|
|
||||||
android:elevation="5dp"
|
|
||||||
android:outlineProvider="paddedBounds"
|
android:outlineProvider="paddedBounds"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
@ -30,11 +28,9 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:layout_margin="8dp"
|
android:layout_margin="8dp"
|
||||||
android:background="@android:color/white"
|
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:focusableInTouchMode="true"
|
android:focusableInTouchMode="true" />
|
||||||
android:transitionName="firstTransitionName" />
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<mozilla.components.browser.awesomebar.BrowserAwesomeBar
|
<mozilla.components.browser.awesomebar.BrowserAwesomeBar
|
||||||
|
|
Loading…
Reference in New Issue