Fix bottom bar color in group story selector.

fork-5.53.8
Greyson Parrelli 2022-10-07 11:51:05 -04:00
rodzic 04b0c01015
commit be98ff3508
2 zmienionych plików z 50 dodań i 45 usunięć

Wyświetl plik

@ -32,10 +32,9 @@ class ChooseGroupStoryBottomSheet : FixedRoundedCornerBottomSheetDialogFragment(
const val RESULT_SET = "groups" const val RESULT_SET = "groups"
} }
private lateinit var confirmButton: View
private lateinit var selectedList: RecyclerView
private lateinit var divider: View private lateinit var divider: View
private lateinit var mediator: ContactSearchMediator private lateinit var mediator: ContactSearchMediator
private lateinit var innerContainer: View
private var animatorSet: AnimatorSet? = null private var animatorSet: AnimatorSet? = null
@ -49,13 +48,14 @@ class ChooseGroupStoryBottomSheet : FixedRoundedCornerBottomSheetDialogFragment(
val container = view.parent.parent.parent as FrameLayout val container = view.parent.parent.parent as FrameLayout
val bottomBar = LayoutInflater.from(requireContext()).inflate(R.layout.stories_choose_group_bottom_bar, container, true) val bottomBar = LayoutInflater.from(requireContext()).inflate(R.layout.stories_choose_group_bottom_bar, container, true)
confirmButton = bottomBar.findViewById(R.id.share_confirm) innerContainer = bottomBar.findViewById(R.id.inner_container)
selectedList = bottomBar.findViewById(R.id.selected_list)
divider = bottomBar.findViewById(R.id.divider) divider = bottomBar.findViewById(R.id.divider)
val adapter = ShareSelectionAdapter() val adapter = ShareSelectionAdapter()
val selectedList: RecyclerView = bottomBar.findViewById(R.id.selected_list)
selectedList.adapter = adapter selectedList.adapter = adapter
val confirmButton: View = bottomBar.findViewById(R.id.share_confirm)
confirmButton.setOnClickListener { confirmButton.setOnClickListener {
onDone() onDone()
} }
@ -116,8 +116,7 @@ class ChooseGroupStoryBottomSheet : FixedRoundedCornerBottomSheetDialogFragment(
animatorSet?.cancel() animatorSet?.cancel()
animatorSet = AnimatorSet().apply { animatorSet = AnimatorSet().apply {
playTogether( playTogether(
ObjectAnimator.ofFloat(confirmButton, View.TRANSLATION_Y, 0f), ObjectAnimator.ofFloat(innerContainer, View.TRANSLATION_Y, 0f),
ObjectAnimator.ofFloat(selectedList, View.TRANSLATION_Y, 0f),
ObjectAnimator.ofFloat(divider, View.TRANSLATION_Y, 0f) ObjectAnimator.ofFloat(divider, View.TRANSLATION_Y, 0f)
) )
start() start()
@ -125,13 +124,12 @@ class ChooseGroupStoryBottomSheet : FixedRoundedCornerBottomSheetDialogFragment(
} }
private fun animateOutBottomBar() { private fun animateOutBottomBar() {
val translationY = DimensionUnit.SP.toPixels(64f) val translationY = DimensionUnit.SP.toPixels(68f)
animatorSet?.cancel() animatorSet?.cancel()
animatorSet = AnimatorSet().apply { animatorSet = AnimatorSet().apply {
playTogether( playTogether(
ObjectAnimator.ofFloat(confirmButton, View.TRANSLATION_Y, translationY), ObjectAnimator.ofFloat(innerContainer, View.TRANSLATION_Y, translationY),
ObjectAnimator.ofFloat(selectedList, View.TRANSLATION_Y, translationY),
ObjectAnimator.ofFloat(divider, View.TRANSLATION_Y, translationY) ObjectAnimator.ofFloat(divider, View.TRANSLATION_Y, translationY)
) )
start() start()

Wyświetl plik

@ -1,53 +1,60 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout
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"
tools:viewBindingIgnore="true" tools:viewBindingIgnore="true"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom"> android:layout_gravity="bottom"
android:orientation="vertical">
<View <View
android:id="@+id/divider" android:id="@+id/divider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="4dp" android:layout_height="4dp"
android:background="@drawable/bottom_toolbar_shadow" android:background="@drawable/bottom_toolbar_shadow"
android:translationY="64sp"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/inner_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:translationY="68sp"
android:background="@color/signal_colorSurface1">
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/selected_list" android:id="@+id/selected_list"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="44dp" android:layout_height="44dp"
android:layout_marginEnd="@dimen/dsl_settings_gutter" android:layout_marginEnd="@dimen/dsl_settings_gutter"
android:clipToPadding="false" android:clipToPadding="false"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingStart="@dimen/dsl_settings_gutter" android:paddingStart="@dimen/dsl_settings_gutter"
android:paddingEnd="78dp" android:paddingEnd="78dp"
android:translationY="64sp" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintTop_toBottomOf="@id/divider" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toBottomOf="parent" tools:listitem="@layout/share_contact_selection_item" />
tools:listitem="@layout/share_contact_selection_item" />
<ImageView <ImageView
android:id="@+id/share_confirm" android:id="@+id/share_confirm"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_margin="16dp" android:layout_margin="16dp"
android:contentDescription="@string/ShareActivity__share" android:contentDescription="@string/ShareActivity__share"
android:background="@drawable/circle_tintable" android:background="@drawable/circle_tintable"
android:padding="6dp" android:padding="6dp"
android:translationY="64sp" app:backgroundTint="@color/signal_colorPrimary"
app:backgroundTint="@color/signal_colorPrimary" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toBottomOf="parent" app:srcCompat="@drawable/ic_check_24"
app:srcCompat="@drawable/ic_check_24" app:tint="@color/signal_colorOnPrimary"
app:tint="@color/signal_colorOnPrimary" tools:alpha="1" />
tools:alpha="1" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>