Disable some actions when a chat room has been left
This commit is contained in:
parent
375f43cfa5
commit
890d217ab7
6 changed files with 29 additions and 1 deletions
|
@ -936,6 +936,10 @@ class DetailChatRoomFragment : MasterFragment<ChatRoomDetailFragmentBinding, Cha
|
|||
LayoutInflater.from(context),
|
||||
R.layout.chat_room_menu, null, false
|
||||
)
|
||||
val readOnly = chatRoom.isReadOnly
|
||||
popupView.ephemeralEnabled = !readOnly
|
||||
popupView.devicesEnabled = !readOnly
|
||||
popupView.meetingEnabled = !readOnly
|
||||
|
||||
val itemSize = AppUtils.getDimension(R.dimen.chat_room_popup_item_height).toInt()
|
||||
var totalSize = itemSize * 8
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_enabled="false">
|
||||
<bitmap android:src="@drawable/menu_security_default"
|
||||
android:tint="?attr/drawableTintDisabledColor"/>
|
||||
</item>
|
||||
<item>
|
||||
<bitmap android:src="@drawable/menu_security_default"
|
||||
android:tint="?attr/drawableTintColor"/>
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_enabled="false">
|
||||
<bitmap android:src="@drawable/menu_ephemeral_messages_default"
|
||||
android:tint="?attr/drawableTintDisabledColor"/>
|
||||
</item>
|
||||
<item>
|
||||
<bitmap android:src="@drawable/menu_ephemeral_messages_default"
|
||||
android:tint="?attr/drawableTintColor"/>
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_enabled="false">
|
||||
<bitmap android:src="@drawable/menu_meeting_schedule"
|
||||
android:tint="?attr/drawableTintDisabledColor"/>
|
||||
</item>
|
||||
<item>
|
||||
<bitmap android:src="@drawable/menu_meeting_schedule"
|
||||
android:tint="?attr/drawableTintColor"/>
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
android:layout_weight="0.2"
|
||||
android:background="?attr/button_background_drawable"
|
||||
android:padding="7dp"
|
||||
android:enabled="@{viewModel.groupCallAvailable}"
|
||||
android:enabled="@{viewModel.groupCallAvailable && !chatSendingViewModel.isReadOnly}"
|
||||
android:visibility="@{viewModel.oneToOneChatRoom ? View.GONE : View.VISIBLE}"
|
||||
android:src="@drawable/icon_video_conf_new" />
|
||||
|
||||
|
|
|
@ -55,6 +55,15 @@
|
|||
<variable
|
||||
name="goToContactHidden"
|
||||
type="Boolean" />
|
||||
<variable
|
||||
name="devicesEnabled"
|
||||
type="Boolean" />
|
||||
<variable
|
||||
name="ephemeralEnabled"
|
||||
type="Boolean" />
|
||||
<variable
|
||||
name="meetingEnabled"
|
||||
type="Boolean" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
|
@ -99,6 +108,7 @@
|
|||
android:visibility="@{devicesHidden ? View.GONE : View.VISIBLE}"
|
||||
android:background="@drawable/menu_background"
|
||||
android:onClick="@{devicesListener}"
|
||||
android:enabled="@{devicesEnabled}"
|
||||
style="@style/popup_item_font"
|
||||
android:text="@string/chat_room_context_menu_participants_devices"
|
||||
app:drawableRightCompat="@drawable/chat_room_menu_devices" />
|
||||
|
@ -109,6 +119,7 @@
|
|||
android:visibility="@{ephemeralHidden ? View.GONE : View.VISIBLE}"
|
||||
android:background="@drawable/menu_background"
|
||||
android:onClick="@{ephemeralListener}"
|
||||
android:enabled="@{ephemeralEnabled}"
|
||||
style="@style/popup_item_font"
|
||||
android:text="@string/chat_message_context_menu_ephemeral_messages"
|
||||
app:drawableRightCompat="@drawable/chat_room_menu_ephemeral" />
|
||||
|
@ -119,6 +130,7 @@
|
|||
android:visibility="@{meetingHidden ? View.GONE : View.VISIBLE}"
|
||||
android:background="@drawable/menu_background"
|
||||
android:onClick="@{meetingListener}"
|
||||
android:enabled="@{meetingEnabled}"
|
||||
style="@style/popup_item_font"
|
||||
android:text="@string/conference_schedule_title"
|
||||
app:drawableRightCompat="@drawable/chat_room_menu_meeting" />
|
||||
|
|
Loading…
Reference in a new issue