Skip to content
This repository has been archived by the owner on Aug 15, 2022. It is now read-only.

Commit

Permalink
build: 1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
re-ovo committed Jul 11, 2021
1 parent dfb73d1 commit 6128a0c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
6 changes: 3 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId = "me.rerere.zhiwang"
minSdk = 26
targetSdk = 30
versionCode = 7
versionName = "1.6.0"
versionCode = 8
versionName = "1.7.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down Expand Up @@ -48,7 +48,7 @@ android {
dependencies {
implementation ("androidx.core:core-ktx:1.6.0")
implementation ("androidx.appcompat:appcompat:1.3.0")
implementation ("com.google.android.material:material:1.3.0")
implementation ("com.google.android.material:material:1.4.0")

// Compose Lib
implementation ("androidx.compose.ui:ui:$composeVersion")
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/me/rerere/zhiwang/api/wiki/WikiUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ class WikiUtil @Inject constructor(
suspend fun loadWiki() : List<WikiList.WikiListItem>? {
return try {
val request = Request.Builder()
.url("https://gitee.com/RE_OVO/asoulzhiwang/raw/master/wiki.json")
.url("https://raw.githubusercontent.com/jiangdashao/ASoulZhiWang/master/wiki.json")
.get()
.build()
val response = okHttpClient.newCall(request).await()
val body = response.body?.string()
val body = response.body?.string()?.trim()
println(body)
val wikiList = gson.fromJson(body, WikiList::class.java)
wikiList
}catch (e: Exception){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package me.rerere.zhiwang.ui.screen.index.page

import android.content.Intent
import android.net.Uri
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
Expand All @@ -8,6 +11,7 @@ import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
Expand All @@ -23,6 +27,7 @@ import me.rerere.zhiwang.util.noRippleClickable

@Composable
fun WikiPage(navController: NavController, indexViewModel: IndexScreenVideoModel) {
val context = LocalContext.current
when {
indexViewModel.wikiLoading -> {
Column {
Expand Down Expand Up @@ -56,13 +61,21 @@ fun WikiPage(navController: NavController, indexViewModel: IndexScreenVideoModel
Card(
modifier = Modifier
.fillMaxWidth()
.padding(16.dp),
.padding(16.dp)
.clickable {
val intent = Intent(
Intent.ACTION_VIEW,
Uri.parse(("https://github.com/jiangdashao/asoulzhiwang").trim())
)
context.startActivity(intent)
},
) {
Column(Modifier.padding(16.dp)) {
Text(text = "声明", fontWeight = FontWeight.Bold, fontSize = 20.sp)
Spacer(modifier = Modifier.height(10.dp))
Text(text = "本WIKI中许多梗介绍来自 深紫色的白")
Text(text = "如果你想添加梗介绍,请前往github提交对 wiki.json 的PR")
Text(text = "https://github.com/jiangdashao/asoulzhiwang")
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/me/rerere/zhiwang/util/UpdateChecker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ suspend fun checkUpdate(context: Context): Boolean {
val okHttpClient = OkHttpClient()
val request = Request.Builder()
.cacheControl(CacheControl.Builder().noCache().build())
.url("https://raw.githubusercontent.com/jiangdashao/ASoulZhiWang/master/app/build.gradle")
.url("https://raw.githubusercontent.com/jiangdashao/ASoulZhiWang/master/app/build.gradle.kts")
.get()
.build()
val response = okHttpClient.newCall(request).await()
Expand All @@ -29,7 +29,7 @@ suspend fun checkUpdate(context: Context): Boolean {
require(content.isNotEmpty())
val latestVersion = content.let {
it.substring(
it.indexOf("versionCode") + 12,
it.indexOf("versionCode = ") + 15,
it.indexOf(char = '\n', startIndex = it.indexOf("versionCode"))
)
}
Expand Down

0 comments on commit 6128a0c

Please sign in to comment.