diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/group/GroupService.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/group/GroupService.kt index 76bac1ae1a..c01e5b5cd8 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/group/GroupService.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/group/GroupService.kt @@ -39,7 +39,7 @@ interface GroupService { fun getGroupSummary(groupId: String): GroupSummary? /** - * Get a list of group summaries.This list is a snapshot of the data. + * Get a list of group summaries. This list is a snapshot of the data. * @return the list of [GroupSummary] */ fun getGroupSummaries(groupSummaryQueryParams: GroupSummaryQueryParams): List diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/relation/RelationService.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/relation/RelationService.kt index d13d7db773..31ed4e9986 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/relation/RelationService.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/relation/RelationService.kt @@ -116,7 +116,7 @@ interface RelationService { fun getEventAnnotationsSummary(eventId: String): EventAnnotationsSummary? /** - * Get the a LiveData EventAnnotationsSummary + * Get a LiveData of EventAnnotationsSummary for the specified eventId * @param eventId the eventId to look for EventAnnotationsSummary * @return the LiveData of EventAnnotationsSummary */ diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/query/QueryEnumListProcessor.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/query/QueryEnumListProcessor.kt index 7cb5ca1047..2bc05eacec 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/query/QueryEnumListProcessor.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/query/QueryEnumListProcessor.kt @@ -21,13 +21,13 @@ import io.realm.RealmQuery fun > RealmQuery.process(field: String, enums: List>): RealmQuery { val lastEnumValue = enums.lastOrNull() - this.beginGroup() + beginGroup() for (enumValue in enums) { - this.equalTo(field, enumValue.name) + equalTo(field, enumValue.name) if (enumValue != lastEnumValue) { - this.or() + or() } } - this.endGroup() + endGroup() return this } diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/query/QueryStringValueProcessor.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/query/QueryStringValueProcessor.kt index d2418ee84f..ebe10cad9c 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/query/QueryStringValueProcessor.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/query/QueryStringValueProcessor.kt @@ -25,16 +25,12 @@ import timber.log.Timber fun RealmQuery.process(field: String, queryStringValue: QueryStringValue): RealmQuery { when (queryStringValue) { is QueryStringValue.NoCondition -> Timber.v("No condition to process") - is QueryStringValue.IsNotNull -> this.isNotNull(field) - is QueryStringValue.IsNull -> this.isNull(field) - is QueryStringValue.IsEmpty -> this.isEmpty(field) - is QueryStringValue.IsNotEmpty -> this.isNotEmpty(field) - is QueryStringValue.Equals -> { - this.equalTo(field, queryStringValue.string, queryStringValue.case.toRealmCase()) - } - is QueryStringValue.Contains -> { - this.contains(field, queryStringValue.string, queryStringValue.case.toRealmCase()) - } + is QueryStringValue.IsNotNull -> isNotNull(field) + is QueryStringValue.IsNull -> isNull(field) + is QueryStringValue.IsEmpty -> isEmpty(field) + is QueryStringValue.IsNotEmpty -> isNotEmpty(field) + is QueryStringValue.Equals -> equalTo(field, queryStringValue.string, queryStringValue.case.toRealmCase()) + is QueryStringValue.Contains -> contains(field, queryStringValue.string, queryStringValue.case.toRealmCase()) } return this } @@ -42,6 +38,6 @@ fun RealmQuery.process(field: String, queryStringValue: Que private fun QueryStringValue.Case.toRealmCase(): Case { return when (this) { QueryStringValue.Case.INSENSITIVE -> Case.INSENSITIVE - QueryStringValue.Case.SENSITIVE -> Case.SENSITIVE + QueryStringValue.Case.SENSITIVE -> Case.SENSITIVE } } diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/membership/RoomMemberEventHandler.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/membership/RoomMemberEventHandler.kt index 16d6aacbc9..9bd97cec10 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/membership/RoomMemberEventHandler.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/membership/RoomMemberEventHandler.kt @@ -35,7 +35,7 @@ internal class RoomMemberEventHandler @Inject constructor() { val userId = event.stateKey ?: return false val roomMemberEntity = RoomMemberEntityFactory.create(roomId, userId, roomMember) realm.insertOrUpdate(roomMemberEntity) - if (roomMember.membership == Membership.JOIN || roomMember.membership == Membership.INVITE) { + if (roomMember.membership in Membership.activeMemberships()) { val userEntity = UserEntityFactory.create(userId, roomMember) realm.insertOrUpdate(userEntity) } diff --git a/vector/src/main/java/im/vector/riotx/features/autocomplete/group/AutocompleteGroupPresenter.kt b/vector/src/main/java/im/vector/riotx/features/autocomplete/group/AutocompleteGroupPresenter.kt index 8a726a81b1..b6f45b477c 100644 --- a/vector/src/main/java/im/vector/riotx/features/autocomplete/group/AutocompleteGroupPresenter.kt +++ b/vector/src/main/java/im/vector/riotx/features/autocomplete/group/AutocompleteGroupPresenter.kt @@ -18,7 +18,6 @@ package im.vector.riotx.features.autocomplete.group import android.content.Context import androidx.recyclerview.widget.RecyclerView -import com.airbnb.mvrx.Async import com.otaliastudios.autocomplete.RecyclerViewPresenter import im.vector.matrix.android.api.query.QueryStringValue import im.vector.matrix.android.api.session.Session @@ -59,8 +58,4 @@ class AutocompleteGroupPresenter @Inject constructor(context: Context, .sortedBy { it.displayName } controller.setData(groups.toList()) } - - fun render(groups: Async>) { - controller.setData(groups()) - } } diff --git a/vector/src/main/java/im/vector/riotx/features/autocomplete/member/AutocompleteMemberPresenter.kt b/vector/src/main/java/im/vector/riotx/features/autocomplete/member/AutocompleteMemberPresenter.kt index 5bf573ecb1..84a33173b8 100644 --- a/vector/src/main/java/im/vector/riotx/features/autocomplete/member/AutocompleteMemberPresenter.kt +++ b/vector/src/main/java/im/vector/riotx/features/autocomplete/member/AutocompleteMemberPresenter.kt @@ -18,8 +18,6 @@ package im.vector.riotx.features.autocomplete.member import android.content.Context import androidx.recyclerview.widget.RecyclerView -import com.airbnb.mvrx.Async -import com.airbnb.mvrx.Success import com.otaliastudios.autocomplete.RecyclerViewPresenter import com.squareup.inject.assisted.Assisted import com.squareup.inject.assisted.AssistedInject @@ -71,10 +69,4 @@ class AutocompleteMemberPresenter @AssistedInject constructor(context: Context, .sortedBy { it.displayName } controller.setData(members.toList()) } - - fun render(members: Async>) { - if (members is Success) { - controller.setData(members()) - } - } } diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/AutoCompleter.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/AutoCompleter.kt index 6ae937fed2..7ca647ea3e 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/AutoCompleter.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/AutoCompleter.kt @@ -50,7 +50,7 @@ class AutoCompleter @AssistedInject constructor( private val avatarRenderer: AvatarRenderer, private val commandAutocompletePolicy: CommandAutocompletePolicy, private val autocompleteCommandPresenter: AutocompleteCommandPresenter, - private val autocompleteMemberPresenter: AutocompleteMemberPresenter.Factory, + private val autocompleteMemberPresenterFactory: AutocompleteMemberPresenter.Factory, private val autocompleteRoomPresenter: AutocompleteRoomPresenter, private val autocompleteGroupPresenter: AutocompleteGroupPresenter, private val autocompleteEmojiPresenter: AutocompleteEmojiPresenter @@ -107,10 +107,10 @@ class AutoCompleter @AssistedInject constructor( } private fun setupMembers(backgroundDrawable: ColorDrawable, editText: EditText) { - val membersPresenter = autocompleteMemberPresenter.create(roomId) + val autocompleteMemberPresenter = autocompleteMemberPresenterFactory.create(roomId) Autocomplete.on(editText) .with(CharPolicy('@', true)) - .with(membersPresenter) + .with(autocompleteMemberPresenter) .with(ELEVATION) .with(backgroundDrawable) .with(object : AutocompleteCallback { diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/BaseEventItem.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/BaseEventItem.kt index 5db87fff0f..02b7341c72 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/BaseEventItem.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/BaseEventItem.kt @@ -27,7 +27,6 @@ import im.vector.riotx.core.epoxy.VectorEpoxyModel import im.vector.riotx.core.platform.CheckableView import im.vector.riotx.core.ui.views.ReadReceiptsView import im.vector.riotx.core.utils.DimensionConverter -import kotlinx.coroutines.* /** * Children must override getViewType() diff --git a/vector/src/main/java/im/vector/riotx/features/settings/VectorPreferences.kt b/vector/src/main/java/im/vector/riotx/features/settings/VectorPreferences.kt index 774e3741e6..0ec67789fe 100755 --- a/vector/src/main/java/im/vector/riotx/features/settings/VectorPreferences.kt +++ b/vector/src/main/java/im/vector/riotx/features/settings/VectorPreferences.kt @@ -398,7 +398,7 @@ class VectorPreferences @Inject constructor(private val context: Context) { fun getNotificationRingTone(): Uri? { val url = defaultPrefs.getString(SETTINGS_NOTIFICATION_RINGTONE_PREFERENCE_KEY, null) - // the user selects "NoCondition" + // the user selects "None" if (url == "") { return null } @@ -425,7 +425,7 @@ class VectorPreferences @Inject constructor(private val context: Context) { /** * Provide the notification ringtone filename * - * @return the filename or null if "NoCondition" is selected + * @return the filename or null if "None" is selected */ fun getNotificationRingToneName(): String? { val toneUri = getNotificationRingTone() ?: return null diff --git a/vector/src/main/res/layout/item_bottom_sheet_action.xml b/vector/src/main/res/layout/item_bottom_sheet_action.xml index db01db0a2f..66a096799d 100644 --- a/vector/src/main/res/layout/item_bottom_sheet_action.xml +++ b/vector/src/main/res/layout/item_bottom_sheet_action.xml @@ -47,12 +47,12 @@ android:maxLines="2" android:textColor="?riotx_text_secondary" android:textSize="17sp" + app:layout_constrainedWidth="true" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/actionSelected" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toEndOf="@id/actionStartSpace" app:layout_constraintTop_toTopOf="parent" - app:layout_constrainedWidth="true" tools:text="zbla azjazjaz s sdkqdskdsqk kqsdkdqsk kdqsksqdk" />