aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorpacien2018-08-19 18:14:00 +0200
committerpacien2018-08-19 18:14:00 +0200
commitdaf8d2fe48f1e2d5cef79b978ad73991bf1f0011 (patch)
treed1be2de6b91dcc6e13e1017a83bc7c70d1534521 /app/src/main/java
parent483e6634e0621d2100ae11cbcd8cba6d21a76c4e (diff)
downloadtincapp-daf8d2fe48f1e2d5cef79b978ad73991bf1f0011.tar.gz
Display current network name in activity action bar
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/org/pacien/tincapp/activities/status/NetworkInfoFragment.kt2
-rw-r--r--app/src/main/java/org/pacien/tincapp/activities/status/StatusActivity.kt3
2 files changed, 3 insertions, 2 deletions
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
31 */ 31 */
32class NetworkInfoFragment : Fragment() { 32class NetworkInfoFragment : Fragment() {
33 private val vpnService by lazy { TincVpnService } 33 private val vpnService by lazy { TincVpnService }
34 private val netName by lazy { vpnService.getCurrentNetName() }
35 private val interfaceConfiguration by lazy { vpnService.getCurrentInterfaceCfg() } 34 private val interfaceConfiguration by lazy { vpnService.getCurrentInterfaceCfg() }
36 private val listFormatter = VpnInterfaceConfigurationFormatter 35 private val listFormatter = VpnInterfaceConfigurationFormatter
37 36
38 override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { 37 override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
39 val binding = StatusNetworkInfoFragmentBinding.inflate(inflater, container, false) 38 val binding = StatusNetworkInfoFragmentBinding.inflate(inflater, container, false)
40 binding.netName = netName
41 binding.vpnInterfaceConfiguration = interfaceConfiguration 39 binding.vpnInterfaceConfiguration = interfaceConfiguration
42 binding.listFormatter = listFormatter 40 binding.listFormatter = listFormatter
43 return binding.root 41 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
51 * @author pacien 51 * @author pacien
52 */ 52 */
53class StatusActivity : BaseActivity(), AdapterView.OnItemClickListener, SwipeRefreshLayout.OnRefreshListener { 53class StatusActivity : BaseActivity(), AdapterView.OnItemClickListener, SwipeRefreshLayout.OnRefreshListener {
54 private val vpnService by lazy { TincVpnService }
55 private val netName by lazy { vpnService.getCurrentNetName() }
54 private val broadcastMapper = BroadcastMapper(mapOf(Actions.EVENT_DISCONNECTED to this::onVpnShutdown)) 56 private val broadcastMapper = BroadcastMapper(mapOf(Actions.EVENT_DISCONNECTED to this::onVpnShutdown))
55 private var shutdownDialog: AlertDialog? = null 57 private var shutdownDialog: AlertDialog? = null
56 private var nodeListAdapter: ArrayAdapter<String>? = null 58 private var nodeListAdapter: ArrayAdapter<String>? = null
@@ -59,6 +61,7 @@ class StatusActivity : BaseActivity(), AdapterView.OnItemClickListener, SwipeRef
59 61
60 override fun onCreate(savedInstanceState: Bundle?) { 62 override fun onCreate(savedInstanceState: Bundle?) {
61 super.onCreate(savedInstanceState) 63 super.onCreate(savedInstanceState)
64 supportActionBar.subtitle = getString(R.string.status_activity_state_connected_to_format, netName)
62 nodeListAdapter = ArrayAdapter(this, R.layout.fragment_list_item) 65 nodeListAdapter = ArrayAdapter(this, R.layout.fragment_list_item)
63 66
64 layoutInflater.inflate(R.layout.fragment_list_view, main_content) 67 layoutInflater.inflate(R.layout.fragment_list_view, main_content)