show number of participants in a MUC

fixes #3447
This commit is contained in:
Anjan Momi 2020-01-05 02:22:39 -08:00 committed by Daniel Gultsch
parent 0315b3b5c2
commit 0ddfc51d6c
3 changed files with 8 additions and 3 deletions

View File

@ -551,6 +551,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
this.mUserPreviewAdapter.submitList(MucOptions.sub(users, GridManager.getCurrentColumnCount(binding.users))); this.mUserPreviewAdapter.submitList(MucOptions.sub(users, GridManager.getCurrentColumnCount(binding.users)));
this.binding.invite.setVisibility(mucOptions.canInvite() ? View.VISIBLE : View.GONE); this.binding.invite.setVisibility(mucOptions.canInvite() ? View.VISIBLE : View.GONE);
this.binding.showUsers.setVisibility(users.size() > 0 ? View.VISIBLE : View.GONE); this.binding.showUsers.setVisibility(users.size() > 0 ? View.VISIBLE : View.GONE);
this.binding.showUsers.setText(getResources().getQuantityString(R.plurals.view_users, users.size(), users.size()));
this.binding.usersWrapper.setVisibility(users.size() > 0 || mucOptions.canInvite() ? View.VISIBLE : View.GONE); this.binding.usersWrapper.setVisibility(users.size() > 0 || mucOptions.canInvite() ? View.VISIBLE : View.GONE);
if (users.size() == 0) { if (users.size() == 0) {
this.binding.noUsersHints.setText(mucOptions.isPrivateAndNonAnonymous() ? R.string.no_users_hint_group_chat : R.string.no_users_hint_channel); this.binding.noUsersHints.setText(mucOptions.isPrivateAndNonAnonymous() ? R.string.no_users_hint_group_chat : R.string.no_users_hint_channel);

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android" <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -278,7 +279,7 @@
android:minWidth="0dp" android:minWidth="0dp"
android:paddingLeft="16dp" android:paddingLeft="16dp"
android:paddingRight="16dp" android:paddingRight="16dp"
android:text="@string/view_users" tools:text="View n Participants"
android:textColor="?attr/colorAccent" /> android:textColor="?attr/colorAccent" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View File

@ -753,7 +753,6 @@
<string name="pref_more_notification_settings_summary">Importance, Sound, Vibrate</string> <string name="pref_more_notification_settings_summary">Importance, Sound, Vibrate</string>
<string name="video_compression_channel_name">Video compression</string> <string name="video_compression_channel_name">Video compression</string>
<string name="view_media">View media</string> <string name="view_media">View media</string>
<string name="view_users">View participants</string>
<string name="group_chat_members">Participants</string> <string name="group_chat_members">Participants</string>
<string name="media_browser">Media browser</string> <string name="media_browser">Media browser</string>
<string name="security_violation_not_attaching_file">File omitted due to security violation.</string> <string name="security_violation_not_attaching_file">File omitted due to security violation.</string>
@ -882,5 +881,9 @@
<string name="pref_channel_discovery">Channel discovery method</string> <string name="pref_channel_discovery">Channel discovery method</string>
<string name="backup">Backup</string> <string name="backup">Backup</string>
<string name="category_about">About</string> <string name="category_about">About</string>
<plurals name="view_users">
<item quantity="one">View %1$d Participant</item>
<item quantity="other">View %1$d Participants</item>
</plurals>
<string name="openstreetmap_credit">© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors</string> <string name="openstreetmap_credit">© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors</string>
</resources> </resources>