1
0
Fork 0

Closes #1618 - Add fade to awesome bar list instead of shadow (#3110)

* Closes #1618 - Add fade to awesome bar list instead of shadow

* For #1211 - Hide keyboard on fling suggestions list
master
Emily Kager 2019-06-04 08:35:47 -07:00 committed by Colin Lee
parent 5fb100debd
commit ca186c8776
3 changed files with 24 additions and 3 deletions

View File

@ -8,6 +8,7 @@ import android.graphics.PorterDuff
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import io.reactivex.Observable
import io.reactivex.Observer
import io.reactivex.functions.Consumer
@ -21,6 +22,7 @@ import mozilla.components.feature.awesomebar.provider.SessionSuggestionProvider
import mozilla.components.feature.search.SearchUseCases
import mozilla.components.feature.session.SessionUseCases
import mozilla.components.support.ktx.android.graphics.drawable.toBitmap
import mozilla.components.support.ktx.android.view.hideKeyboard
import org.mozilla.fenix.R
import org.mozilla.fenix.ThemeManager
import org.mozilla.fenix.ext.components
@ -156,6 +158,15 @@ class AwesomeBarUIView(
)
shortcutEngineManager.shortcutsEnginePickerProvider = shortcutsEnginePickerProvider
val listener = object : RecyclerView.OnFlingListener() {
override fun onFling(velocityX: Int, velocityY: Int): Boolean {
view.hideKeyboard()
return false
}
}
view.onFlingListener = listener
}
}

View File

@ -8,8 +8,10 @@
android:id="@+id/awesomeBar"
android:layout_width="0dp"
android:layout_height="0dp"
android:padding="4dp"
app:layout_constraintBottom_toTopOf="@id/pill_wrapper"
android:fadingEdge="horizontal"
android:fadingEdgeLength="40dp"
android:requiresFadingEdge="vertical"
app:layout_constraintBottom_toTopOf="@id/search_divider"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbar_wrapper"

View File

@ -60,12 +60,20 @@
app:layout_constraintStart_toStartOf="@id/toolbar_wrapper"
app:layout_constraintTop_toBottomOf="@id/toolbar_wrapper" />
<View
android:id="@+id/search_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?neutralFaded"
app:layout_constraintBottom_toTopOf="@id/pill_wrapper"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<LinearLayout
android:id="@+id/pill_wrapper"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="?foundation"
android:elevation="10dp"
android:orientation="horizontal"
android:paddingStart="20dp"
android:paddingTop="4dp"