mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Fixed dark mode issue with participants list in conference + added menu to share meeting link
This commit is contained in:
parent
d4b0356bda
commit
372a16d3ab
3 changed files with 124 additions and 1 deletions
|
|
@ -19,12 +19,18 @@
|
|||
*/
|
||||
package org.linphone.ui.call.conference.fragment
|
||||
|
||||
import android.content.ClipData
|
||||
import android.content.ClipboardManager
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.animation.Animation
|
||||
import android.view.animation.AnimationUtils
|
||||
import android.widget.PopupWindow
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
|
|
@ -32,6 +38,7 @@ import org.linphone.R
|
|||
import org.linphone.core.Participant
|
||||
import org.linphone.core.tools.Log
|
||||
import org.linphone.databinding.CallConferenceParticipantsListFragmentBinding
|
||||
import org.linphone.databinding.CallConferenceParticipantsListPopupMenuBinding
|
||||
import org.linphone.ui.GenericActivity
|
||||
import org.linphone.ui.call.adapter.ConferenceParticipantsListAdapter
|
||||
import org.linphone.ui.call.fragment.GenericCallFragment
|
||||
|
|
@ -100,6 +107,10 @@ class ConferenceParticipantsListFragment : GenericCallFragment() {
|
|||
}
|
||||
}
|
||||
|
||||
binding.setShowMenuClickListener {
|
||||
showPopupMenu(binding.showMenu)
|
||||
}
|
||||
|
||||
viewModel.conferenceModel.participants.observe(viewLifecycleOwner) {
|
||||
Log.i("$TAG participants list updated with [${it.size}] items")
|
||||
adapter.submitList(it)
|
||||
|
|
@ -146,4 +157,37 @@ class ConferenceParticipantsListFragment : GenericCallFragment() {
|
|||
|
||||
dialog.show()
|
||||
}
|
||||
|
||||
private fun showPopupMenu(view: View) {
|
||||
val popupView: CallConferenceParticipantsListPopupMenuBinding = DataBindingUtil.inflate(
|
||||
LayoutInflater.from(requireContext()),
|
||||
R.layout.call_conference_participants_list_popup_menu,
|
||||
null,
|
||||
false
|
||||
)
|
||||
|
||||
val popupWindow = PopupWindow(
|
||||
popupView.root,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
true
|
||||
)
|
||||
|
||||
popupView.setShareInvitationClickListener {
|
||||
val sipUri = viewModel.conferenceModel.sipUri.value.orEmpty()
|
||||
if (sipUri.isNotEmpty()) {
|
||||
Log.i("$TAG Sharing conference SIP URI [$sipUri]")
|
||||
|
||||
val clipboard = requireContext().getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||
val label = "Conference SIP address"
|
||||
clipboard.setPrimaryClip(ClipData.newPlainText(label, sipUri))
|
||||
}
|
||||
|
||||
popupWindow.dismiss()
|
||||
}
|
||||
|
||||
// Elevation is for showing a shadow around the popup
|
||||
popupWindow.elevation = 20f
|
||||
popupWindow.showAsDropDown(view, 0, 0, Gravity.BOTTOM)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@
|
|||
<variable
|
||||
name="addParticipantsClickListener"
|
||||
type="View.OnClickListener" />
|
||||
<variable
|
||||
name="showMenuClickListener"
|
||||
type="View.OnClickListener" />
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="org.linphone.ui.call.viewmodel.CurrentCallViewModel" />
|
||||
|
|
@ -18,7 +21,7 @@
|
|||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/color_main2_000">
|
||||
android:background="?attr/color_background_contrast_in_dark_mode">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back"
|
||||
|
|
@ -46,6 +49,29 @@
|
|||
app:layout_constraintStart_toEndOf="@id/back"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/show_menu"
|
||||
android:onClick="@{showMenuClickListener}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/top_bar_height"
|
||||
android:padding="15dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/dots_three_vertical"
|
||||
android:contentDescription="@string/content_description_show_popup_menu"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:tint="?attr/color_main2_500"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/background"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="?attr/color_main2_000"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/back" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/participants_list"
|
||||
android:layout_width="0dp"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View" />
|
||||
<variable
|
||||
name="shareInvitationClickListener"
|
||||
type="View.OnClickListener" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingEnd="@dimen/popup_menu_padding"
|
||||
android:paddingStart="@dimen/popup_menu_padding"
|
||||
android:background="@drawable/shape_round_popup_menu_background">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:id="@+id/share_invitation"
|
||||
android:onClick="@{shareInvitationClickListener}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/popup_menu_item_top_margin"
|
||||
android:text="@string/conference_share_link_title"
|
||||
android:textSize="14sp"
|
||||
android:textColor="?attr/color_main2_500"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:drawablePadding="5dp"
|
||||
android:drawableStart="@drawable/share_network"
|
||||
app:drawableTint="?attr/color_main2_700"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/bottom_anchor"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/bottom_anchor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="@dimen/popup_menu_item_top_margin"
|
||||
app:layout_constraintWidth_max="@dimen/popup_menu_width"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/share_invitation"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
Loading…
Add table
Reference in a new issue