Skip to content

Commit

Permalink
v3.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
15dd committed Dec 7, 2024
1 parent 829ef78 commit 9b5bedb
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ android {
applicationId = "com.cyh128.hikari_novel"
minSdk = 24
targetSdk = 35
versionCode = 241123
versionName = "3.3.0"
versionCode = 241207
versionName = "3.3.1"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -80,7 +80,7 @@ dependencies {
//android相关
implementation("androidx.core:core-ktx:1.15.0")
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("com.google.android.material:material:1.13.0-alpha07")
implementation("com.google.android.material:material:1.13.0-alpha08")
implementation("androidx.constraintlayout:constraintlayout:2.2.0")
implementation("androidx.recyclerview:recyclerview:1.3.2")
implementation("androidx.viewpager2:viewpager2:1.1.0")
Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
Binary file modified app/release/baselineProfiles/0/app-release.dm
Binary file not shown.
Binary file modified app/release/baselineProfiles/1/app-release.dm
Binary file not shown.
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 241123,
"versionName": "3.3.0",
"versionCode": 241207,
"versionName": "3.3.1",
"outputFile": "app-release.apk"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class Wenku8Repository @Inject constructor(
charset = "BIG5-HKSCS"
}
else -> {
requestUrl = "https://${getWenku8Node()}/modules/article/toplist.php?sort=$ranking&page=$index"
requestUrl = "https://${getWenku8Node()}/modules/article/toplist.php?sort=$ranking&page=$index&charset=gbk"
charset = "GBK"
}
}
Expand Down Expand Up @@ -104,7 +104,7 @@ class Wenku8Repository @Inject constructor(
charset = "BIG5-HKSCS"
}
else -> {
requestUrl = "https://${getWenku8Node()}/modules/article/tags.php?t=$category&v=$sort&page=$index"
requestUrl = "https://${getWenku8Node()}/modules/article/tags.php?t=$category&v=$sort&page=$index&charset=gbk"
charset = "GBK"
}
}
Expand All @@ -130,7 +130,7 @@ class Wenku8Repository @Inject constructor(
charset = "BIG5-HKSCS" //不能使用普通的big5编码,不然无法显示日文
}
else -> {
requestUrl = url
requestUrl = "$url&charset=gbk"
charset = "GBK"
}
}
Expand All @@ -152,11 +152,11 @@ class Wenku8Repository @Inject constructor(
val charset: String?
when(Locale.getDefault()) {
Locale.TRADITIONAL_CHINESE -> {
requestUrl = "$url?charset=big5"
requestUrl = "${url}?charset=big5"
charset = "BIG5-HKSCS"
}
else -> {
requestUrl = url
requestUrl = "${url}?charset=gbk"
charset = "GBK"
}
}
Expand All @@ -181,7 +181,7 @@ class Wenku8Repository @Inject constructor(
charset = "BIG5-HKSCS"
}
else -> {
requestUrl = "https://${getWenku8Node()}/modules/article/addbookcase.php?bid=$aid"
requestUrl = "https://${getWenku8Node()}/modules/article/addbookcase.php?bid=$aid&charset=gbk"
charset = "GBK"
}
}
Expand Down Expand Up @@ -217,7 +217,7 @@ class Wenku8Repository @Inject constructor(
charset = "BIG5-HKSCS"
}
else -> {
requestUrl = "https://${getWenku8Node()}/modules/article/bookcase.php?classid=$classId"
requestUrl = "https://${getWenku8Node()}/modules/article/bookcase.php?classid=$classId&charset=gbk"
charset = "GBK"
}
}
Expand All @@ -242,7 +242,7 @@ class Wenku8Repository @Inject constructor(
charset = "BIG5-HKSCS"
}
else -> {
requestUrl = "https://${getWenku8Node()}/modules/article/reviews.php?aid=$aid&page=$index"
requestUrl = "https://${getWenku8Node()}/modules/article/reviews.php?aid=$aid&page=$index&charset=gbk"
charset = "GBK"
}
}
Expand All @@ -267,7 +267,7 @@ class Wenku8Repository @Inject constructor(
charset = "BIG5-HKSCS"
}
else -> {
requestUrl = "$url&page=$index"
requestUrl = "$url&page=$index&charset=gbk"
charset = "GBK"
}
}
Expand All @@ -291,7 +291,7 @@ class Wenku8Repository @Inject constructor(
charset = "BIG5-HKSCS"
}
else -> {
requestUrl = "https://${getWenku8Node()}/index.php"
requestUrl = "https://${getWenku8Node()}/index.php?charset=gbk"
charset = "GBK"
}
}
Expand All @@ -316,7 +316,7 @@ class Wenku8Repository @Inject constructor(
charset = "BIG5-HKSCS"
}
else -> {
requestUrl = "https://${getWenku8Node()}/modules/article/uservote.php?id=$aid"
requestUrl = "https://${getWenku8Node()}/modules/article/uservote.php?id=$aid&charset=gbk"
charset = "GBK"
}
}
Expand All @@ -341,7 +341,7 @@ class Wenku8Repository @Inject constructor(
charset = "BIG5-HKSCS"
}
else -> {
requestUrl = "https://${getWenku8Node()}/modules/article/search.php?searchtype=articlename&searchkey=$title&page=$index"
requestUrl = "https://${getWenku8Node()}/modules/article/search.php?searchtype=articlename&searchkey=$title&page=$index&charset=gbk"
charset = "GBK"
}
}
Expand Down Expand Up @@ -373,7 +373,7 @@ class Wenku8Repository @Inject constructor(
charset = "BIG5-HKSCS"
}
else -> {
requestUrl = "https://${getWenku8Node()}/modules/article/search.php?searchtype=author&searchkey=$author&page=$index"
requestUrl = "https://${getWenku8Node()}/modules/article/search.php?searchtype=author&searchkey=$author&page=$index&charset=gbk"
charset = "GBK"
}
}
Expand Down Expand Up @@ -410,7 +410,7 @@ class Wenku8Repository @Inject constructor(
charset = "BIG5-HKSCS"
}
else -> {
requestUrl = "https://${getWenku8Node()}/userdetail.php"
requestUrl = "https://${getWenku8Node()}/userdetail.php?charset=gbk"
charset = "GBK"
}
}
Expand All @@ -435,7 +435,7 @@ class Wenku8Repository @Inject constructor(
charset = "BIG5-HKSCS"
}
else -> {
requestUrl = "https://${getWenku8Node()}/modules/article/articlelist.php?fullflag=1&page=$index"
requestUrl = "https://${getWenku8Node()}/modules/article/articlelist.php?fullflag=1&page=$index&charset=gbk"
charset = "GBK"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,16 @@ class CommentActivity : BaseActivity<ActivityCommentBinding>() {
}

private fun showReplyFragment(url: String) {
//防抖动
if (viewModel.isDialogShown) return
ReplyFragment().apply {
arguments = Bundle().also { it.putString("url", url) }
show(supportFragmentManager,"replyFragment")
}
viewModel.isDialogShown = true
}

fun setDialogShownFalse() {
viewModel.isDialogShown = false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import javax.inject.Inject
class CommentViewModel @Inject constructor(
private val wenku8Repository: Wenku8Repository
) : ViewModel() {
var isDialogShown = false

private var maxNum: Int? = null
val list = mutableListOf<Comment>()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package com.cyh128.hikari_novel.ui.view.detail.comment.reply

import android.content.DialogInterface
import android.os.Bundle
import android.view.View
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager
import com.cyh128.hikari_novel.base.BaseBottomSheetDialogFragment
import com.cyh128.hikari_novel.data.model.Event
import com.cyh128.hikari_novel.databinding.FragmentReplyBinding
import com.cyh128.hikari_novel.ui.view.detail.comment.CommentActivity
import com.drake.channel.receiveEvent
import dagger.hilt.android.AndroidEntryPoint

Expand Down Expand Up @@ -52,4 +54,9 @@ class ReplyFragment : BaseBottomSheetDialogFragment<FragmentReplyBinding>() {

viewModel.getReply(url)
}

override fun onDismiss(dialog: DialogInterface) {
super.onDismiss(dialog)
(requireActivity() as CommentActivity).setDialogShownFalse()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.os.Bundle
import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager
import androidx.core.view.WindowCompat
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager
import com.cyh128.hikari_novel.R
Expand Down Expand Up @@ -34,13 +35,19 @@ class SearchActivity : BaseActivity<ActivitySearchBinding>() {

WindowCompat.setDecorFitsSystemWindows(window, false)

var isFromOtherActivity = false

intent.getStringExtra("author")?.let {//如果不为空,则说明是来自NovelInfoActivity的Intent
binding.cASearchByAuthor.isChecked = true
binding.tietASearch.setText(it)
search(it)
isFromOtherActivity = true
}

receiveEvent<Event>("event_search_activity") { event ->
//防止在重复创建此Activity时,已入栈的的同类型Activity接收到Event
if (!lifecycle.currentState.isAtLeast(Lifecycle.State.STARTED)) return@receiveEvent

when (event) {
Event.SearchResultEmptyEvent -> showEmptyScreen()
Event.SearchInitSuccessEvent -> showContentScreen()
Expand Down Expand Up @@ -82,8 +89,10 @@ class SearchActivity : BaseActivity<ActivitySearchBinding>() {

initListener()

//弹起键盘
showSoftInput()
if (!isFromOtherActivity) { //避免直接搜索时弹出输入法挡视线
//弹起键盘
showSoftInput()
}

viewModel.getSearchHistory() //获取搜索历史记录
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import org.jsoup.nodes.Element
import org.jsoup.select.Elements

object Wenku8Parser {
private const val TAG = "Wenku8Parser"

fun isInFiveSecond(html: String): Boolean {
val document = Jsoup.parse(html)
val a = document.getElementsByClass("blocktitle")
Expand All @@ -40,8 +38,8 @@ object Wenku8Parser {
try {
val document = Jsoup.parse(html)
val a = document.getElementById("content")
val b = a!!.getElementsByTag("div")[1]
val c = b.select("span[style=width:145px;display:inline-block;]")[1]
val b = a!!.getElementsByTag("div")[0].select("div[style=margin:0px auto;overflow:hidden;]")
val c = b.select("span")[1]
val bookUrl = c.selectFirst("a")!!.attr("href")
val t2 = a.getElementsByTag("table").eq(0)
val title = t2.select("span").eq(0).select("b").eq(0).text()
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.7.2" apply false
id("com.android.application") version "8.7.3" apply false
id("org.jetbrains.kotlin.android") version "2.0.21" apply false
id("com.google.devtools.ksp") version "2.0.21-1.0.26" apply false
// id("org.jetbrains.kotlin.kapt") version "2.0.0" apply false
id("com.android.library") version "8.7.2" apply false
id("com.android.library") version "8.7.3" apply false
id("com.google.dagger.hilt.android") version "2.52" apply false
}

0 comments on commit 9b5bedb

Please sign in to comment.