Skip to content

Commit

Permalink
update support new AS & AGP8
Browse files Browse the repository at this point in the history
  • Loading branch information
CarGuo committed May 25, 2023
1 parent ca963cc commit 2e22d60
Show file tree
Hide file tree
Showing 13 changed files with 117 additions and 25 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI

on:
push:
branches:
- master
paths-ignore:
- '.idea/**'
- '.gitattributes'
- '.github/**.json'
- '.gitignore'
- '.gitmodules'
- '**.md'
- '**/*.txt'
- '**/*.png'
- '**/*.jpg'
- 'LICENSE'
- 'NOTICE'
pull_request:
paths-ignore:
- '.idea/**'
- '.gitattributes'
- '.github/**.json'
- '.gitignore'
- '.gitmodules'
- '**.md'
- '**/*.txt'
- '**/*.png'
- '**/*.jpg'
- 'LICENSE'
- 'NOTICE'

jobs:
publish:
name: Publish to MavenLocal
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- uses: gradle/gradle-build-action@v2
with:
arguments: publishToMavenLocal

build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- uses: gradle/gradle-build-action@v2
with:
arguments: app:assembleDebug
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release

on:
push:
tags:
- '*'

jobs:
release:
name: Github Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- name: Build APK
uses: gradle/gradle-build-action@v2
with:
arguments: app:assembleRelease
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "app/build/outputs/apk/release/app-release.apk"
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

## 下载

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


#### Apk二维码
Expand Down
8 changes: 6 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ apply plugin: 'realm-android'
def needCMakeTest = false

android {
compileSdkVersion 31
compileSdkVersion 33
defaultConfig {
applicationId "com.shuyu.github.kotlin"
minSdkVersion 21
targetSdkVersion 30
targetSdkVersion 31
versionCode 10
versionName "1.1.0"
javaCompileOptions {
Expand Down Expand Up @@ -138,6 +138,10 @@ android {
packagingOptions {
exclude 'META-INF/library-core_release.kotlin_module'
}
buildFeatures {
aidl true
}
namespace 'com.shuyu.github.kotlin'
}

dependencies {
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.shuyu.github.kotlin">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ class AIDLResultModel() : Parcelable {
time = parcel.readLong()
}

override fun writeToParcel(dest: Parcel?, flags: Int) {
dest?.writeString(name)
dest?.writeLong(time)
override fun writeToParcel(dest: Parcel, flags: Int) {
dest.writeString(name)
dest.writeLong(time)
}

override fun describeContents(): Int = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.os.Bundle
import android.view.View
import android.webkit.WebResourceRequest
import android.webkit.WebSettings
import android.webkit.WebSettings.LOAD_CACHE_ELSE_NETWORK
import android.webkit.WebView
import android.webkit.WebViewClient
import androidx.lifecycle.Observer
Expand Down Expand Up @@ -67,7 +68,7 @@ class LoginOAuthFragment : BaseFragment<FragmentLoginOauthBinding>() {
settings.displayZoomControls = false
settings.domStorageEnabled = true
settings.layoutAlgorithm = WebSettings.LayoutAlgorithm.NARROW_COLUMNS
settings.setAppCacheEnabled(true)
settings.cacheMode = LOAD_CACHE_ELSE_NETWORK

val webViewClient: WebViewClient = object : WebViewClient() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class MainDrawerController(private val activity: Activity, toolbar: Toolbar,
override fun onSuccess(result: Release?) {
result?.name?.apply {
showUpdateDialog(activity, this, result.body
?: "", "https://www.pgyer.com/XGtw")
?: "", "https://github.com/CarGuo/GSYGithubAppKotlin/releases")
return
}
if (needTip) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class GSYNavigationTabBar : NavigationTabBar {

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

override fun onTouchEvent(event: MotionEvent?): Boolean {
override fun onTouchEvent(event: MotionEvent): Boolean {

if (!isTouchEnable) {
return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import android.util.AttributeSet
import android.view.View
import android.view.ViewGroup.LayoutParams.MATCH_PARENT
import android.webkit.*
import android.webkit.WebSettings.LOAD_CACHE_ELSE_NETWORK
import android.widget.RelativeLayout
import androidx.core.view.setPadding
import com.github.ybq.android.spinkit.SpinKitView
Expand Down Expand Up @@ -38,13 +39,13 @@ class GSYWebViewContainer : RelativeLayout {
layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT)

val settings = webView.settings
settings?.javaScriptEnabled = true
settings?.loadWithOverviewMode = true
settings?.builtInZoomControls = false
settings?.displayZoomControls = false
settings?.domStorageEnabled = true
settings?.layoutAlgorithm = WebSettings.LayoutAlgorithm.NARROW_COLUMNS
settings?.setAppCacheEnabled(true)
settings.javaScriptEnabled = true
settings.loadWithOverviewMode = true
settings.builtInZoomControls = false
settings.displayZoomControls = false
settings.domStorageEnabled = true
settings.layoutAlgorithm = WebSettings.LayoutAlgorithm.NARROW_COLUMNS
settings.cacheMode = LOAD_CACHE_ELSE_NETWORK

addView(webView, layoutParams)

Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.5.31'
ext.kotlin_version = '1.6.21'
ext.ktx_version = '1.8.0'
ext.android_support = '1.1.0-beta01'
ext.androidx_appcompat = '1.4.0'
Expand All @@ -13,7 +13,7 @@ buildscript {
ext.rx_android = '2.1.1'
ext.event_bus = '3.1.1'
ext.glide_version = '4.8.0'
ext.realm_version = '7.0.0'
ext.realm_version = '10.15.0'
ext.agentweb_version = '4.0.2'
ext.tabbar_version = '1.2.5'
ext.dagger_version = '2.23.2'
Expand All @@ -22,12 +22,12 @@ buildscript {
ext.textfiled_box_version = '1.4.5'
ext.lifecycle_version = '1.1.1'
ext.spinkit_version = '1.2.0'
ext.gradle_version = '7.0.3'
ext.gradle_version = '8.0.1'
ext.recycler_common_version = 'v4.0.6'
ext.image_load = '4.9.0'
ext.drop_menu_version = '1.0.4'
ext.arouter_api_versoion = '1.4.0'
ext.arouter_compiler_versoion = '1.2.1'
ext.arouter_api_versoion = '1.5.2'
ext.arouter_compiler_versoion = '1.5.2'
ext.anko_version='0.10.8'
ext.richtext_version='0.19.0'
ext.markwon_version='4.6.2'
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ org.gradle.jvmargs=-Xmx1536m

android.useAndroidX=true
android.enableJetifier=true
android.databinding.enableV2=true
android.databinding.enableV2=true
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip

0 comments on commit 2e22d60

Please sign in to comment.