Added option to schedule meeting from group chat room
This commit is contained in:
parent
9d9c58e7f7
commit
0f485ed66d
9 changed files with 69 additions and 4 deletions
|
@ -409,6 +409,14 @@ internal fun DetailChatRoomFragment.navigateToDialer(args: Bundle?) {
|
|||
)
|
||||
}
|
||||
|
||||
internal fun DetailChatRoomFragment.navigateToConferenceScheduling() {
|
||||
findMasterNavController().navigate(
|
||||
R.id.action_global_conferenceSchedulingFragment,
|
||||
null,
|
||||
popupTo()
|
||||
)
|
||||
}
|
||||
|
||||
internal fun ChatRoomCreationFragment.navigateToGroupInfo() {
|
||||
if (findNavController().currentDestination?.id == R.id.chatRoomCreationFragment) {
|
||||
findNavController().navigate(
|
||||
|
|
|
@ -871,6 +871,15 @@ class DetailChatRoomFragment : MasterFragment<ChatRoomDetailFragmentBinding, Cha
|
|||
navigateToEphemeralInfo()
|
||||
}
|
||||
|
||||
private fun scheduleMeeting(chatRoom: ChatRoom) {
|
||||
val participants = arrayListOf<Address>()
|
||||
for (participant in chatRoom.participants) {
|
||||
participants.add(participant.address)
|
||||
}
|
||||
sharedViewModel.participantsListForNextScheduledMeeting.value = Event(participants)
|
||||
navigateToConferenceScheduling()
|
||||
}
|
||||
|
||||
private fun showForwardConfirmationDialog(chatMessage: ChatMessage) {
|
||||
val viewModel = DialogViewModel(getString(R.string.chat_message_forward_confirmation_dialog))
|
||||
viewModel.iconResource = R.drawable.forward_message_default
|
||||
|
@ -901,7 +910,7 @@ class DetailChatRoomFragment : MasterFragment<ChatRoomDetailFragmentBinding, Cha
|
|||
)
|
||||
|
||||
val itemSize = AppUtils.getDimension(R.dimen.chat_room_popup_item_height).toInt()
|
||||
var totalSize = itemSize * 7
|
||||
var totalSize = itemSize * 8
|
||||
|
||||
val notificationsTurnedOff = viewModel.areNotificationsMuted()
|
||||
if (notificationsTurnedOff) {
|
||||
|
@ -918,6 +927,9 @@ class DetailChatRoomFragment : MasterFragment<ChatRoomDetailFragmentBinding, Cha
|
|||
} else {
|
||||
popupView.goToContactHidden = true
|
||||
}
|
||||
|
||||
popupView.meetingHidden = true
|
||||
totalSize -= itemSize
|
||||
} else {
|
||||
popupView.addToContactsHidden = true
|
||||
popupView.goToContactHidden = true
|
||||
|
@ -985,6 +997,10 @@ class DetailChatRoomFragment : MasterFragment<ChatRoomDetailFragmentBinding, Cha
|
|||
showEphemeralMessages()
|
||||
popupWindow.dismiss()
|
||||
}
|
||||
popupView.setMeetingListener {
|
||||
scheduleMeeting(chatRoom)
|
||||
popupWindow.dismiss()
|
||||
}
|
||||
popupView.setEditionModeListener {
|
||||
enterEditionMode()
|
||||
popupWindow.dismiss()
|
||||
|
|
|
@ -49,7 +49,16 @@ class ConferenceSchedulingFragment : GenericFragment<ConferenceSchedulingFragmen
|
|||
|
||||
binding.viewModel = viewModel
|
||||
|
||||
sharedViewModel.conferenceInfoToEdit.observe(
|
||||
sharedViewModel.participantsListForNextScheduledMeeting.observe(
|
||||
viewLifecycleOwner
|
||||
) {
|
||||
it.consume { participants ->
|
||||
Log.i("[Conference Scheduling] Found participants (${participants.size}) to pre-populate for meeting schedule")
|
||||
viewModel.prePopulateParticipantsList(participants, true)
|
||||
}
|
||||
}
|
||||
|
||||
sharedViewModel.addressOfConferenceInfoToEdit.observe(
|
||||
viewLifecycleOwner
|
||||
) {
|
||||
it.consume { address ->
|
||||
|
|
|
@ -127,7 +127,7 @@ class ScheduledConferencesFragment : MasterFragment<ConferencesScheduledFragment
|
|||
viewLifecycleOwner
|
||||
) {
|
||||
it.consume { address ->
|
||||
sharedViewModel.conferenceInfoToEdit.value = Event(address)
|
||||
sharedViewModel.addressOfConferenceInfoToEdit.value = Event(address)
|
||||
navigateToConferenceScheduling()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -196,6 +196,11 @@ class ConferenceSchedulingViewModel : ContactsSelectionViewModel() {
|
|||
super.onCleared()
|
||||
}
|
||||
|
||||
fun prePopulateParticipantsList(participants: ArrayList<Address>, isSchedule: Boolean) {
|
||||
selectedAddresses.value = participants
|
||||
scheduleForLater.value = isSchedule
|
||||
}
|
||||
|
||||
fun populateFromConferenceInfo(conferenceInfo: ConferenceInfo) {
|
||||
confInfo = conferenceInfo
|
||||
|
||||
|
|
|
@ -101,10 +101,14 @@ class SharedMainViewModel : ViewModel() {
|
|||
|
||||
/* Conference */
|
||||
|
||||
val conferenceInfoToEdit: MutableLiveData<Event<String>> by lazy {
|
||||
val addressOfConferenceInfoToEdit: MutableLiveData<Event<String>> by lazy {
|
||||
MutableLiveData<Event<String>>()
|
||||
}
|
||||
|
||||
val participantsListForNextScheduledMeeting: MutableLiveData<Event<ArrayList<Address>>> by lazy {
|
||||
MutableLiveData<Event<ArrayList<Address>>>()
|
||||
}
|
||||
|
||||
/* Dialer */
|
||||
|
||||
var dialerUri: String = ""
|
||||
|
|
BIN
app/src/main/res/drawable-xhdpi/menu_meeting_schedule.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/menu_meeting_schedule.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
7
app/src/main/res/drawable/chat_room_menu_meeting.xml
Normal file
7
app/src/main/res/drawable/chat_room_menu_meeting.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<bitmap android:src="@drawable/menu_meeting_schedule"
|
||||
android:tint="?attr/drawableTintColor"/>
|
||||
</item>
|
||||
</selector>
|
|
@ -13,6 +13,9 @@
|
|||
<variable
|
||||
name="ephemeralListener"
|
||||
type="View.OnClickListener" />
|
||||
<variable
|
||||
name="meetingListener"
|
||||
type="View.OnClickListener" />
|
||||
<variable
|
||||
name="editionModeListener"
|
||||
type="View.OnClickListener" />
|
||||
|
@ -31,6 +34,9 @@
|
|||
<variable
|
||||
name="ephemeralHidden"
|
||||
type="Boolean" />
|
||||
<variable
|
||||
name="meetingHidden"
|
||||
type="Boolean" />
|
||||
<variable
|
||||
name="muteHidden"
|
||||
type="Boolean" />
|
||||
|
@ -107,6 +113,16 @@
|
|||
android:text="@string/chat_message_context_menu_ephemeral_messages"
|
||||
app:drawableRightCompat="@drawable/chat_room_menu_ephemeral" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/chat_room_popup_item_height"
|
||||
android:visibility="@{meetingHidden ? View.GONE : View.VISIBLE}"
|
||||
android:background="@drawable/menu_background"
|
||||
android:onClick="@{meetingListener}"
|
||||
style="@style/popup_item_font"
|
||||
android:text="@string/conference_schedule_title"
|
||||
app:drawableRightCompat="@drawable/chat_room_menu_meeting" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/chat_room_popup_item_height"
|
||||
|
|
Loading…
Reference in a new issue