Skip to content

Commit 3574a31

Browse files
authored
Merge branch 'main' into Search-dynamic
2 parents 0297549 + b8ebcbc commit 3574a31

File tree

46 files changed

+882
-143
lines changed

Some content is hidden

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

46 files changed

+882
-143
lines changed

.github/workflows/android.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v5
12-
- uses: actions/setup-java@v4
12+
- uses: actions/setup-java@v5
1313
with:
1414
distribution: 'temurin'
1515
java-version: '17'
@@ -48,7 +48,7 @@ jobs:
4848
- name: Sleep for 30 seconds, to allow the tag to be deleted
4949
run: sleep 30s
5050
shell: bash
51-
- uses: ncipollo/release-action@v1.18.0
51+
- uses: ncipollo/release-action@v1.19.1
5252
name: Create new tag and release and upload artifacts
5353
with:
5454
name: latest

.github/workflows/android_branch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v5
13-
- uses: actions/setup-java@v4
13+
- uses: actions/setup-java@v5
1414
with:
1515
distribution: 'temurin'
1616
java-version: '17'

.github/workflows/android_offline_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v5
15-
- uses: actions/setup-java@v4
15+
- uses: actions/setup-java@v5
1616
with:
1717
distribution: 'temurin'
1818
java-version: '17'

.github/workflows/android_pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v5
1313
- uses: gradle/actions/wrapper-validation@v4
14-
- uses: actions/setup-java@v4
14+
- uses: actions/setup-java@v5
1515
with:
1616
distribution: 'temurin'
1717
java-version: '17'

