Merge pull request #204 from nextcloud/bottomSheetRoomHeader

Dynamic bottom sheet room header
This commit is contained in:
Mario Đanić 2018-06-21 22:49:36 +02:00 committed by GitHub
commit 0efc09d528
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 3 deletions

View file

@ -26,6 +26,7 @@ import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -123,7 +124,18 @@ public class CallMenuController extends BaseController implements FlexibleAdapte
menuItems = new ArrayList<>();
if (menuType.equals(MenuType.REGULAR)) {
menuItems.add(new MenuItem(getResources().getString(R.string.nc_configure_room), 0, null));
if (!TextUtils.isEmpty(room.getDisplayName())) {
menuItems.add(new MenuItem(
getResources().getString(
R.string.nc_configure_named_room, room.getDisplayName()), 0, null)
);
} else if (!TextUtils.isEmpty(room.getName())) {
menuItems.add(new MenuItem(getResources().getString(
R.string.nc_configure_named_room, room.getName()), 0, null)
);
} else {
menuItems.add(new MenuItem(getResources().getString(R.string.nc_configure_room), 0, null));
}
if (room.isNameEditable()) {
menuItems.add(new MenuItem(getResources().getString(R.string.nc_rename), 2, getResources().getDrawable(R.drawable

View file

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

View file

@ -10,7 +10,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.android.tools.build:gradle:3.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
// NOTE: Do not place your application dependencies here; they belong