mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 19:49:33 +01:00
Improve menu layout
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
003a5af33c
commit
b3fe5baebd
@ -21,10 +21,14 @@
|
|||||||
package com.nextcloud.talk.adapters.items;
|
package com.nextcloud.talk.adapters.items;
|
||||||
|
|
||||||
|
|
||||||
|
import android.text.Spannable;
|
||||||
|
import android.text.SpannableString;
|
||||||
|
import android.text.style.ForegroundColorSpan;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.nextcloud.talk.R;
|
import com.nextcloud.talk.R;
|
||||||
|
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -66,7 +70,17 @@ public class MenuItem extends AbstractFlexibleItem<MenuItem.MenuItemViewHolder>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bindViewHolder(FlexibleAdapter adapter, MenuItem.MenuItemViewHolder holder, int position, List payloads) {
|
public void bindViewHolder(FlexibleAdapter adapter, MenuItem.MenuItemViewHolder holder, int position, List payloads) {
|
||||||
holder.menuTitle.setText(title);
|
if (title.equals(NextcloudTalkApplication.getSharedApplication().getString(R.string.nc_what))) {
|
||||||
|
Spannable spannableString = new SpannableString(NextcloudTalkApplication.getSharedApplication()
|
||||||
|
.getString(R.string.nc_what));
|
||||||
|
spannableString.setSpan(new ForegroundColorSpan(NextcloudTalkApplication.getSharedApplication()
|
||||||
|
.getResources().getColor(R.color.colorPrimary)), 0,
|
||||||
|
spannableString.length(),
|
||||||
|
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
|
holder.menuTitle.setText(spannableString);
|
||||||
|
} else {
|
||||||
|
holder.menuTitle.setText(title);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static class MenuItemViewHolder extends FlexibleViewHolder {
|
static class MenuItemViewHolder extends FlexibleViewHolder {
|
||||||
|
@ -92,6 +92,9 @@ public class RoomMenuController extends BaseController {
|
|||||||
|
|
||||||
private void prepareMenu() {
|
private void prepareMenu() {
|
||||||
menuItems = new ArrayList<>();
|
menuItems = new ArrayList<>();
|
||||||
|
|
||||||
|
menuItems.add(new MenuItem(getResources().getString(R.string.nc_what)));
|
||||||
|
|
||||||
menuItems.add(new MenuItem(getResources().getString(R.string.nc_leave)));
|
menuItems.add(new MenuItem(getResources().getString(R.string.nc_leave)));
|
||||||
|
|
||||||
if (room.isNameEditable()) {
|
if (room.isNameEditable()) {
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
android:id="@+id/menu_text"
|
android:id="@+id/menu_text"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="@dimen/margin_between_elements"/>
|
android:layout_margin="@dimen/margin_between_elements"
|
||||||
|
android:textSize="12sp"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
@ -62,7 +62,7 @@
|
|||||||
<string name="nc_select_an_account">Select an account</string>
|
<string name="nc_select_an_account">Select an account</string>
|
||||||
|
|
||||||
<!-- Room menu -->
|
<!-- Room menu -->
|
||||||
<string name="nc_what">What would you like to do?</string>
|
<string name="nc_what">What would you like to do today?</string>
|
||||||
<string name="nc_leave">Leave call</string>
|
<string name="nc_leave">Leave call</string>
|
||||||
<string name="nc_rename">Rename call</string>
|
<string name="nc_rename">Rename call</string>
|
||||||
<string name="nc_set_password">Set the password</string>
|
<string name="nc_set_password">Set the password</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user