diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/AppConfig.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/AppConfig.kt index 2956e477..fd4af4b4 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/AppConfig.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/AppConfig.kt @@ -38,6 +38,7 @@ object AppConfig { const val androidpackagenamelistUrl = "https://raw.githubusercontent.com/2dust/androidpackagenamelist/master/proxy.txt" const val v2rayCustomRoutingListUrl = "https://raw.githubusercontent.com/2dust/v2rayCustomRoutingList/master/" const val v2rayNGIssues = "https://github.com/2dust/v2rayNG/issues" + const val v2rayNGWikiMode = "https://github.com/2dust/v2rayNG/wiki/Mode" const val promotionUrl = "https://1.2345345.xyz/ads.html" const val DNS_AGENT = "1.1.1.1" diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/SettingsActivity.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/SettingsActivity.kt index f36b9c12..b46eff3f 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/SettingsActivity.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/SettingsActivity.kt @@ -2,6 +2,7 @@ package com.v2ray.ang.ui import android.os.Bundle import android.support.v7.preference.* +import android.view.View import com.v2ray.ang.R import com.v2ray.ang.AppConfig import com.v2ray.ang.util.Utils @@ -70,7 +71,7 @@ class SettingsActivity : BaseActivity() { // val feedback: Preference by lazy { findPreference(PREF_FEEDBACK) } // val tgGroup: Preference by lazy { findPreference(PREF_TG_GROUP) } - private val mode: Preference by lazy { findPreference(AppConfig.PREF_MODE) } + private val mode by lazy { findPreference(AppConfig.PREF_MODE) as ListPreference } private fun restartProxy() { Utils.stopVService(requireContext()) @@ -164,6 +165,7 @@ class SettingsActivity : BaseActivity() { updatePerAppProxy(newValue.toString()) true } + mode.dialogLayoutResource = R.layout.preference_with_help_link // donate.onClick { // startActivity() @@ -231,4 +233,8 @@ class SettingsActivity : BaseActivity() { } } } + + fun onModeHelpClicked(view: View) { + Utils.openUri(this, AppConfig.v2rayNGWikiMode) + } } diff --git a/V2rayNG/app/src/main/res/layout/preference_with_help_link.xml b/V2rayNG/app/src/main/res/layout/preference_with_help_link.xml new file mode 100644 index 00000000..da232f93 --- /dev/null +++ b/V2rayNG/app/src/main/res/layout/preference_with_help_link.xml @@ -0,0 +1,9 @@ + +