diff options
Diffstat (limited to 'app/src/main/java/org/pacien/tincapp/activities/status')
7 files changed, 23 insertions, 23 deletions
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 cebbc16..67779e1 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 | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon | 2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon |
3 | * Copyright (C) 2017-2018 Pacien TRAN-GIRARD | 3 | * Copyright (C) 2017-2019 Pacien TRAN-GIRARD |
4 | * | 4 | * |
5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
@@ -20,7 +20,7 @@ package org.pacien.tincapp.activities.status | |||
20 | 20 | ||
21 | import android.content.Intent | 21 | import android.content.Intent |
22 | import android.os.Bundle | 22 | import android.os.Bundle |
23 | import android.support.v7.app.AlertDialog | 23 | import androidx.appcompat.app.AlertDialog |
24 | import android.view.Menu | 24 | import android.view.Menu |
25 | import android.view.MenuItem | 25 | import android.view.MenuItem |
26 | import kotlinx.android.synthetic.main.status_activity.* | 26 | import kotlinx.android.synthetic.main.status_activity.* |
diff --git a/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeInfoArrayAdapter.kt b/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeInfoArrayAdapter.kt index ee103ee..42614aa 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeInfoArrayAdapter.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeInfoArrayAdapter.kt | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon | 2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon |
3 | * Copyright (C) 2017-2018 Pacien TRAN-GIRARD | 3 | * Copyright (C) 2017-2019 Pacien TRAN-GIRARD |
4 | * | 4 | * |
5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
@@ -19,7 +19,7 @@ | |||
19 | package org.pacien.tincapp.activities.status.nodes | 19 | package org.pacien.tincapp.activities.status.nodes |
20 | 20 | ||
21 | import android.content.Context | 21 | import android.content.Context |
22 | import android.databinding.DataBindingUtil | 22 | import androidx.databinding.DataBindingUtil |
23 | import android.view.LayoutInflater | 23 | import android.view.LayoutInflater |
24 | import android.view.View | 24 | import android.view.View |
25 | import android.view.ViewGroup | 25 | import android.view.ViewGroup |
@@ -29,10 +29,10 @@ import org.pacien.tincapp.databinding.StatusNodeListItemBinding | |||
29 | /** | 29 | /** |
30 | * @author pacien | 30 | * @author pacien |
31 | */ | 31 | */ |
32 | class NodeInfoArrayAdapter(context: Context?, private val onItemClick: (NodeInfo) -> Unit) : ArrayAdapter<NodeInfo>(context, -1) { | 32 | class NodeInfoArrayAdapter(context: Context, private val onItemClick: (NodeInfo) -> Unit) : ArrayAdapter<NodeInfo>(context, -1) { |
33 | private val layoutInflater = LayoutInflater.from(context)!! | 33 | private val layoutInflater = LayoutInflater.from(context)!! |
34 | 34 | ||
35 | override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View { | 35 | override fun getView(position: Int, convertView: View?, parent: ViewGroup): View { |
36 | val binding = when (convertView) { | 36 | val binding = when (convertView) { |
37 | null -> StatusNodeListItemBinding.inflate(layoutInflater, parent, false) | 37 | null -> StatusNodeListItemBinding.inflate(layoutInflater, parent, false) |
38 | else -> DataBindingUtil.getBinding(convertView)!! | 38 | else -> DataBindingUtil.getBinding(convertView)!! |
diff --git a/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeListFragment.kt b/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeListFragment.kt index 4d245ef..51b0c79 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeListFragment.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeListFragment.kt | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon | 2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon |
3 | * Copyright (C) 2017-2018 Pacien TRAN-GIRARD | 3 | * Copyright (C) 2017-2019 Pacien TRAN-GIRARD |
4 | * | 4 | * |
5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
@@ -18,10 +18,10 @@ | |||
18 | 18 | ||
19 | package org.pacien.tincapp.activities.status.nodes | 19 | package org.pacien.tincapp.activities.status.nodes |
20 | 20 | ||
21 | import android.arch.lifecycle.Observer | 21 | import androidx.lifecycle.Observer |
22 | import android.arch.lifecycle.ViewModelProviders | 22 | import androidx.lifecycle.ViewModelProviders |
23 | import android.os.Bundle | 23 | import android.os.Bundle |
24 | import android.support.v7.app.AlertDialog | 24 | import androidx.appcompat.app.AlertDialog |
25 | import android.view.LayoutInflater | 25 | import android.view.LayoutInflater |
26 | import android.view.View | 26 | import android.view.View |
27 | import android.view.ViewGroup | 27 | import android.view.ViewGroup |
@@ -43,7 +43,7 @@ class NodeListFragment : BaseFragment() { | |||
43 | private val tincCtl = Tinc | 43 | private val tincCtl = Tinc |
44 | private val netName by lazy { vpnService.getCurrentNetName()!! } | 44 | private val netName by lazy { vpnService.getCurrentNetName()!! } |
45 | private val nodeListViewModel by lazy { ViewModelProviders.of(this).get(NodeListViewModel::class.java) } | 45 | private val nodeListViewModel by lazy { ViewModelProviders.of(this).get(NodeListViewModel::class.java) } |
46 | private val nodeListAdapter by lazy { NodeInfoArrayAdapter(context, this::onItemClick) } | 46 | private val nodeListAdapter by lazy { NodeInfoArrayAdapter(requireContext(), this::onItemClick) } |
47 | private val nodeListObserver by lazy { Observer<List<NodeInfo>> { nodeListAdapter.setElements(it) } } | 47 | private val nodeListObserver by lazy { Observer<List<NodeInfo>> { nodeListAdapter.setElements(it) } } |
48 | 48 | ||
49 | override fun onCreate(savedInstanceState: Bundle?) { | 49 | override fun onCreate(savedInstanceState: Bundle?) { |
diff --git a/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeListViewModel.kt b/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeListViewModel.kt index 81b0aca..2e8c139 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeListViewModel.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeListViewModel.kt | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon | 2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon |
3 | * Copyright (C) 2017-2018 Pacien TRAN-GIRARD | 3 | * Copyright (C) 2017-2019 Pacien TRAN-GIRARD |
4 | * | 4 | * |
5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
@@ -18,7 +18,7 @@ | |||
18 | 18 | ||
19 | package org.pacien.tincapp.activities.status.nodes | 19 | package org.pacien.tincapp.activities.status.nodes |
20 | 20 | ||
21 | import android.arch.lifecycle.ViewModel | 21 | import androidx.lifecycle.ViewModel |
22 | import org.pacien.tincapp.service.TincVpnService | 22 | import org.pacien.tincapp.service.TincVpnService |
23 | 23 | ||
24 | /** | 24 | /** |
diff --git a/app/src/main/java/org/pacien/tincapp/activities/status/subnets/SubnetInfoArrayAdapter.kt b/app/src/main/java/org/pacien/tincapp/activities/status/subnets/SubnetInfoArrayAdapter.kt index a5e4a1d..b647324 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/status/subnets/SubnetInfoArrayAdapter.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/status/subnets/SubnetInfoArrayAdapter.kt | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon | 2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon |
3 | * Copyright (C) 2017-2018 Pacien TRAN-GIRARD | 3 | * Copyright (C) 2017-2019 Pacien TRAN-GIRARD |
4 | * | 4 | * |
5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
@@ -19,7 +19,7 @@ | |||
19 | package org.pacien.tincapp.activities.status.subnets | 19 | package org.pacien.tincapp.activities.status.subnets |
20 | 20 | ||
21 | import android.content.Context | 21 | import android.content.Context |
22 | import android.databinding.DataBindingUtil | 22 | import androidx.databinding.DataBindingUtil |
23 | import android.view.LayoutInflater | 23 | import android.view.LayoutInflater |
24 | import android.view.View | 24 | import android.view.View |
25 | import android.view.ViewGroup | 25 | import android.view.ViewGroup |
@@ -29,10 +29,10 @@ import org.pacien.tincapp.databinding.StatusSubnetListItemBinding | |||
29 | /** | 29 | /** |
30 | * @author pacien | 30 | * @author pacien |
31 | */ | 31 | */ |
32 | class SubnetInfoArrayAdapter(context: Context?) : ArrayAdapter<SubnetInfo>(context, -1) { | 32 | class SubnetInfoArrayAdapter(context: Context) : ArrayAdapter<SubnetInfo>(context, -1) { |
33 | private val layoutInflater = LayoutInflater.from(context)!! | 33 | private val layoutInflater = LayoutInflater.from(context)!! |
34 | 34 | ||
35 | override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View { | 35 | override fun getView(position: Int, convertView: View?, parent: ViewGroup): View { |
36 | val binding = when (convertView) { | 36 | val binding = when (convertView) { |
37 | null -> StatusSubnetListItemBinding.inflate(layoutInflater, parent, false) | 37 | null -> StatusSubnetListItemBinding.inflate(layoutInflater, parent, false) |
38 | else -> DataBindingUtil.getBinding(convertView)!! | 38 | else -> DataBindingUtil.getBinding(convertView)!! |
diff --git a/app/src/main/java/org/pacien/tincapp/activities/status/subnets/SubnetListFragment.kt b/app/src/main/java/org/pacien/tincapp/activities/status/subnets/SubnetListFragment.kt index abaf517..62f6876 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/status/subnets/SubnetListFragment.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/status/subnets/SubnetListFragment.kt | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon | 2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon |
3 | * Copyright (C) 2017-2018 Pacien TRAN-GIRARD | 3 | * Copyright (C) 2017-2019 Pacien TRAN-GIRARD |