Add options menu entries for participant list and room details

This commit is contained in:
SpiritCroc 2020-07-25 11:08:23 +02:00
parent 7c959176fd
commit 7ae5ae2922
9 changed files with 68 additions and 4 deletions

View File

@ -165,6 +165,8 @@
<activity android:name=".features.roomprofile.RoomProfileActivity" />
<activity android:name=".features.roomprofile.members.RoomMemberListActivity" />
<activity android:name=".features.signout.hard.SignedOutActivity" />
<activity
android:name=".features.signout.soft.SoftLogoutActivity"

View File

@ -170,6 +170,7 @@ import im.vector.riotx.features.notifications.NotificationUtils
import im.vector.riotx.features.permalink.NavigationInterceptor
import im.vector.riotx.features.permalink.PermalinkHandler
import im.vector.riotx.features.reactions.EmojiReactionPickerActivity
import im.vector.riotx.features.roomprofile.members.RoomMemberListActivity
import im.vector.riotx.features.settings.VectorPreferences
import im.vector.riotx.features.settings.VectorSettingsActivity
import im.vector.riotx.features.share.SharedData
@ -575,6 +576,14 @@ class RoomDetailFragment @Inject constructor(
roomDetailViewModel.handle(RoomDetailAction.EndCall)
true
}
R.id.show_participants -> {
startActivity(RoomMemberListActivity.newIntent(requireContext(), roomDetailArgs.roomId))
true
}
R.id.show_room_info -> {
navigator.openRoomProfile(requireActivity(), roomDetailArgs.roomId)
true
}
else -> super.onOptionsItemSelected(item)
}
}

View File

@ -421,6 +421,8 @@ class RoomDetailViewModel @AssistedInject constructor(
R.id.voice_call,
R.id.video_call -> room.canStartCall() && webRtcPeerConnectionManager.currentCall == null
R.id.hangup_call -> webRtcPeerConnectionManager.currentCall != null
R.id.show_room_info -> true
R.id.show_participants -> true
else -> false
}
}

View File

@ -37,7 +37,7 @@ import im.vector.riotx.features.roomprofile.settings.RoomSettingsFragment
import im.vector.riotx.features.roomprofile.uploads.RoomUploadsFragment
import javax.inject.Inject
class RoomProfileActivity :
open class RoomProfileActivity :
VectorBaseActivity(),
ToolbarConfigurable,
RequireActiveMembershipViewModel.Factory {
@ -53,7 +53,7 @@ class RoomProfileActivity :
}
private lateinit var sharedActionViewModel: RoomProfileSharedActionViewModel
private lateinit var roomProfileArgs: RoomProfileArgs
protected lateinit var roomProfileArgs: RoomProfileArgs
private val requireActiveMembershipViewModel: RequireActiveMembershipViewModel by viewModel()
@ -75,7 +75,7 @@ class RoomProfileActivity :
sharedActionViewModel = viewModelProvider.get(RoomProfileSharedActionViewModel::class.java)
roomProfileArgs = intent?.extras?.getParcelable(MvRx.KEY_ARG) ?: return
if (isFirstCreation()) {
addFragment(R.id.simpleFragmentContainer, RoomProfileFragment::class.java, roomProfileArgs)
addInitialFragment()
}
sharedActionViewModel
.observe()
@ -95,6 +95,10 @@ class RoomProfileActivity :
}
}
open fun addInitialFragment() {
addFragment(R.id.simpleFragmentContainer, RoomProfileFragment::class.java, roomProfileArgs)
}
private fun handleRoomLeft(roomLeft: RequireActiveMembershipViewEvents.RoomLeft) {
if (roomLeft.leftMessage != null) {
Toast.makeText(this, roomLeft.leftMessage, Toast.LENGTH_LONG).show()

View File

@ -0,0 +1,27 @@
package im.vector.riotx.features.roomprofile.members
import android.content.Context
import android.content.Intent
import com.airbnb.mvrx.MvRx
import im.vector.riotx.R
import im.vector.riotx.core.extensions.addFragment
import im.vector.riotx.features.roomprofile.RoomProfileActivity
import im.vector.riotx.features.roomprofile.RoomProfileArgs
class RoomMemberListActivity :
RoomProfileActivity() {
companion object {
fun newIntent(context: Context, roomId: String): Intent {
val roomProfileArgs = RoomProfileArgs(roomId)
return Intent(context, RoomMemberListActivity::class.java).apply {
putExtra(MvRx.KEY_ARG, roomProfileArgs)
}
}
}
override fun addInitialFragment() {
addFragment(R.id.simpleFragmentContainer, RoomMemberListFragment::class.java, roomProfileArgs)
}
}

View File

@ -58,4 +58,18 @@
app:showAsAction="never"
tools:visible="true" />
<item
android:id="@+id/show_participants"
android:title="@string/show_participants_sc"
android:visible="true"
app:showAsAction="never"
tools:visible="true" />
<item
android:id="@+id/show_room_info"
android:title="@string/show_room_info_sc"
android:visible="true"
app:showAsAction="never"
tools:visible="true" />
</menu>

View File

@ -2107,7 +2107,7 @@ Verwahre deinen Wiederherstellungsschlüssel an einem sehr sicheren Ort wie eine
<string name="room_profile_section_security">Sicherheit</string>
<string name="room_profile_section_security_learn_more">Mehr erfahren</string>
<string name="room_profile_section_more">Mehr</string>
<string name="room_profile_section_more_settings">Raum Einstellungen</string>
<string name="room_profile_section_more_settings">Raum-Einstellungen</string>
<string name="room_profile_section_more_notifications">Benachrichtigungen</string>
<plurals name="room_profile_section_more_member_list">
<item quantity="one">Eine Person</item>

View File

@ -26,4 +26,7 @@
<string name="login_server_other_title_sc">Benutzerdefinierter Server</string>
<string name="login_server_other_text_sc">Serveradresse angeben zum Anmelden oder Registrieren</string>
<string name="show_room_info_sc">Rauminfo</string>
<string name="show_participants_sc">Teilnehmer</string>
</resources>

View File

@ -26,4 +26,7 @@
<string name="login_server_other_title_sc">Custom server</string>
<string name="login_server_other_text_sc">Enter server address to login or register</string>
<string name="show_room_info_sc">Room details</string>
<string name="show_participants_sc">Participants</string>
</resources>