.github/workflows/android_smoke_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v5
15-
- uses: actions/setup-java@v4
15+
- uses: actions/setup-java@v5
1616
with:
1717
distribution: 'temurin'
1818
java-version: '17'

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ android {
4040
applicationId 'org.wikipedia'
4141
minSdk = 21
4242
targetSdk = 36
43-
versionCode 50545
43+
versionCode 50546
4444
testApplicationId 'org.wikipedia.test'
4545
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4646
testInstrumentationRunnerArguments clearPackageData: 'true'

app/src/main/java/org/wikipedia/analytics/eventplatform/EventPlatformClient.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import kotlinx.coroutines.CoroutineExceptionHandler
66
import kotlinx.coroutines.CoroutineScope
77
import kotlinx.coroutines.Dispatchers
88
import kotlinx.coroutines.MainScope
9+
import kotlinx.coroutines.SupervisorJob
910
import kotlinx.coroutines.launch
1011
import org.wikipedia.BuildConfig
1112
import org.wikipedia.WikipediaApp
@@ -41,7 +42,7 @@ object EventPlatformClient {
4142
*/
4243
private var ENABLED = WikipediaApp.instance.isOnline
4344

44-
private val coroutineScope = CoroutineScope(Dispatchers.IO)
45+
private val coroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
4546

4647
fun setStreamConfig(streamConfig: StreamConfig) {
4748
STREAM_CONFIGS[streamConfig.streamName] = streamConfig

app/src/main/java/org/wikipedia/bridge/CommunicationBridge.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class CommunicationBridge constructor(private val communicationBridgeListener: C
7979
pendingJSMessages.clear()
8080
pendingEvals.clear()
8181
if (communicationBridgeListener.model.shouldLoadAsMobileWeb) {
82-
communicationBridgeListener.webView.loadUrl(pageTitle.mobileUri)
82+
communicationBridgeListener.webView.loadUrl(pageTitle.uri)
8383
} else {
8484
communicationBridgeListener.webView.loadUrl(ServiceFactory.getRestBasePath(pageTitle.wikiSite) +
8585
RestService.PAGE_HTML_ENDPOINT + UriUtil.encodeURL(pageTitle.prefixedText))

app/src/main/java/org/wikipedia/bridge/JavaScriptActionHandler.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ import kotlin.math.roundToInt
2121
object JavaScriptActionHandler {
2222

2323
fun setTopMargin(top: Int): String {
24-
return setMargins(16, top + 16, 16, 48)
24+
return setMargins(top + 16, 48)
2525
}
2626

27-
fun setMargins(left: Int, top: Int, right: Int, bottom: Int): String {
28-
return "pcs.c1.Page.setMargins({ top:'${top}px', right:'${right}px', bottom:'${bottom}px', left:'${left}px' })"
27+
fun setMargins(top: Int, bottom: Int): String {
28+
return "pcs.c1.Page.setMargins({ top:'${top}px', bottom:'${bottom}px' })"
2929
}
3030

3131
fun getTextSelection(): String {
@@ -104,14 +104,14 @@ object JavaScriptActionHandler {
104104
" \"theme\": \"${app.currentTheme.tag}\"," +
105105
" \"bodyFont\": \"$fontFamily\"," +
106106
" \"dimImages\": ${(app.currentTheme.isDark && Prefs.dimDarkModeImages)}," +
107-
" \"margins\": { \"top\": \"%dpx\", \"right\": \"%dpx\", \"bottom\": \"%dpx\", \"left\": \"%dpx\" }," +
107+
" \"margins\": { \"top\": \"%dpx\", \"bottom\": \"%dpx\" }," +
108108
" \"leadImageHeight\": \"%dpx\"," +
109109
" \"areTablesInitiallyExpanded\": ${isPreview || !Prefs.isCollapseTablesEnabled}," +
110110
" \"textSizeAdjustmentPercentage\": \"100%%\"," +
111111
" \"loadImages\": ${Prefs.isImageDownloadEnabled}," +
112112
" \"userGroups\": ${JsonUtil.encodeToString(AccountUtil.groups)}," +
113113
" \"isEditable\": ${!Prefs.readingFocusModeEnabled}" +
114-
"}", topMargin, 16, 48, 16, leadImageHeight)
114+
"}", topMargin, 48, leadImageHeight)
115115
}
116116

117117
fun setUpEditButtons(isEditable: Boolean, isProtected: Boolean): String {

app/src/main/java/org/wikipedia/compose/components/WikiCard.kt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import androidx.compose.foundation.BorderStroke
44
import androidx.compose.foundation.Image
55
import androidx.compose.foundation.clickable
66
import androidx.compose.foundation.layout.Arrangement
7+
import androidx.compose.foundation.layout.Box
78
import androidx.compose.foundation.layout.Column
89
import androidx.compose.foundation.layout.ExperimentalLayoutApi
910
import androidx.compose.foundation.layout.FlowRow
@@ -38,6 +39,7 @@ fun WikiCard(
3839
contentColor = WikipediaTheme.colors.paperColor
3940
),
4041
border: BorderStroke? = null,
42+
onClick: (() -> Unit)? = null,
4143
shape: Shape = RoundedCornerShape(12.dp),
4244
content: @Composable () -> Unit
4345
) {
@@ -57,7 +59,14 @@ fun WikiCard(
5759
border = border,
5860
shape = shape
5961
) {
60-
content()
62+
Box(
63+
modifier = Modifier
64+
.clickable(enabled = onClick != null) {
65+
onClick?.invoke()
66+
}
67+
) {
68+
content()
69+
}
6170
}
6271
}
6372

@@ -75,14 +84,12 @@ fun MessageCard(
7584
onContainerClick: (() -> Unit)? = null
7685
) {
7786
WikiCard(
78-
modifier = modifier
87+
modifier = modifier,
88+
onClick = onContainerClick
7989
) {
8090
Column(
8191
modifier = Modifier
82-
.fillMaxWidth()
83-
.clickable(enabled = onContainerClick != null) {
84-
onContainerClick?.invoke()
85-
}
92+
.fillMaxWidth()
8693
) {
8794
Column(
8895
modifier = Modifier

0 commit comments

Comments
 (0)