Initial draft for porting to AndroidX

This commit is contained in:
Mygod
2018-07-15 14:28:42 +08:00
parent 35bc2b4a75
commit d0e92b2505
37 changed files with 97 additions and 104 deletions

View File

@@ -6,8 +6,7 @@ buildscript {
ext { ext {
androidPluginVersion = '3.2.0-beta03' androidPluginVersion = '3.2.0-beta03'
kotlinVersion = '1.2.51' kotlinVersion = '1.2.51'
supportLibraryVersion = '28.0.0-alpha3' androidxVersion = '1.0.0-beta01'
takisoftFixVersion = '27.1.1.2'
} }
repositories { repositories {
google() google()

View File

@@ -9,6 +9,8 @@
# Specifies the JVM arguments used for the daemon process. # Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings. # The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode. # When configured, Gradle will run in incubating parallel mode.

View File

@@ -13,7 +13,7 @@ android {
resConfigs "zh-rCN" resConfigs "zh-rCN"
versionCode 29 versionCode 29
versionName "1.3.5" versionName "1.3.5"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
buildTypes { buildTypes {
debug { debug {
@@ -43,18 +43,18 @@ dependencies {
kapt "androidx.databinding:databinding-compiler:$androidPluginVersion" kapt "androidx.databinding:databinding-compiler:$androidPluginVersion"
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.billingclient:billing:1.1' implementation 'com.android.billingclient:billing:1.1'
implementation "com.android.support:customtabs:$supportLibraryVersion" implementation "androidx.browser:browser:$androidxVersion"
implementation "com.android.support:design:$supportLibraryVersion" implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha1'
implementation "com.android.support:preference-v14:$supportLibraryVersion" implementation "androidx.preference:preference:$androidxVersion"
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.4' implementation 'com.crashlytics.sdk.android:crashlytics:2.9.4'
implementation 'com.github.luongvo:BadgeView:1.1.5' implementation 'com.github.luongvo:BadgeView:1.1.5'
implementation "com.google.android.material:material:$androidxVersion"
implementation 'com.linkedin.dexmaker:dexmaker-mockito:2.19.0' implementation 'com.linkedin.dexmaker:dexmaker-mockito:2.19.0'
implementation "com.takisoft.fix:preference-v7:$takisoftFixVersion" implementation 'com.takisoft.preferencex:preferencex:1.0.0-alpha1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'androidx.test:runner:1.1.0-alpha3'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha3'
} }
kapt.generateStubs = true kapt.generateStubs = true

View File

@@ -73,7 +73,7 @@
<service android:name=".client.ClientMonitorService"/> <service android:name=".client.ClientMonitorService"/>
<provider <provider
android:name="android.support.v4.content.FileProvider" android:name="androidx.core.content.FileProvider"
android:authorities="be.mygod.vpnhotspot.log" android:authorities="be.mygod.vpnhotspot.log"
android:exported="false" android:exported="false"
android:grantUriPermissions="true"> android:grantUriPermissions="true">

View File

@@ -10,7 +10,7 @@ import android.net.wifi.WifiManager
import android.os.Build import android.os.Build
import android.os.Handler import android.os.Handler
import android.preference.PreferenceManager import android.preference.PreferenceManager
import android.support.annotation.StringRes import androidx.annotation.StringRes
import android.widget.Toast import android.widget.Toast
import be.mygod.vpnhotspot.util.Event0 import be.mygod.vpnhotspot.util.Event0
import be.mygod.vpnhotspot.util.systemService import be.mygod.vpnhotspot.util.systemService

View File

@@ -3,7 +3,7 @@ package be.mygod.vpnhotspot
import android.app.AlertDialog import android.app.AlertDialog
import android.net.Uri import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.support.v4.app.DialogFragment import androidx.fragment.app.DialogFragment
import android.util.Log import android.util.Log
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View

View File

@@ -3,7 +3,7 @@ package be.mygod.vpnhotspot
import android.content.Intent import android.content.Intent
import android.content.IntentFilter import android.content.IntentFilter
import android.net.wifi.WifiManager import android.net.wifi.WifiManager
import android.support.annotation.RequiresApi import androidx.annotation.RequiresApi
import android.widget.Toast import android.widget.Toast
import be.mygod.vpnhotspot.App.Companion.app import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.manage.LocalOnlyHotspotManager import be.mygod.vpnhotspot.manage.LocalOnlyHotspotManager

View File

@@ -3,17 +3,16 @@ package be.mygod.vpnhotspot
import android.content.ComponentName import android.content.ComponentName
import android.content.Intent import android.content.Intent
import android.content.ServiceConnection import android.content.ServiceConnection
import android.databinding.DataBindingUtil import androidx.databinding.DataBindingUtil
import android.net.Uri import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.os.IBinder import android.os.IBinder
import android.support.customtabs.CustomTabsIntent import androidx.browser.customtabs.CustomTabsIntent
import android.support.design.internal.BottomNavigationMenuView import com.google.android.material.bottomnavigation.BottomNavigationView
import android.support.design.widget.BottomNavigationView import com.google.android.material.snackbar.Snackbar
import android.support.design.widget.Snackbar import androidx.fragment.app.Fragment
import android.support.v4.app.Fragment import androidx.core.content.ContextCompat
import android.support.v4.content.ContextCompat import androidx.appcompat.app.AppCompatActivity
import android.support.v7.app.AppCompatActivity
import android.view.Gravity import android.view.Gravity
import android.view.MenuItem import android.view.MenuItem
import be.mygod.vpnhotspot.client.ClientMonitorService import be.mygod.vpnhotspot.client.ClientMonitorService
@@ -21,6 +20,7 @@ import be.mygod.vpnhotspot.client.ClientsFragment
import be.mygod.vpnhotspot.databinding.ActivityMainBinding import be.mygod.vpnhotspot.databinding.ActivityMainBinding
import be.mygod.vpnhotspot.manage.TetheringFragment import be.mygod.vpnhotspot.manage.TetheringFragment
import be.mygod.vpnhotspot.util.ServiceForegroundConnector import be.mygod.vpnhotspot.util.ServiceForegroundConnector
import com.google.android.material.bottomnavigation.BottomNavigationMenuView
import q.rorbin.badgeview.QBadgeView import q.rorbin.badgeview.QBadgeView
class MainActivity : AppCompatActivity(), BottomNavigationView.OnNavigationItemSelectedListener, ServiceConnection { class MainActivity : AppCompatActivity(), BottomNavigationView.OnNavigationItemSelectedListener, ServiceConnection {

View File

@@ -10,7 +10,7 @@ import android.net.wifi.p2p.WifiP2pGroup
import android.net.wifi.p2p.WifiP2pInfo import android.net.wifi.p2p.WifiP2pInfo
import android.net.wifi.p2p.WifiP2pManager import android.net.wifi.p2p.WifiP2pManager
import android.os.Looper import android.os.Looper
import android.support.annotation.StringRes import androidx.annotation.StringRes
import android.util.Log import android.util.Log
import android.widget.Toast import android.widget.Toast
import be.mygod.vpnhotspot.App.Companion.app import be.mygod.vpnhotspot.App.Companion.app

View File

@@ -9,8 +9,8 @@ import android.net.wifi.p2p.WifiP2pGroup
import android.os.IBinder import android.os.IBinder
import android.service.quicksettings.Tile import android.service.quicksettings.Tile
import android.service.quicksettings.TileService import android.service.quicksettings.TileService
import android.support.annotation.RequiresApi import androidx.annotation.RequiresApi
import android.support.v4.content.ContextCompat import androidx.core.content.ContextCompat
import be.mygod.vpnhotspot.util.stopAndUnbind import be.mygod.vpnhotspot.util.stopAndUnbind
@RequiresApi(24) @RequiresApi(24)

View File

@@ -5,8 +5,8 @@ import android.app.*
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Build import android.os.Build
import android.support.v4.app.NotificationCompat import androidx.core.app.NotificationCompat
import android.support.v4.content.ContextCompat import androidx.core.content.ContextCompat
import be.mygod.vpnhotspot.App.Companion.app import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.util.systemService import be.mygod.vpnhotspot.util.systemService

View File

@@ -5,8 +5,8 @@ import android.content.Intent
import android.net.Uri import android.net.Uri
import android.os.Build import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.support.v4.content.FileProvider import androidx.core.content.FileProvider
import android.support.v7.preference.Preference import androidx.preference.Preference
import be.mygod.vpnhotspot.App.Companion.app import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.net.Routing import be.mygod.vpnhotspot.net.Routing
import be.mygod.vpnhotspot.net.UpstreamMonitor import be.mygod.vpnhotspot.net.UpstreamMonitor
@@ -15,7 +15,7 @@ import be.mygod.vpnhotspot.preference.SharedPreferenceDataStore
import be.mygod.vpnhotspot.util.loggerSuStream import be.mygod.vpnhotspot.util.loggerSuStream
import be.mygod.vpnhotspot.util.put import be.mygod.vpnhotspot.util.put
import com.crashlytics.android.Crashlytics import com.crashlytics.android.Crashlytics
import com.takisoft.fix.support.v7.preference.PreferenceFragmentCompat import com.takisoft.preferencex.PreferenceFragmentCompat
import java.io.File import java.io.File
import java.io.IOException import java.io.IOException
import java.io.PrintWriter import java.io.PrintWriter

View File

@@ -1,6 +1,6 @@
package be.mygod.vpnhotspot.client package be.mygod.vpnhotspot.client
import android.support.v7.util.DiffUtil import androidx.recyclerview.widget.DiffUtil
import be.mygod.vpnhotspot.App.Companion.app import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.R import be.mygod.vpnhotspot.R
import be.mygod.vpnhotspot.net.IpNeighbour import be.mygod.vpnhotspot.net.IpNeighbour

View File

@@ -2,14 +2,14 @@ package be.mygod.vpnhotspot.client
import android.content.ComponentName import android.content.ComponentName
import android.content.ServiceConnection import android.content.ServiceConnection
import android.databinding.DataBindingUtil import androidx.databinding.DataBindingUtil
import android.os.Bundle import android.os.Bundle
import android.os.IBinder import android.os.IBinder
import android.support.v4.app.Fragment import androidx.fragment.app.Fragment
import android.support.v7.recyclerview.extensions.ListAdapter import androidx.recyclerview.widget.ListAdapter
import android.support.v7.widget.DefaultItemAnimator import androidx.recyclerview.widget.DefaultItemAnimator
import android.support.v7.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup

View File

@@ -1,6 +1,6 @@
package be.mygod.vpnhotspot.manage package be.mygod.vpnhotspot.manage
import android.databinding.BaseObservable import androidx.databinding.BaseObservable
abstract class Data : BaseObservable() { abstract class Data : BaseObservable() {
abstract val icon: Int abstract val icon: Int

View File

@@ -1,8 +1,8 @@
package be.mygod.vpnhotspot.manage package be.mygod.vpnhotspot.manage
import android.content.Intent import android.content.Intent
import android.support.v4.content.ContextCompat import androidx.core.content.ContextCompat
import android.support.v7.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import android.view.View import android.view.View
import be.mygod.vpnhotspot.TetheringService import be.mygod.vpnhotspot.TetheringService
import be.mygod.vpnhotspot.databinding.ListitemInterfaceBinding import be.mygod.vpnhotspot.databinding.ListitemInterfaceBinding

View File

@@ -11,7 +11,7 @@ import android.location.LocationManager
import android.os.Build import android.os.Build
import android.os.IBinder import android.os.IBinder
import android.provider.Settings import android.provider.Settings
import android.support.v7.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import android.view.View import android.view.View
import android.widget.Toast import android.widget.Toast
import be.mygod.vpnhotspot.LocalOnlyHotspotService import be.mygod.vpnhotspot.LocalOnlyHotspotService

View File

@@ -3,7 +3,7 @@ package be.mygod.vpnhotspot.manage
import android.content.ActivityNotFoundException import android.content.ActivityNotFoundException
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.support.v7.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import android.view.View import android.view.View
import com.crashlytics.android.Crashlytics import com.crashlytics.android.Crashlytics

View File

@@ -1,8 +1,8 @@
package be.mygod.vpnhotspot.manage package be.mygod.vpnhotspot.manage
import android.annotation.TargetApi import android.annotation.TargetApi
import android.support.v7.util.DiffUtil import androidx.recyclerview.widget.DiffUtil
import android.support.v7.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.ViewGroup import android.view.ViewGroup
import be.mygod.vpnhotspot.R import be.mygod.vpnhotspot.R

View File

@@ -4,15 +4,15 @@ import android.content.ComponentName
import android.content.DialogInterface import android.content.DialogInterface
import android.content.Intent import android.content.Intent
import android.content.ServiceConnection import android.content.ServiceConnection
import android.databinding.BaseObservable import androidx.databinding.BaseObservable
import android.databinding.Bindable import androidx.databinding.Bindable
import android.net.wifi.WifiConfiguration import android.net.wifi.WifiConfiguration
import android.net.wifi.p2p.WifiP2pGroup import android.net.wifi.p2p.WifiP2pGroup
import android.os.IBinder import android.os.IBinder
import android.support.v4.content.ContextCompat import androidx.core.content.ContextCompat
import android.support.v7.app.AlertDialog import androidx.appcompat.app.AlertDialog
import android.support.v7.app.AppCompatDialog import androidx.appcompat.app.AppCompatDialog
import android.support.v7.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import android.view.WindowManager import android.view.WindowManager
import android.widget.EditText import android.widget.EditText
import android.widget.Toast import android.widget.Toast

View File

@@ -1,9 +1,9 @@
package be.mygod.vpnhotspot.manage package be.mygod.vpnhotspot.manage
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.arch.lifecycle.Lifecycle import androidx.lifecycle.Lifecycle
import android.arch.lifecycle.LifecycleObserver import androidx.lifecycle.LifecycleObserver
import android.arch.lifecycle.OnLifecycleEvent import androidx.lifecycle.OnLifecycleEvent
import android.bluetooth.BluetoothAdapter import android.bluetooth.BluetoothAdapter
import android.bluetooth.BluetoothProfile import android.bluetooth.BluetoothProfile
import android.content.ActivityNotFoundException import android.content.ActivityNotFoundException
@@ -11,8 +11,8 @@ import android.content.Intent
import android.net.Uri import android.net.Uri
import android.os.Build import android.os.Build
import android.provider.Settings import android.provider.Settings
import android.support.annotation.RequiresApi import androidx.annotation.RequiresApi
import android.support.v7.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import android.view.View import android.view.View
import be.mygod.vpnhotspot.App.Companion.app import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.MainActivity import be.mygod.vpnhotspot.MainActivity

View File

@@ -6,15 +6,15 @@ import android.content.Intent
import android.content.IntentFilter import android.content.IntentFilter
import android.content.ServiceConnection import android.content.ServiceConnection
import android.content.pm.PackageManager import android.content.pm.PackageManager
import android.databinding.DataBindingUtil import androidx.databinding.DataBindingUtil
import android.os.Build import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.os.IBinder import android.os.IBinder
import android.support.v4.app.Fragment import androidx.fragment.app.Fragment
import android.support.v7.recyclerview.extensions.ListAdapter import androidx.recyclerview.widget.ListAdapter
import android.support.v7.widget.DefaultItemAnimator import androidx.recyclerview.widget.DefaultItemAnimator
import android.support.v7.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup

View File

@@ -5,7 +5,7 @@ import android.net.ConnectivityManager
import android.os.Build import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.os.Handler import android.os.Handler
import android.support.annotation.RequiresApi import androidx.annotation.RequiresApi
import android.util.Log import android.util.Log
import be.mygod.vpnhotspot.App.Companion.app import be.mygod.vpnhotspot.App.Companion.app
import com.android.dx.stock.ProxyBuilder import com.android.dx.stock.ProxyBuilder

View File

@@ -5,8 +5,8 @@ import android.content.DialogInterface
import android.net.wifi.WifiConfiguration import android.net.wifi.WifiConfiguration
import android.net.wifi.WifiConfiguration.AuthAlgorithm import android.net.wifi.WifiConfiguration.AuthAlgorithm
import android.os.Bundle import android.os.Bundle
import android.support.design.widget.TextInputLayout import com.google.android.material.textfield.TextInputLayout
import android.support.v7.app.AlertDialog import androidx.appcompat.app.AlertDialog
import android.text.Editable import android.text.Editable
import android.text.TextWatcher import android.text.TextWatcher
import android.view.View import android.view.View

View File

@@ -5,7 +5,7 @@ import android.text.TextUtils
import android.util.AttributeSet import android.util.AttributeSet
import be.mygod.vpnhotspot.R import be.mygod.vpnhotspot.R
import be.mygod.vpnhotspot.widget.AlwaysAutoCompleteEditText import be.mygod.vpnhotspot.widget.AlwaysAutoCompleteEditText
import com.takisoft.fix.support.v7.preference.AutoSummaryEditTextPreference import com.takisoft.preferencex.AutoSummaryEditTextPreference
open class AlwaysAutoCompleteEditTextPreference @JvmOverloads constructor( open class AlwaysAutoCompleteEditTextPreference @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = R.attr.editTextPreferenceStyle, context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = R.attr.editTextPreferenceStyle,

View File

@@ -1,7 +1,7 @@
package be.mygod.vpnhotspot.preference package be.mygod.vpnhotspot.preference
import android.support.v7.preference.PreferenceDialogFragmentCompat import androidx.preference.PreferenceDialogFragmentCompat
import android.support.v7.widget.AppCompatAutoCompleteTextView import androidx.appcompat.widget.AppCompatAutoCompleteTextView
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.ArrayAdapter import android.widget.ArrayAdapter

View File

@@ -1,7 +1,7 @@
package be.mygod.vpnhotspot.preference package be.mygod.vpnhotspot.preference
import android.content.SharedPreferences import android.content.SharedPreferences
import android.support.v7.preference.PreferenceDataStore import androidx.preference.PreferenceDataStore
class SharedPreferenceDataStore(private val pref: SharedPreferences) : PreferenceDataStore() { class SharedPreferenceDataStore(private val pref: SharedPreferences) : PreferenceDataStore() {
override fun getBoolean(key: String?, defValue: Boolean) = pref.getBoolean(key, defValue) override fun getBoolean(key: String?, defValue: Boolean) = pref.getBoolean(key, defValue)

View File

@@ -1,14 +1,14 @@
package be.mygod.vpnhotspot.util package be.mygod.vpnhotspot.util
import android.app.Service import android.app.Service
import android.arch.lifecycle.Lifecycle import androidx.lifecycle.Lifecycle
import android.arch.lifecycle.LifecycleObserver import androidx.lifecycle.LifecycleObserver
import android.arch.lifecycle.LifecycleOwner import androidx.lifecycle.LifecycleOwner
import android.arch.lifecycle.OnLifecycleEvent import androidx.lifecycle.OnLifecycleEvent
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.content.ServiceConnection import android.content.ServiceConnection
import android.support.v4.app.Fragment import androidx.fragment.app.Fragment
import kotlin.reflect.KClass import kotlin.reflect.KClass
/** /**

View File

@@ -1,10 +1,10 @@
package be.mygod.vpnhotspot.util package be.mygod.vpnhotspot.util
import android.content.* import android.content.*
import android.databinding.BindingAdapter import androidx.databinding.BindingAdapter
import android.os.Bundle import android.os.Bundle
import android.support.annotation.DrawableRes import androidx.annotation.DrawableRes
import android.support.v4.content.ContextCompat import androidx.core.content.ContextCompat
import android.util.Log import android.util.Log
import android.view.View import android.view.View
import android.widget.ImageView import android.widget.ImageView

View File

@@ -2,7 +2,7 @@ package be.mygod.vpnhotspot.widget
import android.content.Context import android.content.Context
import android.graphics.Rect import android.graphics.Rect
import android.support.v7.widget.AppCompatAutoCompleteTextView import androidx.appcompat.widget.AppCompatAutoCompleteTextView
import android.util.AttributeSet import android.util.AttributeSet
import android.view.View import android.view.View
import be.mygod.vpnhotspot.R import be.mygod.vpnhotspot.R

View File

@@ -1,7 +1,7 @@
package be.mygod.vpnhotspot.widget package be.mygod.vpnhotspot.widget
import android.content.Context import android.content.Context
import android.support.v7.widget.AppCompatTextView import androidx.appcompat.widget.AppCompatTextView
import android.util.AttributeSet import android.util.AttributeSet
import android.view.View import android.view.View

View File

@@ -3,12 +3,12 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<android.support.constraint.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context="be.mygod.vpnhotspot.MainActivity"> tools:context="be.mygod.vpnhotspot.MainActivity">
<android.support.v7.widget.Toolbar <androidx.appcompat.widget.Toolbar
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:layout_width="match_parent" android:layout_width="match_parent"
android:background="?attr/colorPrimary" android:background="?attr/colorPrimary"
@@ -16,7 +16,7 @@
app:title="@string/app_name" app:title="@string/app_name"
android:id="@+id/toolbar"/> android:id="@+id/toolbar"/>
<android.support.design.widget.CoordinatorLayout <androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/navigation" app:layout_constraintBottom_toTopOf="@+id/navigation"
@@ -29,9 +29,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"/> android:layout_height="match_parent"/>
</android.support.design.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>
<android.support.design.widget.BottomNavigationView <com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/navigation" android:id="@+id/navigation"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -51,6 +51,6 @@
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"/> app:layout_constraintRight_toRightOf="parent"/>
</android.support.constraint.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</layout> </layout>

View File

@@ -22,13 +22,13 @@
android:descendantFocusability="beforeDescendants" android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true" android:focusableInTouchMode="true"
style="@style/wifi_item"> style="@style/wifi_item">
<android.support.design.widget.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/ssid_wrapper" android:id="@+id/ssid_wrapper"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dip" android:layout_marginTop="8dip"
android:layout_marginBottom="8dip"> android:layout_marginBottom="8dip">
<android.support.design.widget.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/ssid" android:id="@+id/ssid"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -36,14 +36,14 @@
android:hint="@string/wifi_ssid" android:hint="@string/wifi_ssid"
android:inputType="textMultiLine|textNoSuggestions" android:inputType="textMultiLine|textNoSuggestions"
android:maxLength="32" /> android:maxLength="32" />
</android.support.design.widget.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<android.support.design.widget.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/password_wrapper" android:id="@+id/password_wrapper"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:passwordToggleEnabled="true" app:passwordToggleEnabled="true"
app:errorEnabled="true"> app:errorEnabled="true">
<android.support.design.widget.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/password" android:id="@+id/password"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -53,6 +53,6 @@
android:inputType="textPassword" android:inputType="textPassword"
android:maxLength="63" android:maxLength="63"
android:imeOptions="flagForceAscii" /> android:imeOptions="flagForceAscii" />
</android.support.design.widget.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>

View File

@@ -3,17 +3,17 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<android.support.v4.widget.SwipeRefreshLayout <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipeRefresher" android:id="@+id/swipeRefresher"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/clients" android:id="@+id/clients"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:clipToPadding="false" android:clipToPadding="false"
android:scrollbars="vertical" android:scrollbars="vertical"
tools:listitem="@layout/listitem_client"/> tools:listitem="@layout/listitem_client"/>
</android.support.v4.widget.SwipeRefreshLayout> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</layout> </layout>

View File

@@ -2,7 +2,7 @@
<layout <layout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<android.support.v7.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/interfaces" android:id="@+id/interfaces"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"

View File

@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<style name="AppTheme" parent="Theme.Design.Light.NoActionBar"> <style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item> <item name="colorAccent">@color/colorAccent</item>
<item name="preferenceTheme">@style/AppTheme.Preference</item>
<item name="android:navigationBarColor">@android:color/white</item> <item name="android:navigationBarColor">@android:color/white</item>
<item name="android:windowLightNavigationBar">true</item> <item name="android:windowLightNavigationBar">true</item>
</style> </style>

View File

@@ -1,16 +1,9 @@
<resources> <resources>
<style name="AppTheme" parent="Theme.Design.Light.NoActionBar"> <style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item> <item name="colorAccent">@color/colorAccent</item>
<item name="preferenceTheme">@style/AppTheme.Preference</item>
</style>
<style name="AppTheme.Preference" parent="PreferenceThemeOverlay.v14.Material.Fix">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="preferenceCategory_marginBottom">8dp</item>
</style> </style>
<!-- https://android.googlesource.com/platform/packages/apps/Settings/+/7efcc35/res/values/styles.xml --> <!-- https://android.googlesource.com/platform/packages/apps/Settings/+/7efcc35/res/values/styles.xml -->