Skip to content

Commit 2c67c01

Browse files
committed
Merge branch 'release/25.04.0' into main
2 parents 612749b + e4661db commit 2c67c01

File tree

834 files changed

+6029
-3462
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

834 files changed

+6029
-3462
lines changed

.github/workflows/nightly_enterprise.yml

-53
This file was deleted.

.github/workflows/pull_request.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Pull Request
22
on:
3-
pull_request:
3+
pull_request_target:
44
types: [ opened, edited, labeled, unlabeled, synchronize ]
55
workflow_call:
66
secrets:

.idea/kotlinc.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGES.md

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
Changes in Element X v25.03.4
2+
=============================
3+
4+
<!-- Release notes generated using configuration in .github/release.yml at v25.03.4 -->
5+
6+
## What's Changed
7+
### 🙌 Improvements
8+
* Change : composer suggestions by @ganfra in https://github.com/element-hq/element-x-android/pull/4485
9+
### 🧱 Build
10+
* Fix flaky incoming verification tests by @jmartinesp in https://github.com/element-hq/element-x-android/pull/4479
11+
### Dependency upgrades
12+
* fix(deps): update dagger to v2.56.1 by @renovate in https://github.com/element-hq/element-x-android/pull/4472
13+
* fix(deps): update dependencyanalysis to v2.13.2 by @renovate in https://github.com/element-hq/element-x-android/pull/4473
14+
* Upgrade embedded EC version to `v0.9.0-rc.4` by @jmartinesp in https://github.com/element-hq/element-x-android/pull/4489
15+
16+
17+
**Full Changelog**: https://github.com/element-hq/element-x-android/compare/v25.03.3...v25.03.4
18+
119
Changes in Element X v25.03.3
220
=============================
321

app/build.gradle.kts

+8-7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import extension.allEnterpriseImpl
2020
import extension.allFeaturesImpl
2121
import extension.allLibrariesImpl
2222
import extension.allServicesImpl
23+
import extension.buildConfigFieldStr
2324
import extension.koverDependencies
2425
import extension.locales
2526
import extension.setupAnvil
@@ -102,7 +103,7 @@ android {
102103
}
103104

104105
val baseAppName = BuildTimeConfig.APPLICATION_NAME
105-
logger.warnInBox("Building $baseAppName")
106+
logger.warnInBox("Building ${defaultConfig.applicationId} ($baseAppName)")
106107

107108
buildTypes {
108109
getByName("debug") {
@@ -170,13 +171,13 @@ android {
170171
create("gplay") {
171172
dimension = "store"
172173
isDefault = true
173-
buildConfigField("String", "SHORT_FLAVOR_DESCRIPTION", "\"G\"")
174-
buildConfigField("String", "FLAVOR_DESCRIPTION", "\"GooglePlay\"")
174+
buildConfigFieldStr("SHORT_FLAVOR_DESCRIPTION", "G")
175+
buildConfigFieldStr("FLAVOR_DESCRIPTION", "GooglePlay")
175176
}
176177
create("fdroid") {
177178
dimension = "store"
178-
buildConfigField("String", "SHORT_FLAVOR_DESCRIPTION", "\"F\"")
179-
buildConfigField("String", "FLAVOR_DESCRIPTION", "\"FDroid\"")
179+
buildConfigFieldStr("SHORT_FLAVOR_DESCRIPTION", "F")
180+
buildConfigFieldStr("FLAVOR_DESCRIPTION", "FDroid")
180181
}
181182
}
182183
}
@@ -291,8 +292,8 @@ tasks.withType<GenerateBuildConfig>().configureEach {
291292
outputs.upToDateWhen { false }
292293
val gitRevision = providers.of(GitRevisionValueSource::class.java) {}.get()
293294
val gitBranchName = providers.of(GitBranchNameValueSource::class.java) {}.get()
294-
android.defaultConfig.buildConfigField("String", "GIT_REVISION", "\"$gitRevision\"")
295-
android.defaultConfig.buildConfigField("String", "GIT_BRANCH_NAME", "\"$gitBranchName\"")
295+
android.defaultConfig.buildConfigFieldStr("GIT_REVISION", gitRevision)
296+
android.defaultConfig.buildConfigFieldStr("GIT_BRANCH_NAME", gitBranchName)
296297
}
297298

298299
licensee {

app/src/main/kotlin/io/element/android/x/ElementXApplication.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ package io.element.android.x
99

1010
import android.app.Application
1111
import androidx.startup.AppInitializer
12+
import io.element.android.appconfig.RageshakeConfig
13+
import io.element.android.appconfig.isEnabled
1214
import io.element.android.features.cachecleaner.api.CacheCleanerInitializer
1315
import io.element.android.libraries.di.DaggerComponentOwner
1416
import io.element.android.x.di.AppComponent
@@ -23,7 +25,9 @@ class ElementXApplication : Application(), DaggerComponentOwner {
2325
override fun onCreate() {
2426
super.onCreate()
2527
AppInitializer.getInstance(this).apply {
26-
initializeComponent(CrashInitializer::class.java)
28+
if (RageshakeConfig.isEnabled) {
29+
initializeComponent(CrashInitializer::class.java)
30+
}
2731
initializeComponent(PlatformInitializer::class.java)
2832
initializeComponent(CacheCleanerInitializer::class.java)
2933
}

app/src/main/kotlin/io/element/android/x/initializer/PlatformInitializer.kt

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class PlatformInitializer : Initializer<Unit> {
3737
writesToFilesConfiguration = defaultWriteToDiskConfiguration(bugReporter),
3838
logLevel = logLevel,
3939
extraTargets = listOf(ELEMENT_X_TARGET),
40+
traceLogPacks = runBlocking { preferencesStore.getTracingLogPacksFlow().first() },
4041
)
4142
bugReporter.setCurrentTracingLogLevel(logLevel.name)
4243
platformService.init(tracingConfiguration)

app/src/main/res/values/colors.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
~ Please see LICENSE files in the repository root for full details.
66
-->
77
<resources>
8-
<!-- Must be equal to DarkDesignTokens.colorThemeBg -->
8+
<!-- Must be equal to DarkColorTokens.colorThemeBg -->
99
<color name="splashscreen_bg_dark">#FF101317</color>
10-
<!-- Must be equal to LightDesignTokens.colorThemeBg -->
10+
<!-- Must be equal to LightColorTokens.colorThemeBg -->
1111
<color name="splashscreen_bg_light">#FFFFFFFF</color>
1212
</resources>

appconfig/build.gradle.kts

+34
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import config.BuildTimeConfig
2+
import extension.buildConfigFieldStr
3+
14
/*
25
* Copyright 2022-2024 New Vector Ltd.
36
*
@@ -10,6 +13,37 @@ plugins {
1013

1114
android {
1215
namespace = "io.element.android.appconfig"
16+
17+
buildFeatures {
18+
buildConfig = true
19+
}
20+
21+
defaultConfig {
22+
buildConfigFieldStr(
23+
name = "URL_POLICY",
24+
value = if (isEnterpriseBuild) {
25+
BuildTimeConfig.URL_POLICY ?: ""
26+
} else {
27+
"https://element.io/cookie-policy"
28+
},
29+
)
30+
buildConfigFieldStr(
31+
name = "BUG_REPORT_URL",
32+
value = if (isEnterpriseBuild) {
33+
BuildTimeConfig.BUG_REPORT_URL ?: ""
34+
} else {
35+
"https://riot.im/bugreports/submit"
36+
},
37+
)
38+
buildConfigFieldStr(
39+
name = "BUG_REPORT_APP_NAME",
40+
value = if (isEnterpriseBuild) {
41+
BuildTimeConfig.BUG_REPORT_APP_NAME ?: ""
42+
} else {
43+
"element-x-android"
44+
},
45+
)
46+
}
1347
}
1448

1549
dependencies {

appconfig/src/main/kotlin/io/element/android/appconfig/AnalyticsConfig.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
package io.element.android.appconfig
99

1010
object AnalyticsConfig {
11-
const val POLICY_LINK = "https://element.io/cookie-policy"
11+
const val POLICY_LINK = BuildConfig.URL_POLICY
1212
}

appconfig/src/main/kotlin/io/element/android/appconfig/RageshakeConfig.kt

+8-2
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,23 @@ object RageshakeConfig {
1111
/**
1212
* The URL to submit bug reports to.
1313
*/
14-
const val BUG_REPORT_URL = "https://riot.im/bugreports/submit"
14+
const val BUG_REPORT_URL = BuildConfig.BUG_REPORT_URL
1515

1616
/**
1717
* As per https://github.com/matrix-org/rageshake:
1818
* Identifier for the application (eg 'riot-web').
1919
* Should correspond to a mapping configured in the configuration file for github issue reporting to work.
2020
*/
21-
const val BUG_REPORT_APP_NAME = "element-x-android"
21+
const val BUG_REPORT_APP_NAME = BuildConfig.BUG_REPORT_APP_NAME
2222

2323
/**
2424
* The maximum size of the upload request. Default value is just below CloudFlare's max request size.
2525
*/
2626
const val MAX_LOG_UPLOAD_SIZE = 50 * 1024 * 1024L
2727
}
28+
29+
/**
30+
* Whether the rageshake feature is enabled.
31+
*/
32+
val RageshakeConfig.isEnabled: Boolean
33+
get() = BUG_REPORT_URL.isNotEmpty() && BUG_REPORT_APP_NAME.isNotEmpty()
Loading

appicon/element/src/main/kotlin/io/element/android/appicon/element/IconPreview.kt

+19-12
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,44 @@ package io.element.android.appicon.element
1010
import androidx.compose.foundation.Image
1111
import androidx.compose.foundation.background
1212
import androidx.compose.foundation.layout.Box
13-
import androidx.compose.foundation.layout.size
1413
import androidx.compose.foundation.shape.CircleShape
15-
import androidx.compose.foundation.shape.RoundedCornerShape
1614
import androidx.compose.runtime.Composable
17-
import androidx.compose.ui.Alignment
1815
import androidx.compose.ui.Modifier
1916
import androidx.compose.ui.draw.clip
2017
import androidx.compose.ui.graphics.Color
2118
import androidx.compose.ui.graphics.ColorFilter
2219
import androidx.compose.ui.res.painterResource
2320
import androidx.compose.ui.tooling.preview.Preview
24-
import androidx.compose.ui.unit.dp
2521

2622
@Preview
2723
@Composable
2824
internal fun IconPreview() {
2925
Box {
30-
Image(painter = painterResource(id = R.mipmap.ic_launcher_background), contentDescription = null)
31-
Image(painter = painterResource(id = R.mipmap.ic_launcher_foreground), contentDescription = null)
26+
Image(
27+
modifier = Modifier.matchParentSize(),
28+
painter = painterResource(id = R.drawable.ic_launcher_background),
29+
contentDescription = null,
30+
)
31+
Image(
32+
painter = painterResource(id = R.mipmap.ic_launcher_foreground),
33+
contentDescription = null,
34+
)
3235
}
3336
}
3437

3538
@Preview
3639
@Composable
3740
internal fun RoundIconPreview() {
3841
Box(modifier = Modifier.clip(shape = CircleShape)) {
39-
Image(painter = painterResource(id = R.mipmap.ic_launcher_background), contentDescription = null)
40-
Image(painter = painterResource(id = R.mipmap.ic_launcher_foreground), contentDescription = null)
42+
Image(
43+
modifier = Modifier.matchParentSize(),
44+
painter = painterResource(id = R.drawable.ic_launcher_background),
45+
contentDescription = null,
46+
)
47+
Image(
48+
painter = painterResource(id = R.mipmap.ic_launcher_foreground),
49+
contentDescription = null,
50+
)
4151
}
4252
}
4353

@@ -46,10 +56,7 @@ internal fun RoundIconPreview() {
4656
internal fun MonochromeIconPreview() {
4757
Box(
4858
modifier = Modifier
49-
.size(108.dp)
50-
.background(Color(0xFF2F3133))
51-
.clip(shape = RoundedCornerShape(32.dp)),
52-
contentAlignment = Alignment.Center
59+
.background(Color(0xFF2F3133)),
5360
) {
5461
Image(
5562
painter = painterResource(id = R.mipmap.ic_launcher_monochrome),
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1-
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
2-
android:src="@mipmap/ic_launcher_background" />
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="108dp"
3+
android:height="108dp"
4+
android:viewportWidth="108"
5+
android:viewportHeight="108">
6+
<path
7+
android:fillColor="#010302"
8+
android:fillType="evenOdd"
9+
android:pathData="m0,0h108v108h-108z" />
10+
</vector>

appnav/src/main/kotlin/io/element/android/appnav/loggedin/LoggedInPresenter.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import io.element.android.libraries.matrix.api.oidc.AccountManagementAction
3030
import io.element.android.libraries.matrix.api.roomlist.RoomListService
3131
import io.element.android.libraries.matrix.api.sync.SlidingSyncVersion
3232
import io.element.android.libraries.matrix.api.sync.SyncService
33-
import io.element.android.libraries.matrix.api.sync.isOnline
3433
import io.element.android.libraries.matrix.api.verification.SessionVerificationService
3534
import io.element.android.libraries.matrix.api.verification.SessionVerifiedStatus
3635
import io.element.android.libraries.push.api.PushService
@@ -79,7 +78,7 @@ class LoggedInPresenter @Inject constructor(
7978
.launchIn(this)
8079
}
8180
val syncIndicator by matrixClient.roomListService.syncIndicator.collectAsState()
82-
val isOnline by syncService.isOnline().collectAsState()
81+
val isOnline by syncService.isOnline.collectAsState()
8382
val showSyncSpinner by remember {
8483
derivedStateOf {
8584
isOnline && syncIndicator == RoomListService.SyncIndicator.Show

appnav/src/main/kotlin/io/element/android/appnav/room/RoomFlowNode.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ import io.element.android.libraries.matrix.api.room.CurrentUserMembership
4949
import io.element.android.libraries.matrix.api.room.RoomMembershipObserver
5050
import io.element.android.libraries.matrix.api.room.alias.ResolvedRoomAlias
5151
import io.element.android.libraries.matrix.api.sync.SyncService
52-
import io.element.android.libraries.matrix.api.sync.isOnline
5352
import kotlinx.coroutines.flow.combine
5453
import kotlinx.coroutines.flow.distinctUntilChanged
5554
import kotlinx.coroutines.flow.first
@@ -211,7 +210,7 @@ class RoomFlowNode @AssistedInject constructor(
211210
}
212211

213212
private fun loadingNode(buildContext: BuildContext) = node(buildContext) { modifier ->
214-
val isOnline by syncService.isOnline().collectAsState()
213+
val isOnline by syncService.isOnline.collectAsState()
215214
LoadingRoomNodeView(
216215
state = LoadingRoomState.Loading,
217216
hasNetworkConnection = isOnline,

appnav/src/main/kotlin/io/element/android/appnav/room/joined/JoinedRoomFlowNode.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import io.element.android.libraries.architecture.inputs
3636
import io.element.android.libraries.di.SessionScope
3737
import io.element.android.libraries.matrix.api.core.RoomId
3838
import io.element.android.libraries.matrix.api.sync.SyncService
39-
import io.element.android.libraries.matrix.api.sync.isOnline
4039
import kotlinx.coroutines.flow.distinctUntilChanged
4140
import kotlinx.coroutines.flow.launchIn
4241
import kotlinx.coroutines.flow.map
@@ -114,7 +113,7 @@ class JoinedRoomFlowNode @AssistedInject constructor(
114113

115114
private fun loadingNode(buildContext: BuildContext, onBackClick: () -> Unit) = node(buildContext) { modifier ->
116115
val loadingRoomState by loadingRoomStateStateFlow.collectAsState()
117-
val isOnline by syncService.isOnline().collectAsState()
116+
val isOnline by syncService.isOnline.collectAsState()
118117
LoadingRoomNodeView(
119118
state = loadingRoomState,
120119
hasNetworkConnection = isOnline,

appnav/src/test/kotlin/io/element/android/appnav/intent/IntentResolverTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ class IntentResolverTest {
241241
}
242242

243243
private fun createIntentResolver(
244-
permalinkParserResult: () -> PermalinkData = { lambdaError() }
244+
permalinkParserResult: (String) -> PermalinkData = { lambdaError() }
245245
): IntentResolver {
246246
return IntentResolver(
247247
deeplinkParser = DeeplinkParser(),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Main changes in this version: bug fixes and improvements.
2+
Full changelog: https://github.com/element-hq/element-x-android/releases

0 commit comments

Comments
 (0)