Skip to content

Commit

Permalink
topic fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ekibun committed Feb 3, 2024
1 parent 7bbb2b5 commit 81099b4
Show file tree
Hide file tree
Showing 17 changed files with 187 additions and 47 deletions.
3 changes: 3 additions & 0 deletions .idea/.gitignore

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

123 changes: 123 additions & 0 deletions .idea/codeStyles/Project.xml

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

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

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

10 changes: 10 additions & 0 deletions .idea/deploymentTargetDropDown.xml

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

3 changes: 1 addition & 2 deletions .idea/gradle.xml

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

6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

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

10 changes: 10 additions & 0 deletions .idea/migrations.xml

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

8 changes: 8 additions & 0 deletions .idea/modules.xml

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

Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ data class Subject(
it.selectFirst("span")?.text()
?: "", it.selectFirst("small")?.text()?.toIntOrNull() ?: 0
)
}
}?.filter { it.first != "" }
}
SaxTag.COLLECTION -> {
subject.collection = doc.select("#subjectPanelCollect .tip_i a")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ data class Topic(
}
)
var beginString = ""
var isReplyBox = false;
var replyCount = -2
val posts = ConcurrentLinkedQueue<TopicPost>()
var finishFirst = false
Expand All @@ -140,13 +141,14 @@ data class Topic(
} else null to ApiHelper.SaxEventType.NOTHING
}
attrs.contains("reply_wrapper") -> {
replyCount++
isReplyBox = true
replyCount to ApiHelper.SaxEventType.BEGIN
}
else -> null to ApiHelper.SaxEventType.NOTHING
}
}) { tag, str ->
if (tag is Int && tag < 0) {
beginString = str
val doc = Jsoup.parseBodyFragment(str)
doc.outputSettings().prettyPrint(false)

Expand Down Expand Up @@ -181,6 +183,9 @@ data class Topic(
withContext(Dispatchers.Main) { onHeader() }
}
} else {
if(beginString == "" && isReplyBox) {
beginString = str
}
val post = parsePost(str)
posts.addAll(post)
while (tag is Int && tag != 0 && !finishFirst) delay(100)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/soko/ekibun/bangumi/api/github/Github.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ object Github {
}
}

private const val RAW_SERVER_API = "https://ghproxy.com/https://raw.githubusercontent.com"
private const val RAW_SERVER_API = "https://raw.githubusercontent.com"

/**
* 时间表
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/soko/ekibun/bangumi/model/ThemeModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ object ThemeModel {
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
val color = ResourceUtil.resolveColorAttr(context, android.R.attr.colorBackground)
window.navigationBarColor = Color.argb(200, Color.red(color), Color.green(color), Color.blue(color))
if (Build.VERSION.SDK_INT < 28) return
window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
}


Expand Down
8 changes: 6 additions & 2 deletions app/src/main/java/soko/ekibun/bangumi/ui/main/DrawerView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import android.view.MenuItem
import androidx.appcompat.app.ActionBarDrawerToggle
import androidx.core.view.ViewCompat
import androidx.core.view.children
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.activity_main.content_frame
import kotlinx.android.synthetic.main.activity_main.drawer_layout
import kotlinx.android.synthetic.main.activity_main.nav_view
import kotlinx.android.synthetic.main.activity_main.root_layout
import kotlinx.android.synthetic.main.activity_main.toolbar
import soko.ekibun.bangumi.R
import soko.ekibun.bangumi.ui.main.fragment.DrawerFragment
import soko.ekibun.bangumi.ui.main.fragment.calendar.CalendarFragment
Expand Down Expand Up @@ -81,7 +85,7 @@ class DrawerView(private val context: MainActivity, onLogout: () -> Unit) {
context.content_frame.children.forEach { v ->
v.onApplyWindowInsets(insets.replaceSystemWindowInsets(0, 0, 0, insets.systemWindowInsetBottom))
}
insets.consumeSystemWindowInsets()
insets
}

context.nav_view.setNavigationItemSelectedListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import android.view.ViewGroup
import android.widget.RelativeLayout
import androidx.appcompat.app.AlertDialog
import androidx.fragment.app.Fragment
import androidx.preference.*
import androidx.preference.ListPreference
import androidx.preference.Preference
import androidx.preference.PreferenceCategory
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.PreferenceScreen
import soko.ekibun.bangumi.App
import soko.ekibun.bangumi.BuildConfig
import soko.ekibun.bangumi.R
Expand All @@ -19,7 +23,6 @@ import soko.ekibun.bangumi.ui.view.BaseFragmentActivity
import soko.ekibun.bangumi.ui.web.WebActivity
import soko.ekibun.bangumi.util.AppUtil
import soko.ekibun.bangumi.util.PluginPreference
import java.net.URLEncoder

/**
* 设置Activity
Expand Down Expand Up @@ -165,20 +168,6 @@ class SettingsActivity : BaseFragmentActivity(), PreferenceFragmentCompat.OnPref
"github_page" -> activity?.let {
WebActivity.launchUrl(it, "https://github.com/ekibun/Bangumi", "")
}
"pref_alipay" -> activity?.startActivity(
Intent.createChooser(
Intent.parseUri(
"intent://platformapi/startapp?saId=10000007&" +
"qrcode=" + URLEncoder.encode(
"https://qr.alipay.com/fkx192410t0bnuwmwawdaa4",
"utf-8"
) +
"#Intent;scheme=alipayqr;package=com.eg.android.AlipayGphone;end",
Intent.URI_INTENT_SCHEME
),
"buy me a coffee"
)
)
}

return super.onPreferenceTreeClick(preference)
Expand Down
7 changes: 0 additions & 7 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,4 @@
<string name="history">历史记录</string>
<string name="clear_history">清空历史记录</string>
<string name="about">关于</string>

<string name="buy_me_a_coffee">
一转眼,app已经两岁了,是开坑之后持续最久的项目了。起初是想借助Bangumi的api整合各个资源站的数据,没想到写着写着变成了Bangumi第三方客户端。\n
\n两年来,通过这个项目认识了Bangumi,也认识了一些友商dalao,项目也成了日常摸鱼和脑洞的试验场。一路下来很有趣,所以也会坚持写下去。当然,由于垃圾原生和自己技术的问题,新功能肯定没有隔壁友商加的快。\n
\n最后,欢迎各种建议、欢迎STAR,欢迎投食!\n
</string>
<string name="buy_me_a_coffee_sign">2020-03-13</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<item name="colorAccent">@color/colorAccent</item>
<item name="colorPrimaryBackground">@color/colorPrimary</item>
<item name="colorPrimaryForeground">@color/colorAccent</item>

<item name="android:windowTranslucentStatus">true</item>
</style>

Expand Down
16 changes: 0 additions & 16 deletions app/src/main/res/xml/app_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,5 @@
app:key="check_update_now"
app:title="检查更新"/>

<androidx.preference.PreferenceScreen
app:iconSpaceReserved="false"
app:key="buy_me_a_coffee"
app:title="🍚">
<Preference
app:selectable="false"
app:iconSpaceReserved="false"
app:layout="@layout/pref_coffee_header"/>
<Preference
app:key="pref_alipay"
app:iconSpaceReserved="false"
app:title="支付宝"
app:summary="请备注id以便联系"
/>
</androidx.preference.PreferenceScreen>

</androidx.preference.PreferenceScreen>
</androidx.preference.PreferenceScreen>

0 comments on commit 81099b4

Please sign in to comment.