From c25f024320abf58d0831f10fa877f6a58635cd53 Mon Sep 17 00:00:00 2001 From: pacien Date: Sun, 13 Oct 2019 01:09:17 +0200 Subject: target sdk 28 switching from android.support to androidx --- .../main/java/org/pacien/tincapp/activities/BaseActivity.kt | 12 ++++++------ .../java/org/pacien/tincapp/activities/BaseDialogFragment.kt | 6 +++--- .../main/java/org/pacien/tincapp/activities/BaseFragment.kt | 6 +++--- .../tincapp/activities/common/FragmentListPagerAdapter.kt | 6 +++--- .../org/pacien/tincapp/activities/common/ProgressModal.kt | 4 ++-- .../pacien/tincapp/activities/common/RecentCrashHandler.kt | 4 ++-- .../tincapp/activities/common/SelfRefreshingLiveData.kt | 4 ++-- .../configure/tools/ConfigurationToolDialogFragment.kt | 8 ++++---- .../org/pacien/tincapp/activities/start/ConnectionStarter.kt | 2 +- .../pacien/tincapp/activities/start/NetworkListFragment.kt | 6 +++--- .../pacien/tincapp/activities/start/NetworkListViewModel.kt | 4 ++-- .../org/pacien/tincapp/activities/start/StartActivity.kt | 4 ++-- .../org/pacien/tincapp/activities/status/StatusActivity.kt | 4 ++-- .../tincapp/activities/status/nodes/NodeInfoArrayAdapter.kt | 8 ++++---- .../tincapp/activities/status/nodes/NodeListFragment.kt | 10 +++++----- .../tincapp/activities/status/nodes/NodeListViewModel.kt | 4 ++-- .../activities/status/subnets/SubnetInfoArrayAdapter.kt | 8 ++++---- .../tincapp/activities/status/subnets/SubnetListFragment.kt | 8 ++++---- .../tincapp/activities/status/subnets/SubnetListViewModel.kt | 4 ++-- .../org/pacien/tincapp/activities/viewlog/LogViewModel.kt | 4 ++-- .../org/pacien/tincapp/activities/viewlog/ViewLogActivity.kt | 6 +++--- app/src/main/java/org/pacien/tincapp/context/App.kt | 4 ++-- .../org/pacien/tincapp/context/AppNotificationManager.kt | 8 ++++---- .../main/java/org/pacien/tincapp/intent/BroadcastMapper.kt | 4 ++-- .../main/java/org/pacien/tincapp/service/TincVpnService.kt | 6 +++--- app/src/main/res/layout/base_activity.xml | 4 ++-- app/src/main/res/layout/status_activity.xml | 8 ++++---- 27 files changed, 78 insertions(+), 78 deletions(-) (limited to 'app/src') diff --git a/app/src/main/java/org/pacien/tincapp/activities/BaseActivity.kt b/app/src/main/java/org/pacien/tincapp/activities/BaseActivity.kt index 196ccd3..37eef88 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/BaseActivity.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/BaseActivity.kt @@ -1,6 +1,6 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2019 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,11 +20,11 @@ package org.pacien.tincapp.activities import android.content.Intent import android.os.Bundle -import android.support.annotation.LayoutRes -import android.support.annotation.StringRes -import android.support.design.widget.Snackbar -import android.support.v7.app.AlertDialog -import android.support.v7.app.AppCompatActivity +import androidx.annotation.LayoutRes +import androidx.annotation.StringRes +import com.google.android.material.snackbar.Snackbar +import androidx.appcompat.app.AlertDialog +import androidx.appcompat.app.AppCompatActivity import android.view.* import kotlinx.android.synthetic.main.base_activity.* import org.pacien.tincapp.R diff --git a/app/src/main/java/org/pacien/tincapp/activities/BaseDialogFragment.kt b/app/src/main/java/org/pacien/tincapp/activities/BaseDialogFragment.kt index ae82fe7..1811c0c 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/BaseDialogFragment.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/BaseDialogFragment.kt @@ -1,6 +1,6 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2019 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,8 +19,8 @@ package org.pacien.tincapp.activities import android.content.Context -import android.support.annotation.LayoutRes -import android.support.v4.app.DialogFragment +import androidx.annotation.LayoutRes +import androidx.fragment.app.DialogFragment import android.view.LayoutInflater import android.view.View import android.view.ViewGroup diff --git a/app/src/main/java/org/pacien/tincapp/activities/BaseFragment.kt b/app/src/main/java/org/pacien/tincapp/activities/BaseFragment.kt index 44f57c7..6f0e5f9 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/BaseFragment.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/BaseFragment.kt @@ -1,6 +1,6 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2019 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +18,8 @@ package org.pacien.tincapp.activities -import android.support.annotation.LayoutRes -import android.support.v4.app.Fragment +import androidx.annotation.LayoutRes +import androidx.fragment.app.Fragment import android.view.LayoutInflater import android.view.View import android.view.ViewGroup diff --git a/app/src/main/java/org/pacien/tincapp/activities/common/FragmentListPagerAdapter.kt b/app/src/main/java/org/pacien/tincapp/activities/common/FragmentListPagerAdapter.kt index c55e889..7603fa7 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/common/FragmentListPagerAdapter.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/common/FragmentListPagerAdapter.kt @@ -1,6 +1,6 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2019 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +18,8 @@ package org.pacien.tincapp.activities.common -import android.support.v4.app.FragmentManager -import android.support.v4.app.FragmentPagerAdapter +import androidx.fragment.app.FragmentManager +import androidx.fragment.app.FragmentPagerAdapter import org.pacien.tincapp.activities.BaseFragment import org.pacien.tincapp.context.App diff --git a/app/src/main/java/org/pacien/tincapp/activities/common/ProgressModal.kt b/app/src/main/java/org/pacien/tincapp/activities/common/ProgressModal.kt index d4310a1..284f4de 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/common/ProgressModal.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/common/ProgressModal.kt @@ -1,6 +1,6 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2019 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ package org.pacien.tincapp.activities.common import android.annotation.SuppressLint import android.app.Activity -import android.support.v7.app.AlertDialog +import androidx.appcompat.app.AlertDialog import android.view.LayoutInflater import android.view.View import android.widget.TextView diff --git a/app/src/main/java/org/pacien/tincapp/activities/common/RecentCrashHandler.kt b/app/src/main/java/org/pacien/tincapp/activities/common/RecentCrashHandler.kt index 2bdbcca..d85768c 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/common/RecentCrashHandler.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/common/RecentCrashHandler.kt @@ -1,6 +1,6 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2019 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ package org.pacien.tincapp.activities.common -import android.support.v7.app.AlertDialog +import androidx.appcompat.app.AlertDialog import org.apache.commons.io.input.ReversedLinesFileReader import org.pacien.tincapp.R import org.pacien.tincapp.activities.BaseActivity diff --git a/app/src/main/java/org/pacien/tincapp/activities/common/SelfRefreshingLiveData.kt b/app/src/main/java/org/pacien/tincapp/activities/common/SelfRefreshingLiveData.kt index cb98736..8a2e1c9 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/common/SelfRefreshingLiveData.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/common/SelfRefreshingLiveData.kt @@ -1,6 +1,6 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2019 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ package org.pacien.tincapp.activities.common -import android.arch.lifecycle.LiveData +import androidx.lifecycle.LiveData import java.util.concurrent.Executors import java.util.concurrent.ScheduledFuture import java.util.concurrent.TimeUnit diff --git a/app/src/main/java/org/pacien/tincapp/activities/configure/tools/ConfigurationToolDialogFragment.kt b/app/src/main/java/org/pacien/tincapp/activities/configure/tools/ConfigurationToolDialogFragment.kt index 9c94bf1..cfb365c 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/configure/tools/ConfigurationToolDialogFragment.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/configure/tools/ConfigurationToolDialogFragment.kt @@ -1,6 +1,6 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2019 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,9 +18,9 @@ package org.pacien.tincapp.activities.configure.tools -import android.support.annotation.LayoutRes -import android.support.annotation.StringRes -import android.support.v7.app.AlertDialog +import androidx.annotation.LayoutRes +import androidx.annotation.StringRes +import androidx.appcompat.app.AlertDialog import android.view.View import java8.util.concurrent.CompletableFuture import org.pacien.tincapp.R diff --git a/app/src/main/java/org/pacien/tincapp/activities/start/ConnectionStarter.kt b/app/src/main/java/org/pacien/tincapp/activities/start/ConnectionStarter.kt index c0c6e02..6191e12 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/start/ConnectionStarter.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/start/ConnectionStarter.kt @@ -19,7 +19,7 @@ package org.pacien.tincapp.activities.start import android.net.VpnService -import android.support.v7.app.AlertDialog +import androidx.appcompat.app.AlertDialog import android.view.inputmethod.EditorInfo import kotlinx.android.synthetic.main.base_activity.* import kotlinx.android.synthetic.main.dialog_decrypt_keys.view.* diff --git a/app/src/main/java/org/pacien/tincapp/activities/start/NetworkListFragment.kt b/app/src/main/java/org/pacien/tincapp/activities/start/NetworkListFragment.kt index 98e717b..d3cc803 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/start/NetworkListFragment.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/start/NetworkListFragment.kt @@ -1,6 +1,6 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2019 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ package org.pacien.tincapp.activities.start -import android.arch.lifecycle.Observer +import androidx.lifecycle.Observer import android.os.Bundle import android.view.LayoutInflater import android.view.View @@ -39,7 +39,7 @@ import org.pacien.tincapp.extensions.setElements class NetworkListFragment : BaseFragment() { private val appPaths = AppPaths private val networkListViewModel by lazy { NetworkListViewModel() } - private val networkListAdapter by lazy { ArrayAdapter(context, R.layout.start_network_list_item) } + private val networkListAdapter by lazy { ArrayAdapter(requireContext(), R.layout.start_network_list_item) } var connectToNetworkAction = { _: String -> Unit } override fun onCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/org/pacien/tincapp/activities/start/NetworkListViewModel.kt b/app/src/main/java/org/pacien/tincapp/activities/start/NetworkListViewModel.kt index 419522d..0cb341f 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/start/NetworkListViewModel.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/start/NetworkListViewModel.kt @@ -1,6 +1,6 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2019 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ package org.pacien.tincapp.activities.start -import android.arch.lifecycle.ViewModel +import androidx.lifecycle.ViewModel /** * @author pacien diff --git a/app/src/main/java/org/pacien/tincapp/activities/start/StartActivity.kt b/app/src/main/java/org/pacien/tincapp/activities/start/StartActivity.kt index 877492d..45c9c08 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/start/StartActivity.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/start/StartActivity.kt @@ -21,7 +21,7 @@ package org.pacien.tincapp.activities.start import android.app.Activity import android.content.Intent import android.os.Bundle -import android.support.v7.app.AlertDialog +import androidx.appcompat.app.AlertDialog import android.view.Menu import android.view.MenuItem import kotlinx.android.synthetic.main.start_activity.* @@ -56,7 +56,7 @@ class StartActivity : BaseActivity() { initNetworkListFragment() if (intent.action == Actions.ACTION_CONNECT && intent.data?.schemeSpecificPart != null) - connectionStarter.tryStart(intent.data.schemeSpecificPart, intent.data.fragment, false) + connectionStarter.tryStart(intent.data!!.schemeSpecificPart, intent.data!!.fragment, false) } private fun initNetworkListFragment() { 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 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2019 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ package org.pacien.tincapp.activities.status import android.content.Intent import android.os.Bundle -import android.support.v7.app.AlertDialog +import androidx.appcompat.app.AlertDialog import android.view.Menu import android.view.MenuItem 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 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2019 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ package org.pacien.tincapp.activities.status.nodes import android.content.Context -import android.databinding.DataBindingUtil +import androidx.databinding.DataBindingUtil import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -29,10 +29,10 @@ import org.pacien.tincapp.databinding.StatusNodeListItemBinding /** * @author pacien */ -class NodeInfoArrayAdapter(context: Context?, private val onItemClick: (NodeInfo) -> Unit) : ArrayAdapter(context, -1) { +class NodeInfoArrayAdapter(context: Context, private val onItemClick: (NodeInfo) -> Unit) : ArrayAdapter(context, -1) { private val layoutInflater = LayoutInflater.from(context)!! - override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View { + override fun getView(position: Int, convertView: View?, parent: ViewGroup): View { val binding = when (convertView) { null -> StatusNodeListItemBinding.inflate(layoutInflater, parent, false) 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 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2019 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,10 +18,10 @@ package org.pacien.tincapp.activities.status.nodes -import android.arch.lifecycle.Observer -import android.arch.lifecycle.ViewModelProviders +import androidx.lifecycle.Observer +import androidx.lifecycle.ViewModelProviders import android.os.Bundle -import android.support.v7.app.AlertDialog +import androidx.appcompat.app.AlertDialog import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -43,7 +43,7 @@ class NodeListFragment : BaseFragment() { private val tincCtl = Tinc private val netName by lazy { vpnService.getCurrentNetName()!! } private val nodeListViewModel by lazy { ViewModelProviders.of(this).get(NodeListViewModel::class.java) } - private val nodeListAdapter by lazy { NodeInfoArrayAdapter(context, this::onItemClick) } + private val nodeListAdapter by lazy { NodeInfoArrayAdapter(requireContext(), this::onItemClick) } private val nodeListObserver by lazy { Observer> { nodeListAdapter.setElements(it) } } 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 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2019 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ package org.pacien.tincapp.activities.status.nodes -import android.arch.lifecycle.ViewModel +import androidx.lifecycle.ViewModel import org.pacien.tincapp.service.TincVpnService /** 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 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2019 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ package org.pacien.tincapp.activities.status.subnets import android.content.Context -import android.databinding.DataBindingUtil +import androidx.databinding.DataBindingUtil import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -29,10 +29,10 @@ import org.pacien.tincapp.databinding.StatusSubnetListItemBinding /** * @author pacien */ -class SubnetInfoArrayAdapter(context: Context?) : ArrayAdapter(context, -1) { +class SubnetInfoArrayAdapter(context: Context) : ArrayAdapter(context, -1) { private val layoutInflater = LayoutInflater.from(context)!! - override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View { + override fun getView(position: Int, convertView: View?, parent: ViewGroup): View { val binding = when (convertView) { null -> StatusSubnetListItemBinding.inflate(layoutInflater, parent, false) 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 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2019 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +18,8 @@ package org.pacien.tincapp.activities.status.subnets -import android.arch.lifecycle.Observer -import android.arch.lifecycle.ViewModelProviders +import androidx.lifecycle.Observer +import androidx.lifecycle.ViewModelProviders import android.os.Bundle import android.view.LayoutInflater import android.view.View @@ -36,7 +36,7 @@ import org.pacien.tincapp.extensions.setElements */ class SubnetListFragment : BaseFragment() { private val subnetListViewModel by lazy { ViewModelProviders.of(this).get(SubnetListViewModel::class.java) } - private val subnetListAdapter by lazy { SubnetInfoArrayAdapter(context) } + private val subnetListAdapter by lazy { SubnetInfoArrayAdapter(requireContext()) } private val subnetListObserver by lazy { Observer> { subnetListAdapter.setElements(it) } } override fun onCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/org/pacien/tincapp/activities/status/subnets/SubnetListViewModel.kt b/app/src/main/java/org/pacien/tincapp/activities/status/subnets/SubnetListViewModel.kt index ff0afca..dc47b40 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/status/subnets/SubnetListViewModel.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/status/subnets/SubnetListViewModel.kt @@ -1,6 +1,6 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2019 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ package org.pacien.tincapp.activities.status.subnets -import android.arch.lifecycle.ViewModel +import androidx.lifecycle.ViewModel import org.pacien.tincapp.service.TincVpnService /** diff --git a/app/src/main/java/org/pacien/tincapp/activities/viewlog/LogViewModel.kt b/app/src/main/java/org/pacien/tincapp/activities/viewlog/LogViewModel.kt index d9f0017..954bc89 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/viewlog/LogViewModel.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/viewlog/LogViewModel.kt @@ -1,6 +1,6 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2019 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ package org.pacien.tincapp.activities.viewlog -import android.arch.lifecycle.ViewModel +import androidx.lifecycle.ViewModel import org.pacien.tincapp.service.TincVpnService /** diff --git a/app/src/main/java/org/pacien/tincapp/activities/viewlog/ViewLogActivity.kt b/app/src/main/java/org/pacien/tincapp/activities/viewlog/ViewLogActivity.kt index dfe6d1b..d344068 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/viewlog/ViewLogActivity.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/viewlog/ViewLogActivity.kt @@ -1,6 +1,6 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2019 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +18,8 @@ package org.pacien.tincapp.activities.viewlog -import android.arch.lifecycle.Observer -import android.arch.lifecycle.ViewModelProviders +import androidx.lifecycle.Observer +import androidx.lifecycle.ViewModelProviders import android.content.Intent import android.os.Bundle import android.view.Menu diff --git a/app/src/main/java/org/pacien/tincapp/context/App.kt b/app/src/main/java/org/pacien/tincapp/context/App.kt index cf12dda..a877929 100644 --- a/app/src/main/java/org/pacien/tincapp/context/App.kt +++ b/app/src/main/java/org/pacien/tincapp/context/App.kt @@ -1,6 +1,6 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2019 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,7 +24,7 @@ import android.content.Intent import android.net.Uri import android.os.Build import android.os.Handler -import android.support.annotation.StringRes +import androidx.annotation.StringRes import org.pacien.tincapp.BuildConfig import org.pacien.tincapp.R import org.slf4j.LoggerFactory diff --git a/app/src/main/java/org/pacien/tincapp/context/AppNotificationManager.kt b/app/src/main/java/org/pacien/tincapp/context/AppNotificationManager.kt index bdbc8be..38bf6e4 100644 --- a/app/src/main/java/org/pacien/tincapp/context/AppNotificationManager.kt +++ b/app/src/main/java/org/pacien/tincapp/context/AppNotificationManager.kt @@ -1,6 +1,6 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2019 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,9 +25,9 @@ import android.content.Context import android.content.Intent import android.net.Uri import android.os.Build -import android.support.annotation.RequiresApi -import android.support.v4.app.NotificationCompat -import android.support.v4.app.NotificationManagerCompat +import androidx.annotation.RequiresApi +import androidx.core.app.NotificationCompat +import androidx.core.app.NotificationManagerCompat import org.pacien.tincapp.R /** diff --git a/app/src/main/java/org/pacien/tincapp/intent/BroadcastMapper.kt b/app/src/main/java/org/pacien/tincapp/intent/BroadcastMapper.kt index f581c99..72c2aac 100644 --- a/app/src/main/java/org/pacien/tincapp/intent/BroadcastMapper.kt +++ b/app/src/main/java/org/pacien/tincapp/intent/BroadcastMapper.kt @@ -1,6 +1,6 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2019 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,7 +22,7 @@ import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import android.content.IntentFilter -import android.support.v4.content.LocalBroadcastManager +import androidx.localbroadcastmanager.content.LocalBroadcastManager import org.pacien.tincapp.context.App /** diff --git a/app/src/main/java/org/pacien/tincapp/service/TincVpnService.kt b/app/src/main/java/org/pacien/tincapp/service/TincVpnService.kt index 263fea4..40e9004 100644 --- a/app/src/main/java/org/pacien/tincapp/service/TincVpnService.kt +++ b/app/src/main/java/org/pacien/tincapp/service/TincVpnService.kt @@ -23,7 +23,7 @@ import android.content.Context import android.content.Intent import android.net.VpnService import android.os.ParcelFileDescriptor -import android.support.v4.content.LocalBroadcastManager +import androidx.localbroadcastmanager.content.LocalBroadcastManager import java8.util.concurrent.CompletableFuture import org.apache.commons.configuration2.ex.ConversionException import org.bouncycastle.openssl.PEMException @@ -61,7 +61,7 @@ class TincVpnService : VpnService() { when { intent.action == Actions.ACTION_CONNECT && intent.scheme == Actions.TINC_SCHEME -> - startVpn(intent.data.schemeSpecificPart, intent.data.fragment) + startVpn(intent.data!!.schemeSpecificPart, intent.data!!.fragment) intent.action == Actions.ACTION_DISCONNECT -> stopVpn() intent.action == Actions.ACTION_SYSTEM_CONNECT -> @@ -197,7 +197,7 @@ class TincVpnService : VpnService() { companion object { private const val SETUP_DELAY = 500L // ms - private val STORE_NAME = this::class.java.`package`.name + private val STORE_NAME = this::class.java.`package`!!.name private const val STORE_KEY_NETNAME = "netname" private const val STORE_KEY_PASSPHRASE = "passphrase" diff --git a/app/src/main/res/layout/base_activity.xml b/app/src/main/res/layout/base_activity.xml index e61fea4..5227657 100644 --- a/app/src/main/res/layout/base_activity.xml +++ b/app/src/main/res/layout/base_activity.xml @@ -2,7 +2,7 @@ -. --> - - - + -- cgit v1.2.3