Commit c1e2c90b authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Added an about menu item

parent b6a5e831
......@@ -103,8 +103,8 @@
<map>
<entry key="assetSourceType" value="FILE" />
<entry key="autoMirrored" value="true" />
<entry key="outputName" value="ic_main_server" />
<entry key="sourceFile" value="E:\Dev\fontawesome-pro-5.4.1-desktop\svgs\solid\server.svg" />
<entry key="outputName" value="ic_binoculars" />
<entry key="sourceFile" value="E:\Dev\fontawesome-pro-5.6.0-desktop\svgs\solid\binoculars.svg" />
</map>
</option>
</PersistentState>
......
......@@ -37,7 +37,7 @@ dependencies {
implementation 'com.frostnerd.utilskt:preferences:1.3.4'
implementation 'com.frostnerd.utilskt:navigationdraweractivity:1.0.7'
implementation 'com.frostnerd.utilskt:encrypteddnstunnelproxy:1.2.24'
implementation 'com.frostnerd.utilskt:encrypteddnstunnelproxy:1.2.25'
implementation 'com.frostnerd.utilskt:general:1.0.5'
implementation 'com.frostnerd.utils:materialedittext:1.0.17'
implementation 'com.frostnerd.utils:design:1.0.17'
......
package com.frostnerd.smokescreen
import android.content.Context
import android.graphics.Color
import android.text.Html
import android.text.SpannableString
import android.text.method.LinkMovementMethod
import android.text.util.Linkify
import android.widget.TextView
/**
* Copyright Daniel Wolf 2018
* All rights reserved.
* Code may NOT be used without proper permission, neither in binary nor in source form.
* All redistributions of this software in source code must retain this copyright header
* All redistributions of this software in binary form must visibly inform users about usage of this software
*
* development@frostnerd.com
*/
fun showInfoTextDialog(context:Context, title:String, text:String): androidx.appcompat.app.AlertDialog {
val stringWithLinks = SpannableString(text)
Linkify.addLinks(stringWithLinks, Linkify.ALL)
val dialog = androidx.appcompat.app.AlertDialog.Builder(context, context.getPreferences().theme.dialogStyle)
.setTitle(title)
.setMessage(stringWithLinks)
.setNeutralButton(R.string.ok, null)
.show()
val textView = dialog.findViewById<TextView>(android.R.id.message)
textView?.movementMethod = LinkMovementMethod.getInstance()
textView?.setLinkTextColor(Color.parseColor("#64B5F6"))
return dialog
}
\ No newline at end of file
......@@ -6,12 +6,16 @@ import androidx.fragment.app.Fragment
import com.frostnerd.encrypteddnstunnelproxy.AbstractHttpsDNSHandle
import com.frostnerd.navigationdraweractivity.NavigationDrawerActivity
import com.frostnerd.navigationdraweractivity.StyleOptions
import com.frostnerd.navigationdraweractivity.items.ClickableDrawerItem
import com.frostnerd.navigationdraweractivity.items.DividerDrawerItem
import com.frostnerd.navigationdraweractivity.items.DrawerItem
import com.frostnerd.navigationdraweractivity.items.FragmentDrawerItem
import com.frostnerd.smokescreen.BuildConfig
import com.frostnerd.smokescreen.R
import com.frostnerd.smokescreen.fragment.MainFragment
import com.frostnerd.smokescreen.fragment.SettingsFragment
import com.frostnerd.smokescreen.getPreferences
import com.frostnerd.smokescreen.showInfoTextDialog
class MainActivity : NavigationDrawerActivity() {
private var textColor: Int = 0
......@@ -45,6 +49,30 @@ class MainActivity : NavigationDrawerActivity() {
}
})
)
items.add(DividerDrawerItem())
items.add(
ClickableDrawerItem(getString(R.string.menu_about),
iconLeft = getDrawable(R.drawable.ic_binoculars),
clickListener = object :ClickableDrawerItem.ClickListener {
override fun onClick(
item: ClickableDrawerItem,
drawerActivity: NavigationDrawerActivity,
arguments: Bundle?
): Boolean {
showInfoTextDialog(this@MainActivity,
getString(R.string.menu_about),
getString(R.string.about_app, BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE))
return false
}
override fun onLongClick(
item: ClickableDrawerItem,
drawerActivity: NavigationDrawerActivity
): Boolean {
return false
}
})
)
return items
}
......
<vector android:autoMirrored="true" android:height="24dp"
android:viewportHeight="512" android:viewportWidth="512"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M416,48c0,-8.84 -7.16,-16 -16,-16h-64c-8.84,0 -16,7.16 -16,16v48h96L416,48zM63.91,159.99C61.4,253.84 3.46,274.22 0,404v44c0,17.67 14.33,32 32,32h96c17.67,0 32,-14.33 32,-32L160,288h32L192,128L95.84,128c-17.63,0 -31.45,14.37 -31.93,31.99zM448.09,159.99c-0.48,-17.62 -14.3,-31.99 -31.93,-31.99L320,128v160h32v160c0,17.67 14.33,32 32,32h96c17.67,0 32,-14.33 32,-32v-44c-3.46,-129.78 -61.4,-150.16 -63.91,-244.01zM176,32h-64c-8.84,0 -16,7.16 -16,16v48h96L192,48c0,-8.84 -7.16,-16 -16,-16zM224,288h64L288,128h-64v160z"/>
</vector>
......@@ -9,9 +9,14 @@
<string name="menu_main">Main screen</string>
<string name="menu_dnsoverhttps">DNS over HTTPS</string>
<string name="menu_settings">Settings</string>
<string name="menu_about">About this app</string>
<string name="main_dnssurveillance_infotext">Be aware that the DNS server you are connected to is able to record which sites you are visiting. Check the respective privacy statements for more information.</string>
<string name="main_dnssurveillance_privacystatement">Privacy statement of %1s</string>
<string name="about_app">This app is open source. The source code can be accessed at smokescreen.app/source.\nFurthermore the app doesn\'t contain ads and does not track or collect any data about you.\n\nVersion %1s\nBuild %2d\n\n&#169; Daniel Wolf 2018\nAll rights reserved.\n<a href="mailto:support@frostnerd.com">support@frostnerd.com</a></string>
<string-array name="theme">
<item>Mono</item>
<item>Dark</item>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment