mirror of
https://github.com/element-hq/element-android
synced 2024-11-25 02:45:37 +03:00
Add menu item to invite users to the room.
This commit is contained in:
parent
996fabb327
commit
f25c981173
3 changed files with 26 additions and 0 deletions
|
@ -17,6 +17,7 @@
|
|||
package im.vector.riotx.features.roomprofile.members
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import com.airbnb.mvrx.args
|
||||
import com.airbnb.mvrx.fragmentViewModel
|
||||
|
@ -43,6 +44,18 @@ class RoomMemberListFragment @Inject constructor(
|
|||
|
||||
override fun getLayoutResId() = R.layout.fragment_room_setting_generic
|
||||
|
||||
override fun getMenuRes() = R.menu.menu_room_member_list
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
R.id.menu_room_member_list_add_member -> {
|
||||
navigator.openCreateDirectRoom(requireContext())
|
||||
return true
|
||||
}
|
||||
}
|
||||
return super.onOptionsItemSelected(item)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
roomMemberListController.callback = this
|
||||
|
|
12
vector/src/main/res/menu/menu_room_member_list.xml
Normal file
12
vector/src/main/res/menu/menu_room_member_list.xml
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_room_member_list_add_member"
|
||||
android:title="@string/add_members_to_room"
|
||||
android:icon="@drawable/ic_fab_add"
|
||||
app:iconTint="?attr/colorAccent"
|
||||
app:showAsAction="always" />
|
||||
|
||||
</menu>
|
|
@ -36,6 +36,7 @@
|
|||
<!-- BEGIN Strings added by Onuray -->
|
||||
<string name="external_link_confirmation_title">Double-check this link</string>
|
||||
<string name="external_link_confirmation_message">The link %1$s is taking you to another site: %2$s.\n\nAre you sure you want to continue?</string>
|
||||
<string name="add_members_to_room">Add members</string>
|
||||
<!-- END Strings added by Onuray -->
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue