Add animations to key transparency.

This commit is contained in:
Michelle Tang
2026-02-02 15:00:07 -05:00
parent 7e27203bd8
commit b9dc2d3969
2 changed files with 58 additions and 36 deletions

View File

@@ -92,7 +92,7 @@ class VerifyDisplayFragment : Fragment() {
} else { } else {
binding.autoVerifyContainer.setOnClickListener(null) binding.autoVerifyContainer.setOnClickListener(null)
} }
updateStatus(status) animateStatus(status)
} }
viewModel.recipient.observe(this) { recipient: Recipient -> setRecipientText(recipient) } viewModel.recipient.observe(this) { recipient: Recipient -> setRecipientText(recipient) }
@@ -118,6 +118,21 @@ class VerifyDisplayFragment : Fragment() {
} }
} }
private fun animateStatus(status: AutomaticVerificationStatus) {
binding.autoVerifyContainer.animate()
.alpha(0f)
.setDuration(FADE_TIME)
.withEndAction {
updateStatus(status)
binding.autoVerifyContainer.animate()
.alpha(1f)
.setDuration(FADE_TIME)
.start()
}
.start()
}
private fun updateStatus(status: AutomaticVerificationStatus) { private fun updateStatus(status: AutomaticVerificationStatus) {
when (status) { when (status) {
AutomaticVerificationStatus.NONE -> { AutomaticVerificationStatus.NONE -> {
@@ -333,6 +348,7 @@ class VerifyDisplayFragment : Fragment() {
private const val LOCAL_IDENTITY = "local_identity" private const val LOCAL_IDENTITY = "local_identity"
private const val LOCAL_NUMBER = "local_number" private const val LOCAL_NUMBER = "local_number"
private const val VERIFIED_STATE = "verified_state" private const val VERIFIED_STATE = "verified_state"
private const val FADE_TIME = 250L
fun create( fun create(
recipientId: RecipientId, recipientId: RecipientId,

View File

@@ -72,14 +72,18 @@
android:layout_marginVertical="12dp" android:layout_marginVertical="12dp"
android:text="@string/verify_display_fragment__automatic" /> android:text="@string/verify_display_fragment__automatic" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20dp"
android:background="@drawable/rounded_rectangle_38"
android:backgroundTint="@color/signal_colorSurface1" >
<LinearLayout <LinearLayout
android:id="@+id/auto_verify_container" android:id="@+id/auto_verify_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/rounded_rectangle_38"
android:backgroundTint="@color/signal_colorSurface1"
android:paddingVertical="16dp" android:paddingVertical="16dp"
android:paddingHorizontal="20dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:layout_marginHorizontal="16dp" android:layout_marginHorizontal="16dp"
android:orientation="horizontal"> android:orientation="horizontal">
@@ -116,6 +120,8 @@
</LinearLayout> </LinearLayout>
</FrameLayout>
<org.thoughtcrime.securesms.util.views.LearnMoreTextView <org.thoughtcrime.securesms.util.views.LearnMoreTextView
android:id="@+id/caption" android:id="@+id/caption"
android:layout_width="match_parent" android:layout_width="match_parent"