Browse Source

dynamic bottom sheet header for room config

AndyScherzinger 6 years ago
parent
commit
066e0702d7

+ 12 - 1
app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/CallMenuController.java

@@ -123,7 +123,18 @@ public class CallMenuController extends BaseController implements FlexibleAdapte
         menuItems = new ArrayList<>();
         menuItems = new ArrayList<>();
 
 
         if (menuType.equals(MenuType.REGULAR)) {
         if (menuType.equals(MenuType.REGULAR)) {
-            menuItems.add(new MenuItem(getResources().getString(R.string.nc_configure_room), 0, null));
+            if (room.displayName != null && room.displayName.length()>0) {
+                menuItems.add(new MenuItem(
+                        getResources().getString(
+                                R.string.nc_configure_named_room, room.displayName), 0, null)
+                );
+            } else if (room.name != null && room.name.length()>0) {
+                menuItems.add(new MenuItem(getResources().getString(
+                        R.string.nc_configure_named_room, room.name), 0, null)
+                );
+            } else {
+                menuItems.add(new MenuItem(getResources().getString(R.string.nc_configure_room), 0, null));
+            }
 
 
             if (room.isNameEditable()) {
             if (room.isNameEditable()) {
                 menuItems.add(new MenuItem(getResources().getString(R.string.nc_rename), 2, getResources().getDrawable(R.drawable
                 menuItems.add(new MenuItem(getResources().getString(R.string.nc_rename), 2, getResources().getDrawable(R.drawable

+ 1 - 0
app/src/main/res/values/strings.xml

@@ -85,6 +85,7 @@
     <!-- Room menu -->
     <!-- Room menu -->
     <string name="nc_start_conversation">Start a conversation</string>
     <string name="nc_start_conversation">Start a conversation</string>
     <string name="nc_configure_room">Configure room</string>
     <string name="nc_configure_room">Configure room</string>
+    <string name="nc_configure_named_room">Configure room %1$s</string>
     <string name="nc_leave">Leave conversation</string>
     <string name="nc_leave">Leave conversation</string>
     <string name="nc_rename">Rename conversation</string>
     <string name="nc_rename">Rename conversation</string>
     <string name="nc_set_password">Set a password</string>
     <string name="nc_set_password">Set a password</string>