From daf8d2fe48f1e2d5cef79b978ad73991bf1f0011 Mon Sep 17 00:00:00 2001
From: pacien
Date: Sun, 19 Aug 2018 18:14:00 +0200
Subject: Display current network name in activity action bar
---
.../tincapp/activities/status/NetworkInfoFragment.kt | 2 --
.../pacien/tincapp/activities/status/StatusActivity.kt | 3 +++
app/src/main/res/layout/status_network_info_fragment.xml | 16 ----------------
app/src/main/res/values/strings.xml | 1 +
4 files changed, 4 insertions(+), 18 deletions(-)
(limited to 'app')
diff --git a/app/src/main/java/org/pacien/tincapp/activities/status/NetworkInfoFragment.kt b/app/src/main/java/org/pacien/tincapp/activities/status/NetworkInfoFragment.kt
index 385f996..de6f741 100644
--- a/app/src/main/java/org/pacien/tincapp/activities/status/NetworkInfoFragment.kt
+++ b/app/src/main/java/org/pacien/tincapp/activities/status/NetworkInfoFragment.kt
@@ -31,13 +31,11 @@ import org.pacien.tincapp.service.TincVpnService
*/
class NetworkInfoFragment : Fragment() {
private val vpnService by lazy { TincVpnService }
- private val netName by lazy { vpnService.getCurrentNetName() }
private val interfaceConfiguration by lazy { vpnService.getCurrentInterfaceCfg() }
private val listFormatter = VpnInterfaceConfigurationFormatter
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
val binding = StatusNetworkInfoFragmentBinding.inflate(inflater, container, false)
- binding.netName = netName
binding.vpnInterfaceConfiguration = interfaceConfiguration
binding.listFormatter = listFormatter
return binding.root
diff --git a/app/src/main/java/org/pacien/tincapp/activities/status/StatusActivity.kt b/app/src/main/java/org/pacien/tincapp/activities/status/StatusActivity.kt
index 3125738..e5ca307 100644
--- a/app/src/main/java/org/pacien/tincapp/activities/status/StatusActivity.kt
+++ b/app/src/main/java/org/pacien/tincapp/activities/status/StatusActivity.kt
@@ -51,6 +51,8 @@ import kotlin.concurrent.timerTask
* @author pacien
*/
class StatusActivity : BaseActivity(), AdapterView.OnItemClickListener, SwipeRefreshLayout.OnRefreshListener {
+ private val vpnService by lazy { TincVpnService }
+ private val netName by lazy { vpnService.getCurrentNetName() }
private val broadcastMapper = BroadcastMapper(mapOf(Actions.EVENT_DISCONNECTED to this::onVpnShutdown))
private var shutdownDialog: AlertDialog? = null
private var nodeListAdapter: ArrayAdapter? = null
@@ -59,6 +61,7 @@ class StatusActivity : BaseActivity(), AdapterView.OnItemClickListener, SwipeRef
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
+ supportActionBar.subtitle = getString(R.string.status_activity_state_connected_to_format, netName)
nodeListAdapter = ArrayAdapter(this, R.layout.fragment_list_item)
layoutInflater.inflate(R.layout.fragment_list_view, main_content)
diff --git a/app/src/main/res/layout/status_network_info_fragment.xml b/app/src/main/res/layout/status_network_info_fragment.xml
index 8038180..2dfe1bc 100644
--- a/app/src/main/res/layout/status_network_info_fragment.xml
+++ b/app/src/main/res/layout/status_network_info_fragment.xml
@@ -24,10 +24,6 @@
-
-
@@ -40,18 +36,6 @@
-
-
-
-
-
-
-
-
Encrypting/decrypting private keys
+ Connected to %s
Nodes
Network info
--
cgit v1.2.3