mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Added an option to copy conversation participant SIP URI from menu
This commit is contained in:
parent
af4ff25310
commit
3167544873
2 changed files with 37 additions and 1 deletions
|
|
@ -413,6 +413,18 @@ class ConversationInfoFragment : SlidingPaneChildFragment() {
|
|||
popupWindow.dismiss()
|
||||
}
|
||||
|
||||
popupView.setCopySipUriClickListener {
|
||||
val sipUri = participantModel.sipUri
|
||||
val clipboard = requireContext().getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||
clipboard.setPrimaryClip(ClipData.newPlainText("SIP address", sipUri))
|
||||
|
||||
val message = getString(R.string.sip_address_copied_to_clipboard_toast)
|
||||
(requireActivity() as GenericActivity).showGreenToast(
|
||||
message,
|
||||
R.drawable.check
|
||||
)
|
||||
}
|
||||
|
||||
// Elevation is for showing a shadow around the popup
|
||||
popupWindow.elevation = 20f
|
||||
popupWindow.showAsDropDown(view, 0, 0, Gravity.BOTTOM)
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@
|
|||
<variable
|
||||
name="unsetAdminClickListener"
|
||||
type="View.OnClickListener" />
|
||||
<variable
|
||||
name="copySipUriClickListener"
|
||||
type="View.OnClickListener" />
|
||||
<variable
|
||||
name="isParticipantContact"
|
||||
type="Boolean" />
|
||||
|
|
@ -124,6 +127,27 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/set_admin"
|
||||
app:layout_constraintBottom_toTopOf="@id/copy_sip_uri"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:id="@+id/copy_sip_uri"
|
||||
android:onClick="@{copySipUriClickListener}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/popup_menu_item_top_margin"
|
||||
android:text="@string/menu_copy_sip_address"
|
||||
android:textSize="14sp"
|
||||
android:textColor="?attr/color_main2_500"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:drawableStart="@drawable/copy"
|
||||
android:drawablePadding="5dp"
|
||||
app:drawableTint="?attr/color_main2_700"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/unset_admin"
|
||||
app:layout_constraintBottom_toTopOf="@id/separator"/>
|
||||
|
||||
<View
|
||||
|
|
@ -135,7 +159,7 @@
|
|||
android:visibility="@{isMeAdmin ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/unset_admin"
|
||||
app:layout_constraintTop_toBottomOf="@id/copy_sip_uri"
|
||||
app:layout_constraintBottom_toTopOf="@id/remove_participant" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue