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 🙌: Improvements 🙌:
- New wording for notice when current user is the sender - New wording for notice when current user is the sender
- Hide "X made no changes" event by default in timeline (#1430) - Hide "X made no changes" event by default in timeline (#1430)
- Hide left rooms in breadcrumbs (#766)
Bugfix 🐛: Bugfix 🐛:
- Switch theme is not fully taken into account without restarting the app - 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) - 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 🗣: 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.room.model.create.CreateRoomParams
import im.vector.matrix.android.api.session.sync.SyncState 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.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.JsonDict
import im.vector.matrix.android.api.util.Optional import im.vector.matrix.android.api.util.Optional
import im.vector.matrix.android.api.util.toOptional 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.model.rest.DeviceInfo
import im.vector.matrix.android.internal.crypto.store.PrivateKeysInfo 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.internal.session.sync.model.accountdata.UserAccountDataEvent
import im.vector.matrix.android.api.session.widgets.model.Widget
import io.reactivex.Observable import io.reactivex.Observable
import io.reactivex.Single import io.reactivex.Single
@ -56,10 +56,10 @@ class RxSession(private val session: Session) {
} }
} }
fun liveBreadcrumbs(): Observable<List<RoomSummary>> { fun liveBreadcrumbs(queryParams: RoomSummaryQueryParams): Observable<List<RoomSummary>> {
return session.getBreadcrumbsLive().asObservable() return session.getBreadcrumbsLive(queryParams).asObservable()
.startWithCallable { .startWithCallable {
session.getBreadcrumbs() session.getBreadcrumbs(queryParams)
} }
} }

View file

@ -73,15 +73,17 @@ interface RoomService {
/** /**
* Get a snapshot list of Breadcrumbs * 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] * @return the immutable list of [RoomSummary]
*/ */
fun getBreadcrumbs(): List<RoomSummary> fun getBreadcrumbs(queryParams: RoomSummaryQueryParams): List<RoomSummary>
/** /**
* Get a live list of Breadcrumbs * 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] * @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. * Inform the Matrix SDK that a room is displayed.

View file

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

View file

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

View file

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

View file

@ -2,8 +2,10 @@
<resources> <resources>
<style name="AppTheme.Light.v21" parent="AppTheme.Base.Light"> <style name="AppTheme.Light.v21" parent="AppTheme.Base.Light">
<item name="android:statusBarColor">@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:navigationBarColor">@color/riotx_header_panel_background_light</item> <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 --> <!-- enable window content transitions -->
<item name="android:windowContentTransitions">true</item> <item name="android:windowContentTransitions">true</item>

View file

@ -2,8 +2,10 @@
<resources> <resources>
<style name="AppTheme.Status.v21" parent="AppTheme.Base.Status"> <style name="AppTheme.Status.v21" parent="AppTheme.Base.Status">
<item name="android:statusBarColor">@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:navigationBarColor">@color/riotx_header_panel_background_light</item> <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 --> <!-- enable window content transitions -->
<item name="android:windowContentTransitions">true</item> <item name="android:windowContentTransitions">true</item>

View file

@ -2,6 +2,7 @@
<resources> <resources>
<style name="AppTheme.Light.v23" parent="AppTheme.Light.v21"> <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> <item name="android:windowLightStatusBar">true</item>
</style> </style>

View file

@ -2,7 +2,8 @@
<resources> <resources>
<style name="AppTheme.Status.v23" parent="AppTheme.Status.v21"> <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>
<style name="AppTheme.Status" parent="AppTheme.Status.v23"/> <style name="AppTheme.Status" parent="AppTheme.Status.v23"/>

View file

@ -2,6 +2,7 @@
<resources> <resources>
<style name="AppTheme.Light.v27" parent="AppTheme.Light.v23"> <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> <item name="android:windowLightNavigationBar">true</item>
</style> </style>

View file

@ -2,6 +2,7 @@
<resources> <resources>
<style name="AppTheme.Status.v27" parent="AppTheme.Status.v23"> <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> <item name="android:windowLightNavigationBar">true</item>
</style> </style>