去除捐赠和加群
This commit is contained in:
@@ -12,7 +12,6 @@ import io.legado.app.R
|
||||
import io.legado.app.constant.AppConst
|
||||
import io.legado.app.constant.AppConst.appInfo
|
||||
import io.legado.app.help.AppUpdate
|
||||
import io.legado.app.lib.dialogs.alert
|
||||
import io.legado.app.lib.prefs.PreferenceCategory
|
||||
import io.legado.app.ui.widget.dialog.TextDialog
|
||||
import io.legado.app.ui.widget.dialog.WaitDialog
|
||||
@@ -21,19 +20,6 @@ import splitties.init.appCtx
|
||||
|
||||
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 waitDialog by lazy {
|
||||
@@ -71,7 +57,6 @@ class AboutFragment : PreferenceFragmentCompat() {
|
||||
"license" -> showMdFile(getString(R.string.license), "LICENSE.md")
|
||||
"disclaimer" -> showMdFile(getString(R.string.disclaimer), "disclaimer.md")
|
||||
"privacyPolicy" -> showMdFile(getString(R.string.privacy_policy), "privacyPolicy.md")
|
||||
"qq" -> showQqGroups()
|
||||
"gzGzh" -> requireContext().sendToClip(getString(R.string.legado_gzh))
|
||||
"crashLog" -> showDialogFragment<CrashLogsDialog>()
|
||||
"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群
|
||||
|
||||
@@ -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 io.legado.app.R
|
||||
import io.legado.app.base.BaseFragment
|
||||
import io.legado.app.constant.AppConst
|
||||
import io.legado.app.constant.EventBus
|
||||
import io.legado.app.constant.PreferKey
|
||||
import io.legado.app.databinding.FragmentMyConfigBinding
|
||||
import io.legado.app.help.config.ThemeConfig
|
||||
import io.legado.app.lib.dialogs.selector
|
||||
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.fragment.PreferenceFragment
|
||||
import io.legado.app.lib.theme.primaryColor
|
||||
import io.legado.app.service.WebService
|
||||
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.book.bookmark.AllBookmarkActivity
|
||||
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?) {
|
||||
putPrefBoolean(PreferKey.webService, WebService.isRun)
|
||||
addPreferencesFromResource(R.xml.pref_main)
|
||||
if (AppConst.isPlayChannel) {
|
||||
findPreference<PreferenceCategory>("aboutCategory")
|
||||
?.removePreferenceRecursively("donate")
|
||||
}
|
||||
findPreference<SwitchPreference>("webService")?.onLongClick {
|
||||
if (!WebService.isRun) {
|
||||
return@onLongClick false
|
||||
@@ -174,7 +167,6 @@ class MyFragment() : BaseFragment(R.layout.fragment_my_config), MainFragmentInte
|
||||
|
||||
"fileManage" -> startActivity<FileManageActivity>()
|
||||
"readRecord" -> startActivity<ReadRecordActivity>()
|
||||
"donate" -> startActivity<DonateActivity>()
|
||||
"about" -> startActivity<AboutActivity>()
|
||||
"exit" -> activity?.finish()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user