Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Projects
Groups
Snippets
Sign up now
Login
Sign in / Register
Toggle navigation
Menu
Open sidebar
PublicAndroidApps
Nebulo
Commits
995db732
Commit
995db732
authored
Sep 03, 2020
by
Daniel Wolf
Browse files
Link FAQ for non-VPN mode in the preferences
Implements #264
parent
a1e49abb
Pipeline
#7383
passed with stage
in 4 minutes and 16 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/com/frostnerd/smokescreen/Extensions.kt
View file @
995db732
...
...
@@ -4,10 +4,7 @@ import android.app.Activity
import
android.app.AlarmManager
import
android.app.KeyguardManager
import
android.app.PendingIntent
import
android.content.BroadcastReceiver
import
android.content.Context
import
android.content.Intent
import
android.content.IntentFilter
import
android.content.*
import
android.hardware.fingerprint.FingerprintManager
import
android.net.ConnectivityManager
import
android.net.Network
...
...
@@ -15,6 +12,7 @@ import android.net.NetworkCapabilities
import
android.net.Uri
import
android.os.Build
import
android.os.PowerManager
import
android.widget.Toast
import
androidx.appcompat.app.AppCompatActivity
import
androidx.fragment.app.Fragment
import
androidx.lifecycle.Lifecycle
...
...
@@ -423,4 +421,17 @@ val Context.isPrivateDnsActive: Boolean
if
(
it
.
activeNetwork
==
null
)
false
else
it
.
getLinkProperties
(
it
.
activeNetwork
)
?.
isPrivateDnsActive
?:
false
}
}
\ No newline at end of file
}
fun
Context
.
tryOpenBrowser
(
withLink
:
String
)
{
try
{
startActivity
(
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
withLink
)
)
)
}
catch
(
e
:
ActivityNotFoundException
)
{
Toast
.
makeText
(
this
,
R
.
string
.
error_no_webbrowser_installed
,
Toast
.
LENGTH_LONG
).
show
()
}
}
\ No newline at end of file
app/src/main/java/com/frostnerd/smokescreen/fragment/AboutFragment.kt
View file @
995db732
...
...
@@ -118,17 +118,7 @@ class AboutFragment : Fragment() {
true
}
view
.
faq
.
setOnClickListener
{
try
{
startActivity
(
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
"https://nebulo.app/faq"
)
)
)
}
catch
(
e
:
ActivityNotFoundException
)
{
Toast
.
makeText
(
requireContext
(),
R
.
string
.
error_no_webbrowser_installed
,
Toast
.
LENGTH_LONG
)
.
show
()
}
requireContext
().
tryOpenBrowser
(
"https://nebulo.app/faq"
)
}
}
}
\ No newline at end of file
app/src/main/java/com/frostnerd/smokescreen/fragment/SettingsFragment.kt
View file @
995db732
...
...
@@ -325,6 +325,10 @@ class SettingsFragment : PreferenceFragmentCompat() {
)
true
}
findPreference
(
"nonvpn_help_faq"
).
setOnPreferenceClickListener
{
requireContext
().
tryOpenBrowser
(
"https://nebulo.app/faq#non-vpn-mode"
)
true
}
}
@SuppressLint
(
"NewApi"
)
...
...
app/src/main/res/values/strings-preference.xml
View file @
995db732
...
...
@@ -183,6 +183,8 @@
<string
name=
"nonvpn_help_generic_title"
>
Generic VPN apps
</string>
<string
name=
"summary_nonvpn_help_generic"
>
Click here to get instructions on how to configure VPN apps
</string>
<string
name=
"title_nonvpn_help_faq"
>
Documentation
</string>
<string
name=
"summary_nonvpn_help_faq"
>
Click here to open a browser window with help and documentation for non-VPN mode
</string>
<string-array
name=
"languages"
>
<item>
System language
</item>
...
...
app/src/main/res/xml/preferences_nonvpnmode.xml
View file @
995db732
...
...
@@ -3,6 +3,11 @@
<androidx.preference.Preference
android:summary=
"@string/summary_category_nonvpnmode"
/>
<androidx.preference.Preference
android:summary=
"@string/summary_nonvpn_help_faq"
android:key=
"nonvpn_help_faq"
android:title=
"@string/title_nonvpn_help_faq"
/>
<androidx.preference.PreferenceCategory
android:title=
"@string/preference_category_nonvpnmode"
>
<androidx.preference.CheckBoxPreference
android:defaultValue=
"false"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment