mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-15 00:35:04 +01:00
Merge pull request #1130 from nextcloud/accessibilityParticipantsListAndGreyTones
Accessibility participants list and grey tones
This commit is contained in:
commit
32fc1bc3f6
@ -26,6 +26,10 @@ import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import androidx.emoji.widget.EmojiTextView;
|
||||
|
||||
import com.facebook.drawee.backends.pipeline.Fresco;
|
||||
import com.facebook.drawee.interfaces.DraweeController;
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
@ -40,9 +44,6 @@ import com.nextcloud.talk.utils.DisplayUtils;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import androidx.emoji.widget.EmojiTextView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import eu.davidea.flexibleadapter.FlexibleAdapter;
|
||||
@ -121,16 +122,18 @@ public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder>
|
||||
}
|
||||
|
||||
if (!isOnline) {
|
||||
if (holder.contactMentionId != null) {
|
||||
holder.contactMentionId.setAlpha(0.38f);
|
||||
}
|
||||
holder.contactDisplayName.setAlpha(0.38f);
|
||||
holder.contactDisplayName.setTextColor(ResourcesCompat.getColor(
|
||||
holder.contactDisplayName.getContext().getResources(),
|
||||
R.color.medium_emphasis_text,
|
||||
null)
|
||||
);
|
||||
holder.simpleDraweeView.setAlpha(0.38f);
|
||||
} else {
|
||||
if (holder.contactMentionId != null) {
|
||||
holder.contactMentionId.setAlpha(1.0f);
|
||||
}
|
||||
holder.contactDisplayName.setAlpha(1.0f);
|
||||
holder.contactDisplayName.setTextColor(ResourcesCompat.getColor(
|
||||
holder.contactDisplayName.getContext().getResources(),
|
||||
R.color.high_emphasis_text,
|
||||
null)
|
||||
);
|
||||
holder.simpleDraweeView.setAlpha(1.0f);
|
||||
}
|
||||
|
||||
@ -243,7 +246,6 @@ public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder>
|
||||
|
||||
if (!holder.contactMentionId.getText().equals(userType)) {
|
||||
holder.contactMentionId.setText(userType);
|
||||
holder.contactMentionId.setTextColor(NextcloudTalkApplication.Companion.getSharedApplication().getResources().getColor(R.color.textColorMaxContrast));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -266,7 +268,6 @@ public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder>
|
||||
this.header = header;
|
||||
}
|
||||
|
||||
|
||||
static class UserItemViewHolder extends FlexibleViewHolder {
|
||||
|
||||
@BindView(R.id.name_text)
|
||||
@ -294,6 +295,4 @@ public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder>
|
||||
ButterKnife.bind(this, view);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -78,7 +78,6 @@ import com.yarolegovich.mp.MaterialStandardPreference
|
||||
import com.yarolegovich.mp.MaterialSwitchPreference
|
||||
import eu.davidea.flexibleadapter.FlexibleAdapter
|
||||
import eu.davidea.flexibleadapter.common.SmoothScrollLinearLayoutManager
|
||||
import eu.davidea.flexibleadapter.items.AbstractFlexibleItem
|
||||
import io.reactivex.Observer
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
@ -88,6 +87,7 @@ import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
import java.util.*
|
||||
import javax.inject.Inject
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
|
||||
@AutoInjector(NextcloudTalkApplication::class)
|
||||
@ -142,8 +142,8 @@ class ConversationInfoController(args: Bundle) : BaseController(args), FlexibleA
|
||||
private var databaseStorageModule: DatabaseStorageModule? = null
|
||||
private var conversation: Conversation? = null
|
||||
|
||||
private var adapter: FlexibleAdapter<AbstractFlexibleItem<*>>? = null
|
||||
private var recyclerViewItems: MutableList<AbstractFlexibleItem<*>> = ArrayList()
|
||||
private var adapter: FlexibleAdapter<UserItem>? = null
|
||||
private var recyclerViewItems: MutableList<UserItem> = ArrayList()
|
||||
|
||||
private var saveStateHandler: LovelySaveStateHandler? = null
|
||||
|
||||
@ -376,6 +376,7 @@ class ConversationInfoController(args: Bundle) : BaseController(args), FlexibleA
|
||||
}
|
||||
}
|
||||
|
||||
Collections.sort(recyclerViewItems, UserItemComparator())
|
||||
|
||||
if (ownUserItem != null) {
|
||||
recyclerViewItems.add(0, ownUserItem)
|
||||
@ -684,4 +685,32 @@ class ConversationInfoController(args: Bundle) : BaseController(args), FlexibleA
|
||||
|
||||
private const val ID_DELETE_CONVERSATION_DIALOG = 0
|
||||
}
|
||||
|
||||
/**
|
||||
* Comparator for participants, sorts by online-status, moderator-status and display name.
|
||||
*/
|
||||
class UserItemComparator : Comparator<UserItem> {
|
||||
override fun compare(left: UserItem, right: UserItem): Int {
|
||||
if (left.isOnline && !right.isOnline) {
|
||||
return -1
|
||||
} else if (!left.isOnline && right.isOnline) {
|
||||
return 1
|
||||
}
|
||||
|
||||
val moderatorTypes = ArrayList<Participant.ParticipantType>()
|
||||
moderatorTypes.add(Participant.ParticipantType.MODERATOR)
|
||||
moderatorTypes.add(Participant.ParticipantType.OWNER)
|
||||
moderatorTypes.add(Participant.ParticipantType.GUEST_MODERATOR)
|
||||
|
||||
if (moderatorTypes.contains(left.model.type) && !moderatorTypes.contains(right.model.type)) {
|
||||
return -1
|
||||
} else if (!moderatorTypes.contains(left.model.type) && moderatorTypes.contains(right.model.type)) {
|
||||
return 1
|
||||
}
|
||||
|
||||
return left.model.displayName.toLowerCase(Locale.ROOT).compareTo(
|
||||
right.model.displayName.toLowerCase(Locale.ROOT)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -809,7 +809,7 @@ public class ProfileController extends BaseController {
|
||||
this,
|
||||
item.field,
|
||||
holder.getAdapterPosition()).show());
|
||||
holder.scope.setAlpha(1.0f);
|
||||
holder.scope.setAlpha(0.87f); // active - high emphasis
|
||||
} else {
|
||||
holder.text.setEnabled(false);
|
||||
holder.text.setFocusableInTouchMode(false);
|
||||
@ -817,7 +817,7 @@ public class ProfileController extends BaseController {
|
||||
holder.text.setCursorVisible(false);
|
||||
holder.text.setBackgroundTintList(ColorStateList.valueOf(Color.TRANSPARENT));
|
||||
holder.scope.setOnClickListener(null);
|
||||
holder.scope.setAlpha(0.4f);
|
||||
holder.scope.setAlpha(0.6f); // inactive - medium emphasis
|
||||
}
|
||||
} else {
|
||||
holder.container.setVisibility(View.GONE);
|
||||
|
@ -103,6 +103,7 @@ public class Conversation {
|
||||
|
||||
public boolean isGuest() {
|
||||
return (Participant.ParticipantType.GUEST.equals(participantType) ||
|
||||
Participant.ParticipantType.GUEST_MODERATOR.equals(participantType) ||
|
||||
Participant.ParticipantType.USER_FOLLOWING_LINK.equals(participantType));
|
||||
}
|
||||
|
||||
@ -116,8 +117,9 @@ public class Conversation {
|
||||
}
|
||||
|
||||
public boolean isParticipantOwnerOrModerator() {
|
||||
return Participant.ParticipantType.OWNER.equals(participantType)
|
||||
|| Participant.ParticipantType.MODERATOR.equals(participantType);
|
||||
return (Participant.ParticipantType.OWNER.equals(participantType) ||
|
||||
Participant.ParticipantType.GUEST_MODERATOR.equals(participantType) ||
|
||||
Participant.ParticipantType.MODERATOR.equals(participantType));
|
||||
}
|
||||
|
||||
public boolean shouldShowLobby(UserEntity conversationUser) {
|
||||
|
@ -37,10 +37,11 @@ public class EnumParticipantTypeConverter extends IntBasedTypeConverter<Particip
|
||||
return Participant.ParticipantType.GUEST;
|
||||
case 5:
|
||||
return Participant.ParticipantType.USER_FOLLOWING_LINK;
|
||||
case 6:
|
||||
return Participant.ParticipantType.GUEST_MODERATOR;
|
||||
default:
|
||||
return Participant.ParticipantType.DUMMY;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -58,6 +59,8 @@ public class EnumParticipantTypeConverter extends IntBasedTypeConverter<Particip
|
||||
return 4;
|
||||
case USER_FOLLOWING_LINK:
|
||||
return 5;
|
||||
case GUEST_MODERATOR:
|
||||
return 6;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
@ -84,7 +84,8 @@ public class Participant {
|
||||
MODERATOR,
|
||||
USER,
|
||||
GUEST,
|
||||
USER_FOLLOWING_LINK
|
||||
USER_FOLLOWING_LINK,
|
||||
GUEST_MODERATOR
|
||||
}
|
||||
|
||||
public enum ParticipantFlags {
|
||||
|
@ -127,7 +127,7 @@
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:listitem="@layout/rv_item_contact" />
|
||||
tools:listitem="@layout/rv_item_conversation_info_participant" />
|
||||
|
||||
</com.yarolegovich.mp.MaterialPreferenceCategory>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!-- Nextcloud Android client application
|
||||
|
||||
Copyright (C) 2017 Andy Scherzinger
|
||||
Copyright (C) 2017-2021 Andy Scherzinger
|
||||
Copyright (C) 2017 Nextcloud
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
@ -37,7 +37,8 @@
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:transitionName="userAvatar.transitionTag"
|
||||
app:roundAsCircle="true" />
|
||||
app:roundAsCircle="true"
|
||||
tools:src="@tools:sample/avatars[0]" />
|
||||
|
||||
<androidx.emoji.widget.EmojiTextView
|
||||
android:id="@+id/userinfo_fullName"
|
||||
@ -47,7 +48,6 @@
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/margin_between_elements"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/nc_incoming_text_default"
|
||||
tools:text="John Doe" />
|
||||
|
||||
<TextView
|
||||
@ -59,7 +59,7 @@
|
||||
android:layout_margin="4dp"
|
||||
android:ellipsize="end"
|
||||
android:lines="2"
|
||||
android:textColor="@color/nc_incoming_text_default"
|
||||
android:textColor="@color/medium_emphasis_text"
|
||||
tools:text="john@nextcloud.com" />
|
||||
|
||||
<LinearLayout
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
<com.yarolegovich.mp.MaterialPreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:apc="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/settings_screen"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
@ -60,7 +61,7 @@
|
||||
android:layout_below="@id/avatar_image"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/margin_between_elements"
|
||||
android:textColor="@color/nc_incoming_text_default" />
|
||||
tools:text="Jane Doe" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/base_url_text"
|
||||
@ -69,7 +70,8 @@
|
||||
android:layout_below="@id/display_name_text"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_margin="4dp"
|
||||
android:textColor="@color/nc_incoming_text_default" />
|
||||
android:textColor="@color/medium_emphasis_text"
|
||||
tools:text="jane@nextcloud.com" />
|
||||
|
||||
<com.facebook.drawee.view.SimpleDraweeView
|
||||
android:id="@+id/avatar_image"
|
||||
@ -77,7 +79,8 @@
|
||||
android:layout_height="@dimen/avatar_size_big"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:transitionName="userAvatar.transitionTag"
|
||||
apc:roundAsCircle="true" />
|
||||
apc:roundAsCircle="true"
|
||||
tools:src="@tools:sample/avatars[0]" />
|
||||
|
||||
|
||||
<com.yarolegovich.mp.MaterialStandardPreference
|
||||
|
@ -73,7 +73,8 @@
|
||||
android:ellipsize="middle"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceListItem"
|
||||
tools:text="Call item text" />
|
||||
android:textColor="@color/conversation_item_header"
|
||||
tools:text="Jane Doe" />
|
||||
|
||||
<androidx.emoji.widget.EmojiTextView
|
||||
android:id="@+id/secondary_text"
|
||||
@ -81,8 +82,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="middle"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/textColorMaxContrast"
|
||||
tools:text="A week ago" />
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
tools:text="Moderator" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -92,6 +92,7 @@
|
||||
android:layout_height="18dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="8dp"
|
||||
android:clickable="false"
|
||||
android:gravity="top"
|
||||
android:lines="1"
|
||||
android:textAppearance="@style/ChipUnreadMessagesTextAppearance"
|
||||
|
@ -58,8 +58,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="middle"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/textColorMaxContrast"
|
||||
android:textSize="16sp"
|
||||
android:textAppearance="?android:attr/textAppearanceListItem"
|
||||
tools:text="Call item text" />
|
||||
|
||||
<androidx.emoji.widget.EmojiTextView
|
||||
@ -68,8 +67,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="middle"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/nc_incoming_text_default"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/textColorMaxContrast"
|
||||
tools:text="A week ago" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -95,6 +95,7 @@
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@string/nc_settings"
|
||||
android:scaleType="fitCenter"
|
||||
android:transitionName="userAvatar.transitionTag"
|
||||
app:cornerRadius="@dimen/button_corner_radius"
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Nextcloud Android client application
|
||||
|
||||
Copyright (C) 2018 Andy Scherzinger
|
||||
Copyright (C) 2018-2021 Andy Scherzinger
|
||||
Copyright (C) 2018 Nextcloud
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
@ -39,7 +39,7 @@
|
||||
<EditText
|
||||
android:id="@+id/user_info_edit_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="@dimen/standard_double_margin"
|
||||
android:layout_marginEnd="@dimen/standard_margin"
|
||||
android:autofillHints="none"
|
||||
@ -56,9 +56,10 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/scope"
|
||||
android:layout_width="@dimen/iconized_single_line_item_icon_size"
|
||||
android:layout_height="@dimen/iconized_single_line_item_icon_size"
|
||||
android:layout_marginEnd="@dimen/standard_margin"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="12dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:contentDescription="@string/scope_toggle"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
@ -32,7 +32,10 @@
|
||||
<color name="appbar">#1E1E1E</color>
|
||||
<color name="fontAppbar">#FFFFFF</color>
|
||||
|
||||
<color name="conversation_item_header">#deffffff</color>
|
||||
<!-- general text colors -->
|
||||
<color name="high_emphasis_text">#deffffff</color>
|
||||
<color name="medium_emphasis_text">#99ffffff</color>
|
||||
<color name="low_emphasis_text">#61ffffff</color>
|
||||
|
||||
<color name="bg_default">#121212</color>
|
||||
<color name="bg_inverse">@color/grey950</color>
|
||||
|
@ -33,13 +33,18 @@
|
||||
<color name="fontAppbar">#666666</color>
|
||||
<color name="fontSecondaryAppbar">#A5A5A5</color>
|
||||
|
||||
<!-- general text colors -->
|
||||
<color name="high_emphasis_text">#de000000</color>
|
||||
<color name="medium_emphasis_text">#99000000</color>
|
||||
<color name="low_emphasis_text">#61000000</color>
|
||||
|
||||
<!-- Text color of sent messages -->
|
||||
<color name="nc_outcoming_text_default">#FFFFFF</color>
|
||||
<!-- Text color of received messages -->
|
||||
<color name="nc_incoming_text_default">#37505D</color>
|
||||
|
||||
<!-- Name of person or group for the chat conversation -->
|
||||
<color name="conversation_item_header">#000000</color>
|
||||
<color name="conversation_item_header">@color/high_emphasis_text</color>
|
||||
<color name="conversation_unread_bubble">#DBDBDB</color>
|
||||
<color name="conversation_unread_bubble_text">#222222</color>
|
||||
|
||||
|
@ -30,10 +30,14 @@
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
<item name="android:panelFullBackground">@color/colorPrimary</item>
|
||||
<item name="android:itemBackground">@color/nc_outcoming_text_default</item>
|
||||
<item name="android:textColor">@color/nc_incoming_text_default</item>
|
||||
<item name="android:textColor">@color/conversation_item_header</item>
|
||||
<item name="android:textColorPrimary">@color/high_emphasis_text</item>
|
||||
<item name="android:textColorSecondary">@color/medium_emphasis_text</item>
|
||||
<item name="android:textColorTertiary">@color/low_emphasis_text</item>
|
||||
<item name="android:popupMenuStyle">@style/appActionBarPopupMenu</item>
|
||||
<item name="actionOverflowMenuStyle">@style/appActionBarPopupMenu</item>
|
||||
<item name="actionBarPopupTheme">@style/appActionBarPopupMenu</item>
|
||||
<item name="android:actionMenuTextAppearance">@style/menuTextAppearance</item>
|
||||
<item name="searchViewStyle">@style/SearchView</item>
|
||||
<item name="android:navigationBarColor">@color/bg_default</item>
|
||||
</style>
|
||||
@ -44,12 +48,12 @@
|
||||
</style>
|
||||
|
||||
<style name="ListItem" parent="BottomSheet.ListItem.TextAppearance">
|
||||
<item name="android:textColor">@color/conversation_item_header</item>
|
||||
<item name="android:textColor">@color/high_emphasis_text</item>
|
||||
<item name="android:textSize">16sp</item>
|
||||
</style>
|
||||
|
||||
<style name="ChipIncomingTextAppearance" parent="TextAppearance.MaterialComponents.Chip">
|
||||
<item name="android:textColor">@color/nc_incoming_text_default</item>
|
||||
<item name="android:textColor">#de000000</item>
|
||||
</style>
|
||||
|
||||
<style name="ChipOutgoingTextAppearance" parent="TextAppearance.MaterialComponents.Chip">
|
||||
@ -65,10 +69,14 @@
|
||||
<item name="android:colorPrimary">@color/fg_inverse</item>
|
||||
<item name="android:textColorSecondary">@color/fontAppbar</item>
|
||||
<item name="android:background">@color/appbar</item>
|
||||
<item name="android:textColor">@color/conversation_item_header</item>
|
||||
<item name="android:textColor">@color/high_emphasis_text</item>
|
||||
<item name="iconTint">@color/fontAppbar</item>
|
||||
</style>
|
||||
|
||||
<style name="menuTextAppearance" parent="TextAppearance.AppCompat.Widget.ActionBar.Menu">
|
||||
<item name="android:textAllCaps">false</item>
|
||||
</style>
|
||||
|
||||
<style name="SearchView" parent="Widget.AppCompat.SearchView">
|
||||
<!-- Close button icon -->
|
||||
<item name="closeIcon">@drawable/ic_close_search</item>
|
||||
|
@ -22,5 +22,5 @@
|
||||
<chip xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:textAppearance="@style/ChipIncomingTextAppearance"
|
||||
app:chipBackgroundColor="@color/white"
|
||||
app:chipBackgroundColor="#deffffff"
|
||||
app:closeIconEnabled="false" />
|
||||
|
Loading…
Reference in New Issue
Block a user