mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Improved toast layout
This commit is contained in:
parent
8882cd9558
commit
8b446e2de0
4 changed files with 21 additions and 20 deletions
|
|
@ -127,8 +127,8 @@ class ContactFragment : GenericFragment() {
|
|||
val label = if (isSip) "SIP address" else "Phone number"
|
||||
clipboard.setPrimaryClip(ClipData.newPlainText(label, value))
|
||||
|
||||
binding.greenToast.message.text = "Numéro copié dans le presse-papier"
|
||||
binding.greenToast.icon.setImageResource(R.drawable.check)
|
||||
binding.greenToast.message = "Numéro copié dans le presse-papier"
|
||||
binding.greenToast.icon = R.drawable.check
|
||||
|
||||
val target = binding.greenToast.root
|
||||
target.slideInToastFromTopForDuration(binding.root as ViewGroup, lifecycleScope)
|
||||
|
|
|
|||
|
|
@ -95,8 +95,9 @@ class ActiveCallFragment : GenericFragment() {
|
|||
|
||||
callViewModel.isRemoteDeviceTrusted.observe(viewLifecycleOwner) { trusted ->
|
||||
if (trusted) {
|
||||
binding.blueToast.message.text = "This call can be trusted"
|
||||
binding.blueToast.icon.setImageResource(R.drawable.trusted)
|
||||
binding.blueToast.message = "This call can be trusted"
|
||||
binding.blueToast.icon = R.drawable.trusted
|
||||
|
||||
binding.blueToast.root.slideInToastFromTop(binding.root as ViewGroup, true)
|
||||
} else if (binding.blueToast.root.visibility == View.VISIBLE) {
|
||||
binding.blueToast.root.slideInToastFromTop(binding.root as ViewGroup, false)
|
||||
|
|
|
|||
|
|
@ -25,25 +25,25 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:src="@drawable/shape_toast_blue_shadow"
|
||||
app:layout_constraintBottom_toBottomOf="@id/message"
|
||||
app:layout_constraintEnd_toEndOf="@id/message"
|
||||
app:layout_constraintStart_toStartOf="@id/icon"
|
||||
app:layout_constraintTop_toTopOf="@id/message" />
|
||||
app:layout_constraintBottom_toBottomOf="@id/toast_message"
|
||||
app:layout_constraintEnd_toEndOf="@id/toast_message"
|
||||
app:layout_constraintStart_toStartOf="@id/toast_icon"
|
||||
app:layout_constraintTop_toTopOf="@id/toast_message" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
android:id="@+id/toast_icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@{icon, default=@drawable/trusted}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/message"
|
||||
app:layout_constraintEnd_toStartOf="@id/toast_message"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintHorizontal_chainStyle="packed" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/message"
|
||||
android:id="@+id/toast_message"
|
||||
style="@style/default_text_style"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
android:textColor="@color/trusted_blue"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/icon"
|
||||
app:layout_constraintStart_toEndOf="@id/toast_icon"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
|
|||
|
|
@ -25,26 +25,26 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:src="@drawable/shape_toast_green_shadow"
|
||||
app:layout_constraintBottom_toBottomOf="@id/message"
|
||||
app:layout_constraintEnd_toEndOf="@id/message"
|
||||
app:layout_constraintStart_toStartOf="@id/icon"
|
||||
app:layout_constraintTop_toTopOf="@id/message" />
|
||||
app:layout_constraintBottom_toBottomOf="@id/toast_message"
|
||||
app:layout_constraintEnd_toEndOf="@id/toast_message"
|
||||
app:layout_constraintStart_toStartOf="@id/toast_icon"
|
||||
app:layout_constraintTop_toTopOf="@id/toast_message" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
android:id="@+id/toast_icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@{icon, default=@drawable/check}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/message"
|
||||
app:layout_constraintEnd_toStartOf="@id/toast_message"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:tint="@color/green_online" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/message"
|
||||
android:id="@+id/toast_message"
|
||||
style="@style/default_text_style"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/icon"
|
||||
app:layout_constraintStart_toEndOf="@id/toast_icon"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue