Skip to content

Commit 2e22d60

Browse files
committed
update support new AS & AGP8
1 parent ca963cc commit 2e22d60

File tree

13 files changed

+117
-25
lines changed

13 files changed

+117
-25
lines changed

.github/workflows/ci.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths-ignore:
8+
- '.idea/**'
9+
- '.gitattributes'
10+
- '.github/**.json'
11+
- '.gitignore'
12+
- '.gitmodules'
13+
- '**.md'
14+
- '**/*.txt'
15+
- '**/*.png'
16+
- '**/*.jpg'
17+
- 'LICENSE'
18+
- 'NOTICE'
19+
pull_request:
20+
paths-ignore:
21+
- '.idea/**'
22+
- '.gitattributes'
23+
- '.github/**.json'
24+
- '.gitignore'
25+
- '.gitmodules'
26+
- '**.md'
27+
- '**/*.txt'
28+
- '**/*.png'
29+
- '**/*.jpg'
30+
- 'LICENSE'
31+
- 'NOTICE'
32+
33+
jobs:
34+
publish:
35+
name: Publish to MavenLocal
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v3
39+
- uses: actions/setup-java@v3
40+
with:
41+
distribution: 'zulu'
42+
java-version: 17
43+
- uses: gradle/gradle-build-action@v2
44+
with:
45+
arguments: publishToMavenLocal
46+
47+
build:
48+
name: Build
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@v3
52+
- uses: actions/setup-java@v3
53+
with:
54+
distribution: 'zulu'
55+
java-version: 17
56+
- uses: gradle/gradle-build-action@v2
57+
with:
58+
arguments: app:assembleDebug

.github/workflows/release.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
release:
10+
name: Github Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-java@v3
15+
with:
16+
distribution: 'zulu'
17+
java-version: 17
18+
- name: Build APK
19+
uses: gradle/gradle-build-action@v2
20+
with:
21+
arguments: app:assembleRelease
22+
- name: Create Release
23+
uses: ncipollo/release-action@v1
24+
with:
25+
artifacts: "app/build/outputs/apk/release/app-release.apk"
26+
token: ${{ secrets.GITHUB_TOKEN }}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565

6666
## 下载
6767

68-
#### Apk下载链接: [Apk下载链接](https://www.pgyer.com/XGtw)
68+
#### Apk下载链接: [Apk下载链接](https://github.com/CarGuo/GSYGithubAppKotlin/releases)
6969

7070

7171
#### Apk二维码

app/build.gradle

+6-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ apply plugin: 'realm-android'
1313
def needCMakeTest = false
1414

1515
android {
16-
compileSdkVersion 31
16+
compileSdkVersion 33
1717
defaultConfig {
1818
applicationId "com.shuyu.github.kotlin"
1919
minSdkVersion 21
20-
targetSdkVersion 30
20+
targetSdkVersion 31
2121
versionCode 10
2222
versionName "1.1.0"
2323
javaCompileOptions {
@@ -138,6 +138,10 @@ android {
138138
packagingOptions {
139139
exclude 'META-INF/library-core_release.kotlin_module'
140140
}
141+
buildFeatures {
142+
aidl true
143+
}
144+
namespace 'com.shuyu.github.kotlin'
141145
}
142146

143147
dependencies {

app/src/main/AndroidManifest.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools"
4-
package="com.shuyu.github.kotlin">
3+
xmlns:tools="http://schemas.android.com/tools">
54

65
<uses-permission android:name="android.permission.INTERNET" />
76
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

app/src/main/java/com/shuyu/github/kotlin/model/AIDLResultModel.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ class AIDLResultModel() : Parcelable {
1818
time = parcel.readLong()
1919
}
2020

21-
override fun writeToParcel(dest: Parcel?, flags: Int) {
22-
dest?.writeString(name)
23-
dest?.writeLong(time)
21+
override fun writeToParcel(dest: Parcel, flags: Int) {
22+
dest.writeString(name)
23+
dest.writeLong(time)
2424
}
2525

2626
override fun describeContents(): Int = 0

app/src/main/java/com/shuyu/github/kotlin/module/login/LoginOAuthWebFragment.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import android.os.Bundle
55
import android.view.View
66
import android.webkit.WebResourceRequest
77
import android.webkit.WebSettings
8+
import android.webkit.WebSettings.LOAD_CACHE_ELSE_NETWORK
89
import android.webkit.WebView
910
import android.webkit.WebViewClient
1011
import androidx.lifecycle.Observer
@@ -67,7 +68,7 @@ class LoginOAuthFragment : BaseFragment<FragmentLoginOauthBinding>() {
6768
settings.displayZoomControls = false
6869
settings.domStorageEnabled = true
6970
settings.layoutAlgorithm = WebSettings.LayoutAlgorithm.NARROW_COLUMNS
70-
settings.setAppCacheEnabled(true)
71+
settings.cacheMode = LOAD_CACHE_ELSE_NETWORK
7172

7273
val webViewClient: WebViewClient = object : WebViewClient() {
7374

app/src/main/java/com/shuyu/github/kotlin/module/main/MainDrawerController.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class MainDrawerController(private val activity: Activity, toolbar: Toolbar,
164164
override fun onSuccess(result: Release?) {
165165
result?.name?.apply {
166166
showUpdateDialog(activity, this, result.body
167-
?: "", "https://www.pgyer.com/XGtw")
167+
?: "", "https://github.com/CarGuo/GSYGithubAppKotlin/releases")
168168
return
169169
}
170170
if (needTip) {

app/src/main/java/com/shuyu/github/kotlin/ui/view/GSYNavigationTabBar.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class GSYNavigationTabBar : NavigationTabBar {
3636

3737
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr)
3838

39-
override fun onTouchEvent(event: MotionEvent?): Boolean {
39+
override fun onTouchEvent(event: MotionEvent): Boolean {
4040

4141
if (!isTouchEnable) {
4242
return true

app/src/main/java/com/shuyu/github/kotlin/ui/view/GSYWebViewContainer.kt

+8-7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import android.util.AttributeSet
77
import android.view.View
88
import android.view.ViewGroup.LayoutParams.MATCH_PARENT
99
import android.webkit.*
10+
import android.webkit.WebSettings.LOAD_CACHE_ELSE_NETWORK
1011
import android.widget.RelativeLayout
1112
import androidx.core.view.setPadding
1213
import com.github.ybq.android.spinkit.SpinKitView
@@ -38,13 +39,13 @@ class GSYWebViewContainer : RelativeLayout {
3839
layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT)
3940

4041
val settings = webView.settings
41-
settings?.javaScriptEnabled = true
42-
settings?.loadWithOverviewMode = true
43-
settings?.builtInZoomControls = false
44-
settings?.displayZoomControls = false
45-
settings?.domStorageEnabled = true
46-
settings?.layoutAlgorithm = WebSettings.LayoutAlgorithm.NARROW_COLUMNS
47-
settings?.setAppCacheEnabled(true)
42+
settings.javaScriptEnabled = true
43+
settings.loadWithOverviewMode = true
44+
settings.builtInZoomControls = false
45+
settings.displayZoomControls = false
46+
settings.domStorageEnabled = true
47+
settings.layoutAlgorithm = WebSettings.LayoutAlgorithm.NARROW_COLUMNS
48+
settings.cacheMode = LOAD_CACHE_ELSE_NETWORK
4849

4950
addView(webView, layoutParams)
5051

build.gradle

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.kotlin_version = '1.5.31'
4+
ext.kotlin_version = '1.6.21'
55
ext.ktx_version = '1.8.0'
66
ext.android_support = '1.1.0-beta01'
77
ext.androidx_appcompat = '1.4.0'
@@ -13,7 +13,7 @@ buildscript {
1313
ext.rx_android = '2.1.1'
1414
ext.event_bus = '3.1.1'
1515
ext.glide_version = '4.8.0'
16-
ext.realm_version = '7.0.0'
16+
ext.realm_version = '10.15.0'
1717
ext.agentweb_version = '4.0.2'
1818
ext.tabbar_version = '1.2.5'
1919
ext.dagger_version = '2.23.2'
@@ -22,12 +22,12 @@ buildscript {
2222
ext.textfiled_box_version = '1.4.5'
2323
ext.lifecycle_version = '1.1.1'
2424
ext.spinkit_version = '1.2.0'
25-
ext.gradle_version = '7.0.3'
25+
ext.gradle_version = '8.0.1'
2626
ext.recycler_common_version = 'v4.0.6'
2727
ext.image_load = '4.9.0'
2828
ext.drop_menu_version = '1.0.4'
29-
ext.arouter_api_versoion = '1.4.0'
30-
ext.arouter_compiler_versoion = '1.2.1'
29+
ext.arouter_api_versoion = '1.5.2'
30+
ext.arouter_compiler_versoion = '1.5.2'
3131
ext.anko_version='0.10.8'
3232
ext.richtext_version='0.19.0'
3333
ext.markwon_version='4.6.2'

gradle.properties

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@ org.gradle.jvmargs=-Xmx1536m
1414

1515
android.useAndroidX=true
1616
android.enableJetifier=true
17-
android.databinding.enableV2=true
17+
android.databinding.enableV2=true
18+
android.defaults.buildfeatures.buildconfig=true
19+
android.nonTransitiveRClass=false
20+
android.nonFinalResIds=false

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip

0 commit comments

Comments
 (0)