Skip to content

Commit c8c75c0

Browse files
authored
Merge pull request #3 from nini22P/main
Update dependencies
2 parents 9fdc3df + d605063 commit c8c75c0

File tree

6 files changed

+23
-21
lines changed

6 files changed

+23
-21
lines changed

.github/workflows/android.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v3
16-
- name: set up JDK 17
17-
uses: actions/setup-java@v3
15+
- uses: actions/checkout@v4
16+
- name: set up JDK 21
17+
uses: actions/setup-java@v4
1818
with:
19-
java-version: '17'
2019
distribution: 'temurin'
20+
java-version: '21'
2121
cache: gradle
2222
- name: Replace the demo link
2323
run: sed -i 's/https:\/\/appassets.androidplatform.net\/assets\/webgal\/index.html/https:\/\/demo.openwebgal.com\//g' app/src/main/res/values/values.xml
@@ -30,7 +30,7 @@ jobs:
3030
- name: Rename debug apk
3131
run: mv app/build/outputs/apk/debug/app-debug.apk webgal-$GITHUB_RUN_NUMBER-debug.apk
3232
- name: Upload debug apk
33-
uses: actions/upload-artifact@v3
33+
uses: actions/upload-artifact@v4
3434
with:
3535
name: webgal-${{ github.run_number }}-debug.apk
3636
path: webgal-${{ github.run_number }}-debug.apk

app/build.gradle

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55

66
android {
77
namespace 'com.openwebgal.demo'
8-
compileSdk 34
8+
compileSdk 35
99

1010
defaultConfig {
1111
applicationId "com.openwebgal.demo"
@@ -42,13 +42,13 @@ android {
4242

4343
dependencies {
4444

45-
implementation 'androidx.core:core-ktx:1.12.0'
46-
implementation 'androidx.appcompat:appcompat:1.6.1'
47-
implementation 'com.google.android.material:material:1.10.0'
48-
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
49-
implementation 'androidx.webkit:webkit:1.8.0'
50-
implementation 'androidx.browser:browser:1.6.0'
45+
implementation 'androidx.core:core-ktx:1.15.0'
46+
implementation 'androidx.appcompat:appcompat:1.7.0'
47+
implementation 'com.google.android.material:material:1.12.0'
48+
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
49+
implementation 'androidx.webkit:webkit:1.13.0'
50+
implementation 'androidx.browser:browser:1.8.0'
5151
testImplementation 'junit:junit:4.13.2'
52-
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
53-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
52+
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
53+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
5454
}

app/src/main/java/com/openwebgal/demo/MainActivity.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import androidx.browser.customtabs.CustomTabsIntent
2020
import androidx.webkit.WebViewAssetLoader
2121
import androidx.webkit.WebViewAssetLoader.AssetsPathHandler
2222
import androidx.webkit.WebViewClientCompat
23+
import androidx.core.graphics.createBitmap
24+
import androidx.core.net.toUri
2325

2426
class MainActivity : AppCompatActivity() {
2527

@@ -55,7 +57,8 @@ class MainActivity : AppCompatActivity() {
5557
webView: WebView,
5658
request: WebResourceRequest
5759
): WebResourceResponse? {
58-
val interceptedRequest = assetLoader.shouldInterceptRequest(Uri.parse(Uri.decode(request.url.toString())))
60+
val interceptedRequest = assetLoader.shouldInterceptRequest(
61+
Uri.decode(request.url.toString()).toUri())
5962
interceptedRequest?.let {
6063
if (request.url.toString().endsWith("js", true)) {
6164
it.mimeType = "text/javascript"
@@ -97,7 +100,7 @@ class MainActivity : AppCompatActivity() {
97100

98101
//移除默认播放海报
99102
override fun getDefaultVideoPoster(): Bitmap? {
100-
return Bitmap.createBitmap(10, 10, Bitmap.Config.ARGB_8888)
103+
return createBitmap(10, 10)
101104
}
102105
}
103106
}

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
plugins {
3-
id 'com.android.application' version '8.2.0' apply false
4-
id 'com.android.library' version '8.2.0' apply false
5-
id 'org.jetbrains.kotlin.android' version '1.8.0' apply false
3+
id 'com.android.application' version '8.9.0' apply false
4+
id 'com.android.library' version '8.9.0' apply false
5+
id 'org.jetbrains.kotlin.android' version '2.1.10' apply false
66
}

gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,4 @@ kotlin.code.style=official
2121
# resources declared in the library itself and none from the library's dependencies,
2222
# thereby reducing the size of the R class for that library
2323
android.nonTransitiveRClass=true
24-
android.defaults.buildfeatures.buildconfig=true
2524
android.nonFinalResIds=false
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Fri Feb 03 09:54:54 CST 2023
22
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
44
distributionPath=wrapper/dists
55
zipStorePath=wrapper/dists
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)