去除捐赠和加群

This commit is contained in:
kunfei
2023-07-26 14:44:29 +08:00
parent af22eab50b
commit f82a559bad
8 changed files with 7 additions and 362 deletions
-119
View File
@@ -1,119 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<io.legado.app.lib.prefs.Preference
android:key="contributors"
android:summary="@string/contributors_summary"
android:title="@string/contributors"
app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference
android:key="update_log"
android:title="@string/update_log"
app:allowDividerAbove="false"
app:allowDividerBelow="false"
app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference
android:key="check_update"
android:title="@string/check_update"
app:allowDividerAbove="false"
app:allowDividerBelow="false"
app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.PreferenceCategory
android:title="@string/contact"
app:allowDividerAbove="true"
app:allowDividerBelow="false"
app:iconSpaceReserved="false"
app:layout="@layout/view_preference_category">
<io.legado.app.lib.prefs.Preference
android:key="gzGzh"
android:summary="@string/official_account"
android:title="@string/follow_official_account"
app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference
android:key="qqChannel"
android:title="@string/join_qq_channel"
android:summary="@string/qq_channel_summary"
app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference
android:key="qq"
android:summary="@string/click_to_apply"
android:title="@string/join_qq_group"
app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference
android:key="mail"
android:summary="@string/email"
android:title="@string/send_mail"
app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference
android:key="git"
android:summary="@string/this_github_url"
android:title="@string/git_hub"
app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference
android:key="discord"
android:summary="@string/discord_url"
android:title="Discord"
app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference
android:key="tg"
android:summary="@string/tg_url"
android:title="TG"
app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference
android:key="sourceRuleSummary"
android:summary="@string/source_rule_url"
android:title="@string/source_rule_s"
app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference
android:key="home_page"
android:summary="@string/home_page_url"
android:title="@string/home_page"
app:allowDividerAbove="false"
app:allowDividerBelow="false"
app:iconSpaceReserved="false" />
</io.legado.app.lib.prefs.PreferenceCategory>
<io.legado.app.lib.prefs.PreferenceCategory
android:title="@string/other"
app:allowDividerAbove="true"
app:allowDividerBelow="false"
app:iconSpaceReserved="false"
app:layout="@layout/view_preference_category">
<io.legado.app.lib.prefs.Preference
android:key="crashLog"
android:title="@string/crash_log"
app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference
android:key="privacyPolicy"
android:title="@string/privacy_policy"
app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference
android:key="license"
android:title="@string/license"
app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference
android:key="disclaimer"
android:title="@string/disclaimer"
app:iconSpaceReserved="false" />
</io.legado.app.lib.prefs.PreferenceCategory>
</androidx.preference.PreferenceScreen>
@@ -12,7 +12,6 @@ import io.legado.app.R
import io.legado.app.constant.AppConst import io.legado.app.constant.AppConst
import io.legado.app.constant.AppConst.appInfo import io.legado.app.constant.AppConst.appInfo
import io.legado.app.help.AppUpdate import io.legado.app.help.AppUpdate
import io.legado.app.lib.dialogs.alert
import io.legado.app.lib.prefs.PreferenceCategory import io.legado.app.lib.prefs.PreferenceCategory
import io.legado.app.ui.widget.dialog.TextDialog import io.legado.app.ui.widget.dialog.TextDialog
import io.legado.app.ui.widget.dialog.WaitDialog import io.legado.app.ui.widget.dialog.WaitDialog
@@ -21,19 +20,6 @@ import splitties.init.appCtx
class AboutFragment : PreferenceFragmentCompat() { class AboutFragment : PreferenceFragmentCompat() {
private val qqGroups = linkedMapOf(
Pair("(QQ群1)809302327", "TvJfIiNQUDgTrJU7lwx1WfJOHVkFaQNr"),
Pair("(QQ群2)773736122", "5Bm5w6OgLupXnICbYvbgzpPUgf0UlsJF"),
Pair("(QQ群3)981838750", "g_Sgmp2nQPKqcZQ5qPcKLHziwX_mpps9"),
Pair("(QQ群4)256929088", "czEJPLDnT4Pd9SKQ6RoRVzKhDxLchZrO"),
Pair("(QQ群5)811843556", "zKZ2UYGZ7o5CzcA6ylxzlqi21si_iqaX"),
Pair("(QQ群6)686910436", "reOUwIDDJXoTZQxXTr8VOEUu5IQLeME2"),
Pair("(QQ群7)15987187", "S2g2TMD0LGd3sefUADd1AbyPEW2o2XfC"),
Pair("(QQ群8)1079926194", "gg2qFH8q9IPFaCHV3H7CqCN-YljvazE1"),
Pair("(QQ群9)892108780", "Ci_O3aysKjEBfplOWeCud-rxl71TjU2Q"),
Pair("(QQ群10)812720266", "oW9ksY0sAWUEq0hfM5irN5aOdvKVgMEE")
)
private val qqChannel = "https://pd.qq.com/s/8qxylhj2s" private val qqChannel = "https://pd.qq.com/s/8qxylhj2s"
private val waitDialog by lazy { private val waitDialog by lazy {
@@ -71,7 +57,6 @@ class AboutFragment : PreferenceFragmentCompat() {
"license" -> showMdFile(getString(R.string.license), "LICENSE.md") "license" -> showMdFile(getString(R.string.license), "LICENSE.md")
"disclaimer" -> showMdFile(getString(R.string.disclaimer), "disclaimer.md") "disclaimer" -> showMdFile(getString(R.string.disclaimer), "disclaimer.md")
"privacyPolicy" -> showMdFile(getString(R.string.privacy_policy), "privacyPolicy.md") "privacyPolicy" -> showMdFile(getString(R.string.privacy_policy), "privacyPolicy.md")
"qq" -> showQqGroups()
"gzGzh" -> requireContext().sendToClip(getString(R.string.legado_gzh)) "gzGzh" -> requireContext().sendToClip(getString(R.string.legado_gzh))
"crashLog" -> showDialogFragment<CrashLogsDialog>() "crashLog" -> showDialogFragment<CrashLogsDialog>()
"qqChannel" -> context?.openUrl(qqChannel) "qqChannel" -> context?.openUrl(qqChannel)
@@ -113,24 +98,6 @@ class AboutFragment : PreferenceFragmentCompat() {
} }
} }
/**
* 显示qq群
*/
private fun showQqGroups() {
alert(titleResource = R.string.join_qq_group) {
val names = arrayListOf<String>()
qqGroups.forEach {
names.add(it.key)
}
items(names) { _, index ->
qqGroups[names[index]]?.let {
if (!joinQQGroup(it)) {
requireContext().sendToClip(it)
}
}
}
}
}
/** /**
* 加入qq群 * 加入qq群
@@ -1,28 +0,0 @@
package io.legado.app.ui.about
import android.os.Bundle
import io.legado.app.R
import io.legado.app.base.BaseActivity
import io.legado.app.databinding.ActivityDonateBinding
import io.legado.app.utils.viewbindingdelegate.viewBinding
/**
* Created by GKF on 2018/1/13.
* 捐赠页面
*/
class DonateActivity : BaseActivity<ActivityDonateBinding>() {
override val binding by viewBinding(ActivityDonateBinding::inflate)
override fun onActivityCreated(savedInstanceState: Bundle?) {
val fTag = "donateFragment"
var donateFragment = supportFragmentManager.findFragmentByTag(fTag)
if (donateFragment == null) donateFragment = DonateFragment()
supportFragmentManager.beginTransaction()
.replace(R.id.fl_fragment, donateFragment, fTag)
.commit()
}
}
@@ -1,82 +0,0 @@
package io.legado.app.ui.about
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.View
import androidx.lifecycle.lifecycleScope
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import io.legado.app.R
import io.legado.app.help.JsEngine
import io.legado.app.help.coroutine.Coroutine
import io.legado.app.utils.*
import org.intellij.lang.annotations.Language
import splitties.init.appCtx
class DonateFragment : PreferenceFragmentCompat() {
private val zfbHbRwmUrl =
"https://gedoor.github.io/assets/images/zfbhbrwm-6dfbcd1d680cfd831b93490a91052656.png"
private val zfbSkRwmUrl =
"https://gedoor.github.io/assets/images/zfbskrwm-66379bdee8214093872696e413f6dda9.jpg"
private val wxZsRwmUrl =
"https://gedoor.github.io/assets/images/wxskrwm-d8e6963d6ae122a3c2e818f3c4bc09cf.jpg"
private val qqSkRwmUrl =
"https://gedoor.github.io/assets/images/qqskrwm-2c10b25f67f4354eec5ab5bd6080285f.jpg"
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
addPreferencesFromResource(R.xml.donate)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
listView.overScrollMode = View.OVER_SCROLL_NEVER
}
override fun onPreferenceTreeClick(preference: Preference): Boolean {
when (preference.key) {
"wxZsm" -> requireContext().openUrl(wxZsRwmUrl)
"zfbHbRwm" -> requireContext().openUrl(zfbHbRwmUrl)
"zfbSkRwm" -> requireContext().openUrl(zfbSkRwmUrl)
"qqSkRwm" -> requireContext().openUrl(qqSkRwmUrl)
"zfbHbSsm" -> getZfbHb(requireContext())
"gzGzh" -> requireContext().sendToClip("开源阅读")
"ktt" -> openKtt()
}
return super.onPreferenceTreeClick(preference)
}
private fun getZfbHb(context: Context) {
requireContext().sendToClip("537954522")
context.longToastOnUi("高级功能已开启\n红包码已复制\n支付宝首页搜索“537954522” 立即领红包")
try {
val packageManager = context.applicationContext.packageManager
val intent = packageManager.getLaunchIntentForPackage("com.eg.android.AlipayGphone")!!
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
context.startActivity(intent)
} catch (e: Exception) {
e.printOnDebug()
} finally {
ACache.get(cacheDir = false)
.put("proTime", System.currentTimeMillis())
}
}
private fun openKtt() {
Coroutine.async(lifecycleScope) {
@Language("js")
val js = """
java.webViewGetOverrideUrl(null, "https://ktt.pinduoduo.com/t/tlQQsofbQM", null, "weixin:.*")
""".trimIndent()
JsEngine.eval(js).toString()
}.timeout(10000)
.onSuccess {
activity?.openUrl(it)
}.onError {
appCtx.toastOnUi(it.localizedMessage)
}
}
}
@@ -8,20 +8,17 @@ import android.view.View
import androidx.preference.Preference import androidx.preference.Preference
import io.legado.app.R import io.legado.app.R
import io.legado.app.base.BaseFragment import io.legado.app.base.BaseFragment
import io.legado.app.constant.AppConst
import io.legado.app.constant.EventBus import io.legado.app.constant.EventBus
import io.legado.app.constant.PreferKey import io.legado.app.constant.PreferKey
import io.legado.app.databinding.FragmentMyConfigBinding import io.legado.app.databinding.FragmentMyConfigBinding
import io.legado.app.help.config.ThemeConfig import io.legado.app.help.config.ThemeConfig
import io.legado.app.lib.dialogs.selector import io.legado.app.lib.dialogs.selector
import io.legado.app.lib.prefs.NameListPreference import io.legado.app.lib.prefs.NameListPreference
import io.legado.app.lib.prefs.PreferenceCategory
import io.legado.app.lib.prefs.SwitchPreference import io.legado.app.lib.prefs.SwitchPreference
import io.legado.app.lib.prefs.fragment.PreferenceFragment import io.legado.app.lib.prefs.fragment.PreferenceFragment
import io.legado.app.lib.theme.primaryColor import io.legado.app.lib.theme.primaryColor
import io.legado.app.service.WebService import io.legado.app.service.WebService
import io.legado.app.ui.about.AboutActivity import io.legado.app.ui.about.AboutActivity
import io.legado.app.ui.about.DonateActivity
import io.legado.app.ui.about.ReadRecordActivity import io.legado.app.ui.about.ReadRecordActivity
import io.legado.app.ui.book.bookmark.AllBookmarkActivity import io.legado.app.ui.book.bookmark.AllBookmarkActivity
import io.legado.app.ui.book.source.manage.BookSourceActivity import io.legado.app.ui.book.source.manage.BookSourceActivity
@@ -87,10 +84,6 @@ class MyFragment() : BaseFragment(R.layout.fragment_my_config), MainFragmentInte
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
putPrefBoolean(PreferKey.webService, WebService.isRun) putPrefBoolean(PreferKey.webService, WebService.isRun)
addPreferencesFromResource(R.xml.pref_main) addPreferencesFromResource(R.xml.pref_main)
if (AppConst.isPlayChannel) {
findPreference<PreferenceCategory>("aboutCategory")
?.removePreferenceRecursively("donate")
}
findPreference<SwitchPreference>("webService")?.onLongClick { findPreference<SwitchPreference>("webService")?.onLongClick {
if (!WebService.isRun) { if (!WebService.isRun) {
return@onLongClick false return@onLongClick false
@@ -174,7 +167,6 @@ class MyFragment() : BaseFragment(R.layout.fragment_my_config), MainFragmentInte
"fileManage" -> startActivity<FileManageActivity>() "fileManage" -> startActivity<FileManageActivity>()
"readRecord" -> startActivity<ReadRecordActivity>() "readRecord" -> startActivity<ReadRecordActivity>()
"donate" -> startActivity<DonateActivity>()
"about" -> startActivity<AboutActivity>() "about" -> startActivity<AboutActivity>()
"exit" -> activity?.finish() "exit" -> activity?.finish()
} }
+7 -7
View File
@@ -15,8 +15,14 @@
app:allowDividerBelow="false" app:allowDividerBelow="false"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference
android:key="check_update"
android:title="@string/check_update"
app:allowDividerAbove="false"
app:allowDividerBelow="false"
app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.PreferenceCategory <io.legado.app.lib.prefs.PreferenceCategory
android:key="lx"
android:title="@string/contact" android:title="@string/contact"
app:allowDividerAbove="true" app:allowDividerAbove="true"
app:allowDividerBelow="false" app:allowDividerBelow="false"
@@ -35,12 +41,6 @@
android:summary="@string/qq_channel_summary" android:summary="@string/qq_channel_summary"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference
android:key="qq"
android:summary="@string/click_to_apply"
android:title="@string/join_qq_group"
app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference <io.legado.app.lib.prefs.Preference
android:key="mail" android:key="mail"
android:summary="@string/email" android:summary="@string/email"
-78
View File
@@ -1,78 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<io.legado.app.lib.prefs.PreferenceCategory
android:title="@string/wechat"
app:allowDividerAbove="false"
app:allowDividerBelow="false"
app:iconSpaceReserved="false"
app:layout="@layout/view_preference_category">
<io.legado.app.lib.prefs.Preference
android:key="gzGzh"
android:summary="@string/follow_public_account_summary"
android:title="@string/follow_official_account"
app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference
android:key="ktt"
android:summary="快团团购物支持"
android:title="我的店铺"
app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference
android:key="wxZsm"
android:summary="@string/click_to_open"
android:title="@string/weChat_appreciation_code"
app:allowDividerAbove="false"
app:allowDividerBelow="false"
app:iconSpaceReserved="false" />
</io.legado.app.lib.prefs.PreferenceCategory>
<io.legado.app.lib.prefs.PreferenceCategory
android:title="@string/alipay"
app:allowDividerAbove="true"
app:allowDividerBelow="false"
app:iconSpaceReserved="false"
app:layout="@layout/view_preference_category">
<io.legado.app.lib.prefs.Preference
android:key="zfbHbSsm"
android:summary="@string/alipay_red_envelope_copy"
android:title="@string/alipay_red_envelope_search_code"
app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference
android:key="zfbHbRwm"
android:summary="@string/click_to_open"
android:title="@string/alipay_red_envelope_qr_code"
app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference
android:key="zfbSkRwm"
android:summary="@string/click_to_open"
android:title="@string/alipay_payment_qr_code"
app:allowDividerAbove="false"
app:allowDividerBelow="false"
app:iconSpaceReserved="false" />
</io.legado.app.lib.prefs.PreferenceCategory>
<io.legado.app.lib.prefs.PreferenceCategory
android:title="QQ"
app:allowDividerAbove="true"
app:allowDividerBelow="false"
app:iconSpaceReserved="false"
app:layout="@layout/view_preference_category">
<io.legado.app.lib.prefs.Preference
android:key="qqSkRwm"
android:summary="@string/click_to_open"
android:title="@string/qq_collection_qr_code"
app:iconSpaceReserved="false" />
</io.legado.app.lib.prefs.PreferenceCategory>
</androidx.preference.PreferenceScreen>
-7
View File
@@ -111,13 +111,6 @@
android:icon="@drawable/ic_folder_outline" android:icon="@drawable/ic_folder_outline"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference
android:key="donate"
android:summary="@string/donate_summary"
android:title="@string/donate"
android:icon="@drawable/ic_cfg_donate"
app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference <io.legado.app.lib.prefs.Preference
android:key="about" android:key="about"
android:summary="@string/about_summary" android:summary="@string/about_summary"