Merge branch 'develop' into feature/power_level

This commit is contained in:
ganfra 2020-06-08 10:12:53 +02:00
commit 0002cddd67
12 changed files with 40 additions and 20 deletions

View File

@ -8,10 +8,14 @@ Features ✨:
Improvements 🙌:
- New wording for notice when current user is the sender
- Hide "X made no changes" event by default in timeline (#1430)
- Hide left rooms in breadcrumbs (#766)
Bugfix 🐛:
- Switch theme is not fully taken into account without restarting the app
- Temporary fix to show error when user is creating an account on matrix.org with userId containing only digits (#1410)
- Reply composer overlay stays on screen too long after send (#1169)
- Fix navigation bar icon contrast on API in [21,27[ (#1342)
- Fix status bar icon contrast on API in [21,23[
Translations 🗣:
-

View File

@ -29,6 +29,7 @@ import im.vector.matrix.android.api.session.room.model.RoomSummary
import im.vector.matrix.android.api.session.room.model.create.CreateRoomParams
import im.vector.matrix.android.api.session.sync.SyncState
import im.vector.matrix.android.api.session.user.model.User
import im.vector.matrix.android.api.session.widgets.model.Widget
import im.vector.matrix.android.api.util.JsonDict
import im.vector.matrix.android.api.util.Optional
import im.vector.matrix.android.api.util.toOptional
@ -36,7 +37,6 @@ import im.vector.matrix.android.internal.crypto.model.CryptoDeviceInfo
import im.vector.matrix.android.internal.crypto.model.rest.DeviceInfo
import im.vector.matrix.android.internal.crypto.store.PrivateKeysInfo
import im.vector.matrix.android.internal.session.sync.model.accountdata.UserAccountDataEvent
import im.vector.matrix.android.api.session.widgets.model.Widget
import io.reactivex.Observable
import io.reactivex.Single
@ -56,10 +56,10 @@ class RxSession(private val session: Session) {
}
}
fun liveBreadcrumbs(): Observable<List<RoomSummary>> {
return session.getBreadcrumbsLive().asObservable()
fun liveBreadcrumbs(queryParams: RoomSummaryQueryParams): Observable<List<RoomSummary>> {
return session.getBreadcrumbsLive(queryParams).asObservable()
.startWithCallable {
session.getBreadcrumbs()
session.getBreadcrumbs(queryParams)
}
}

View File

@ -73,15 +73,17 @@ interface RoomService {
/**
* Get a snapshot list of Breadcrumbs
* @param queryParams parameters to query the room summaries. It can be use to keep only joined rooms, for instance.
* @return the immutable list of [RoomSummary]
*/
fun getBreadcrumbs(): List<RoomSummary>
fun getBreadcrumbs(queryParams: RoomSummaryQueryParams): List<RoomSummary>
/**
* Get a live list of Breadcrumbs
* @param queryParams parameters to query the room summaries. It can be use to keep only joined rooms, for instance.
* @return the [LiveData] of [RoomSummary]
*/
fun getBreadcrumbsLive(): LiveData<List<RoomSummary>>
fun getBreadcrumbsLive(queryParams: RoomSummaryQueryParams): LiveData<List<RoomSummary>>
/**
* Inform the Matrix SDK that a room is displayed.

View File

@ -111,24 +111,22 @@ internal class DefaultRoomService @Inject constructor(
return query
}
override fun getBreadcrumbs(): List<RoomSummary> {
override fun getBreadcrumbs(queryParams: RoomSummaryQueryParams): List<RoomSummary> {
return monarchy.fetchAllMappedSync(
{ breadcrumbsQuery(it) },
{ breadcrumbsQuery(it, queryParams) },
{ roomSummaryMapper.map(it) }
)
}
override fun getBreadcrumbsLive(): LiveData<List<RoomSummary>> {
override fun getBreadcrumbsLive(queryParams: RoomSummaryQueryParams): LiveData<List<RoomSummary>> {
return monarchy.findAllMappedWithChanges(
{ breadcrumbsQuery(it) },
{ breadcrumbsQuery(it, queryParams) },
{ roomSummaryMapper.map(it) }
)
}
private fun breadcrumbsQuery(realm: Realm): RealmQuery<RoomSummaryEntity> {
return RoomSummaryEntity.where(realm)
.isNotEmpty(RoomSummaryEntityFields.DISPLAY_NAME)
.notEqualTo(RoomSummaryEntityFields.VERSIONING_STATE_STR, VersioningState.UPGRADED_ROOM_JOINED.name)
private fun breadcrumbsQuery(realm: Realm, queryParams: RoomSummaryQueryParams): RealmQuery<RoomSummaryEntity> {
return roomSummariesQuery(realm, queryParams)
.greaterThan(RoomSummaryEntityFields.BREADCRUMBS_INDEX, RoomSummary.NOT_IN_BREADCRUMBS)
.sort(RoomSummaryEntityFields.BREADCRUMBS_INDEX)
}

View File

@ -21,7 +21,10 @@ import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.ViewModelContext
import com.squareup.inject.assisted.Assisted
import com.squareup.inject.assisted.AssistedInject
import im.vector.matrix.android.api.query.QueryStringValue
import im.vector.matrix.android.api.session.Session
import im.vector.matrix.android.api.session.room.model.Membership
import im.vector.matrix.android.api.session.room.roomSummaryQueryParams
import im.vector.matrix.rx.rx
import im.vector.riotx.core.platform.EmptyAction
import im.vector.riotx.core.platform.EmptyViewEvents
@ -58,7 +61,10 @@ class BreadcrumbsViewModel @AssistedInject constructor(@Assisted initialState: B
private fun observeBreadcrumbs() {
session.rx()
.liveBreadcrumbs()
.liveBreadcrumbs(roomSummaryQueryParams {
displayName = QueryStringValue.NoCondition
memberships = listOf(Membership.JOIN)
})
.observeOn(Schedulers.computation())
.execute { asyncBreadcrumbs ->
copy(asyncBreadcrumbs = asyncBreadcrumbs)

View File

@ -682,6 +682,8 @@ class RoomDetailFragment @Inject constructor(
return
}
if (text.isNotBlank()) {
// We collapse ASAP, if not there will be a slight anoying delay
composerLayout.collapse(true)
lockSendButton = true
roomDetailViewModel.handle(RoomDetailAction.SendMessage(text, vectorPreferences.isMarkdownEnabled()))
}

View File

@ -2,8 +2,10 @@
<resources>
<style name="AppTheme.Light.v21" parent="AppTheme.Base.Light">
<item name="android:statusBarColor">@color/riotx_header_panel_background_light</item>
<item name="android:navigationBarColor">@color/riotx_header_panel_background_light</item>
<!-- Use dark color, to have enough contrast with icons color. windowLightStatusBar is only available in API 23+ -->
<item name="android:statusBarColor">@color/riotx_header_panel_background_dark</item>
<!-- Use dark color, to have enough contrast with icons color. windowLightNavigationBar is only available in API 27+ -->
<item name="android:navigationBarColor">@color/riotx_header_panel_background_dark</item>
<!-- enable window content transitions -->
<item name="android:windowContentTransitions">true</item>

View File

@ -2,8 +2,10 @@
<resources>
<style name="AppTheme.Status.v21" parent="AppTheme.Base.Status">
<item name="android:statusBarColor">@color/riotx_header_panel_background_light</item>
<item name="android:navigationBarColor">@color/riotx_header_panel_background_light</item>
<!-- Use dark color, to have enough contrast with icons color. windowLightStatusBar is only available in API 23+ -->
<item name="android:statusBarColor">@color/riotx_header_panel_background_dark</item>
<!-- Use dark color, to have enough contrast with icons color. windowLightNavigationBar is only available in API 27+ -->
<item name="android:navigationBarColor">@color/riotx_header_panel_background_dark</item>
<!-- enable window content transitions -->
<item name="android:windowContentTransitions">true</item>

View File

@ -2,6 +2,7 @@
<resources>
<style name="AppTheme.Light.v23" parent="AppTheme.Light.v21">
<item name="android:statusBarColor">@color/riotx_header_panel_background_light</item>
<item name="android:windowLightStatusBar">true</item>
</style>

View File

@ -2,7 +2,8 @@
<resources>
<style name="AppTheme.Status.v23" parent="AppTheme.Status.v21">
<item name="android:windowLightStatusBar">false</item>
<item name="android:statusBarColor">@color/riotx_header_panel_background_light</item>
<item name="android:windowLightStatusBar">true</item>
</style>
<style name="AppTheme.Status" parent="AppTheme.Status.v23"/>

View File

@ -2,6 +2,7 @@
<resources>
<style name="AppTheme.Light.v27" parent="AppTheme.Light.v23">
<item name="android:navigationBarColor">@color/riotx_header_panel_background_light</item>
<item name="android:windowLightNavigationBar">true</item>
</style>

View File

@ -2,6 +2,7 @@
<resources>
<style name="AppTheme.Status.v27" parent="AppTheme.Status.v23">
<item name="android:navigationBarColor">@color/riotx_header_panel_background_light</item>
<item name="android:windowLightNavigationBar">true</item>
</style>