diff --git a/README.md b/README.md index 3e26b85f..7acd0f03 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,25 @@ # v2rayNG +A V2Ray client for Android + +[![API](https://img.shields.io/badge/API-17%2B-yellow.svg?style=flat)](https://developer.android.com/about/versions/jelly-bean#android-4.2) +[![Kotlin Version](https://img.shields.io/badge/Kotlin-1.3.40-blue.svg)](https://kotlinlang.org) +[![GitHub commit activity](https://img.shields.io/github/commit-activity/m/2dust/v2rayNG)](https://github.com/2dust/v2rayNG/commits/master) +[![CodeFactor](https://www.codefactor.io/repository/github/2dust/v2rayng/badge)](https://www.codefactor.io/repository/github/2dust/v2rayng) +[![GitHub Releases](https://img.shields.io/github/downloads/2dust/v2rayNG/latest/total?logo=github)](https://github.com/2dust/v2rayNG/releases) + Get it on Google Play + +### Usage + +See our [wiki](https://github.com/2dust/v2rayNG/wiki) + +### Development guide + +Android project under V2rayNG folder can be compiled directly in Android Studio, or using Gradle wrapper. But the v2ray core inside the aar is (probably) outdated. +The aar can be compiled from the Golang project under AndroidLibV2rayLite folder. For a quick start, read guide for [Go Mobile](https://github.com/golang/go/wiki/Mobile) +and [Makefiles for Go Developers](https://tutorialedge.net/golang/makefiles-for-go-developers/) + +v2rayNG can run on Android Emulators, with minimum Android 5.0 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 @@ + +