Drop dependency on kotlin-android-extensions
* Not available on AOSP.
This commit is contained in:
parent
b12adcd4c0
commit
0ce613b64d
10 changed files with 170 additions and 21 deletions
|
@ -2,7 +2,6 @@ import groovy.xml.XmlUtil
|
|||
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
|
||||
android {
|
||||
|
||||
|
|
|
@ -4,16 +4,19 @@ import android.os.Bundle
|
|||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.Button
|
||||
import android.widget.ProgressBar
|
||||
import android.widget.TextView
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.DividerItemDecoration
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager.VERTICAL
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.stevesoltys.seedvault.R
|
||||
import com.stevesoltys.seedvault.transport.restore.ApkRestoreStatus.QUEUED
|
||||
import com.stevesoltys.seedvault.transport.restore.InstallResult
|
||||
import com.stevesoltys.seedvault.transport.restore.getInProgress
|
||||
import kotlinx.android.synthetic.main.fragment_restore_progress.*
|
||||
import org.koin.androidx.viewmodel.ext.android.sharedViewModel
|
||||
|
||||
class InstallProgressFragment : Fragment() {
|
||||
|
@ -23,9 +26,23 @@ class InstallProgressFragment : Fragment() {
|
|||
private val layoutManager = LinearLayoutManager(context)
|
||||
private val adapter = InstallProgressAdapter()
|
||||
|
||||
private lateinit var progressBar: ProgressBar
|
||||
private lateinit var titleView: TextView
|
||||
private lateinit var backupNameView: TextView
|
||||
private lateinit var appList: RecyclerView
|
||||
private lateinit var button: Button
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?): View? {
|
||||
return inflater.inflate(R.layout.fragment_restore_progress, container, false)
|
||||
val v: View = inflater.inflate(R.layout.fragment_restore_progress, container, false)
|
||||
|
||||
progressBar = v.findViewById(R.id.progressBar)
|
||||
titleView = v.findViewById(R.id.titleView)
|
||||
backupNameView = v.findViewById(R.id.backupNameView)
|
||||
appList = v.findViewById(R.id.appList)
|
||||
button = v.findViewById(R.id.button)
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
|
|
|
@ -6,14 +6,17 @@ import android.view.LayoutInflater
|
|||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
|
||||
import android.widget.Button
|
||||
import android.widget.ProgressBar
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.ContextCompat.getColor
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.DividerItemDecoration
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager.VERTICAL
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.stevesoltys.seedvault.R
|
||||
import kotlinx.android.synthetic.main.fragment_restore_progress.*
|
||||
import org.koin.androidx.viewmodel.ext.android.sharedViewModel
|
||||
|
||||
class RestoreProgressFragment : Fragment() {
|
||||
|
@ -23,9 +26,23 @@ class RestoreProgressFragment : Fragment() {
|
|||
private val layoutManager = LinearLayoutManager(context)
|
||||
private val adapter = RestoreProgressAdapter()
|
||||
|
||||
private lateinit var progressBar: ProgressBar
|
||||
private lateinit var titleView: TextView
|
||||
private lateinit var backupNameView: TextView
|
||||
private lateinit var appList: RecyclerView
|
||||
private lateinit var button: Button
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?): View? {
|
||||
return inflater.inflate(R.layout.fragment_restore_progress, container, false)
|
||||
val v: View = inflater.inflate(R.layout.fragment_restore_progress, container, false)
|
||||
|
||||
progressBar = v.findViewById(R.id.progressBar)
|
||||
titleView = v.findViewById(R.id.titleView)
|
||||
backupNameView = v.findViewById(R.id.backupNameView)
|
||||
appList = v.findViewById(R.id.appList)
|
||||
button = v.findViewById(R.id.button)
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
|
|
|
@ -7,19 +7,33 @@ import android.view.View.INVISIBLE
|
|||
import android.view.View.VISIBLE
|
||||
import android.view.ViewGroup
|
||||
import android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
|
||||
import android.widget.ProgressBar
|
||||
import android.widget.TextView
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.stevesoltys.seedvault.R
|
||||
import kotlinx.android.synthetic.main.fragment_restore_set.*
|
||||
import org.koin.androidx.viewmodel.ext.android.sharedViewModel
|
||||
|
||||
class RestoreSetFragment : Fragment() {
|
||||
|
||||
private val viewModel: RestoreViewModel by sharedViewModel()
|
||||
|
||||
private lateinit var listView: RecyclerView
|
||||
private lateinit var progressBar: ProgressBar
|
||||
private lateinit var errorView: TextView
|
||||
private lateinit var backView: TextView
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?): View? {
|
||||
return inflater.inflate(R.layout.fragment_restore_set, container, false)
|
||||
val v: View = inflater.inflate(R.layout.fragment_restore_set, container, false)
|
||||
|
||||
listView = v.findViewById(R.id.listView)
|
||||
progressBar = v.findViewById(R.id.progressBar)
|
||||
errorView = v.findViewById(R.id.errorView)
|
||||
backView = v.findViewById(R.id.backView)
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
|
|
|
@ -5,18 +5,31 @@ import android.text.method.LinkMovementMethod
|
|||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import com.stevesoltys.seedvault.R
|
||||
import kotlinx.android.synthetic.main.fragment_about.*
|
||||
|
||||
class AboutDialogFragment : DialogFragment() {
|
||||
|
||||
private lateinit var licenseView: TextView
|
||||
private lateinit var authorView: TextView
|
||||
private lateinit var designView: TextView
|
||||
private lateinit var sponsorView: TextView
|
||||
|
||||
companion object {
|
||||
internal val TAG = AboutDialogFragment::class.java.simpleName
|
||||
}
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||
return inflater.inflate(R.layout.fragment_about, container, false)
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?): View? {
|
||||
val v: View = inflater.inflate(R.layout.fragment_about, container, false)
|
||||
|
||||
licenseView = v.findViewById(R.id.licenseView)
|
||||
authorView = v.findViewById(R.id.authorView)
|
||||
designView = v.findViewById(R.id.designView)
|
||||
sponsorView = v.findViewById(R.id.sponsorView)
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
|
|
|
@ -9,11 +9,12 @@ import android.view.View
|
|||
import android.view.View.INVISIBLE
|
||||
import android.view.View.VISIBLE
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ProgressBar
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.stevesoltys.seedvault.R
|
||||
import kotlinx.android.synthetic.main.fragment_app_status.*
|
||||
import org.koin.androidx.viewmodel.ext.android.sharedViewModel
|
||||
|
||||
internal interface AppStatusToggleListener {
|
||||
|
@ -26,12 +27,20 @@ class AppStatusFragment : Fragment(), AppStatusToggleListener {
|
|||
|
||||
private val layoutManager = LinearLayoutManager(context)
|
||||
private val adapter = AppStatusAdapter(this)
|
||||
|
||||
private lateinit var appEditMenuItem: MenuItem
|
||||
private lateinit var list: RecyclerView
|
||||
private lateinit var progressBar: ProgressBar
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?): View? {
|
||||
setHasOptionsMenu(true)
|
||||
return inflater.inflate(R.layout.fragment_app_status, container, false)
|
||||
val v: View = inflater.inflate(R.layout.fragment_app_status, container, false)
|
||||
|
||||
progressBar = v.findViewById(R.id.progressBar)
|
||||
list = v.findViewById(R.id.list)
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
|
|
|
@ -8,25 +8,63 @@ import android.view.View.VISIBLE
|
|||
import android.view.ViewGroup
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.AutoCompleteTextView
|
||||
import android.widget.Button
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import android.widget.Toast.LENGTH_LONG
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.google.android.material.textfield.TextInputLayout
|
||||
import com.stevesoltys.seedvault.R
|
||||
import com.stevesoltys.seedvault.isDebugBuild
|
||||
import io.github.novacrypto.bip39.Validation.InvalidChecksumException
|
||||
import io.github.novacrypto.bip39.Validation.WordNotFoundException
|
||||
import io.github.novacrypto.bip39.wordlists.English
|
||||
import kotlinx.android.synthetic.main.fragment_recovery_code_input.*
|
||||
import kotlinx.android.synthetic.main.recovery_code_input.*
|
||||
import org.koin.androidx.viewmodel.ext.android.sharedViewModel
|
||||
|
||||
class RecoveryCodeInputFragment : Fragment() {
|
||||
|
||||
private val viewModel: RecoveryCodeViewModel by sharedViewModel()
|
||||
|
||||
private lateinit var introText: TextView
|
||||
private lateinit var doneButton: Button
|
||||
private lateinit var backView: TextView
|
||||
private lateinit var wordLayout1: TextInputLayout
|
||||
private lateinit var wordLayout2: TextInputLayout
|
||||
private lateinit var wordLayout3: TextInputLayout
|
||||
private lateinit var wordLayout4: TextInputLayout
|
||||
private lateinit var wordLayout5: TextInputLayout
|
||||
private lateinit var wordLayout6: TextInputLayout
|
||||
private lateinit var wordLayout7: TextInputLayout
|
||||
private lateinit var wordLayout8: TextInputLayout
|
||||
private lateinit var wordLayout9: TextInputLayout
|
||||
private lateinit var wordLayout10: TextInputLayout
|
||||
private lateinit var wordLayout11: TextInputLayout
|
||||
private lateinit var wordLayout12: TextInputLayout
|
||||
private lateinit var wordList: ConstraintLayout
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?): View? {
|
||||
return inflater.inflate(R.layout.fragment_recovery_code_input, container, false)
|
||||
val v: View = inflater.inflate(R.layout.fragment_recovery_code_input, container, false)
|
||||
|
||||
introText = v.findViewById(R.id.introText)
|
||||
doneButton = v.findViewById(R.id.doneButton)
|
||||
backView = v.findViewById(R.id.backView)
|
||||
wordLayout1 = v.findViewById(R.id.wordLayout1)
|
||||
wordLayout2 = v.findViewById(R.id.wordLayout2)
|
||||
wordLayout3 = v.findViewById(R.id.wordLayout3)
|
||||
wordLayout4 = v.findViewById(R.id.wordLayout4)
|
||||
wordLayout5 = v.findViewById(R.id.wordLayout5)
|
||||
wordLayout6 = v.findViewById(R.id.wordLayout6)
|
||||
wordLayout7 = v.findViewById(R.id.wordLayout7)
|
||||
wordLayout8 = v.findViewById(R.id.wordLayout8)
|
||||
wordLayout9 = v.findViewById(R.id.wordLayout9)
|
||||
wordLayout10 = v.findViewById(R.id.wordLayout10)
|
||||
wordLayout11 = v.findViewById(R.id.wordLayout11)
|
||||
wordLayout12 = v.findViewById(R.id.wordLayout12)
|
||||
wordList = v.findViewById(R.id.wordList)
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
|
|
|
@ -5,20 +5,28 @@ import android.os.Bundle
|
|||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.Button
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.stevesoltys.seedvault.R
|
||||
import kotlinx.android.synthetic.main.fragment_recovery_code_output.*
|
||||
import org.koin.androidx.viewmodel.ext.android.sharedViewModel
|
||||
|
||||
class RecoveryCodeOutputFragment : Fragment() {
|
||||
|
||||
private val viewModel: RecoveryCodeViewModel by sharedViewModel()
|
||||
|
||||
private lateinit var wordList: RecyclerView
|
||||
private lateinit var confirmCodeButton: Button
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?): View? {
|
||||
return inflater.inflate(R.layout.fragment_recovery_code_output, container, false)
|
||||
val v: View = inflater.inflate(R.layout.fragment_recovery_code_output, container, false)
|
||||
|
||||
wordList = v.findViewById(R.id.wordList)
|
||||
confirmCodeButton = v.findViewById(R.id.confirmCodeButton)
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
|
|
|
@ -6,15 +6,22 @@ import android.view.View
|
|||
import android.view.View.INVISIBLE
|
||||
import android.view.View.VISIBLE
|
||||
import android.view.ViewGroup
|
||||
import android.widget.Button
|
||||
import android.widget.ProgressBar
|
||||
import android.widget.TextView
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.stevesoltys.seedvault.R
|
||||
import kotlinx.android.synthetic.main.fragment_storage_check.*
|
||||
|
||||
private const val TITLE = "title"
|
||||
private const val ERROR_MSG = "errorMsg"
|
||||
|
||||
class StorageCheckFragment : Fragment() {
|
||||
|
||||
private lateinit var titleView: TextView
|
||||
private lateinit var progressBar: ProgressBar
|
||||
private lateinit var errorView: TextView
|
||||
private lateinit var backButton: Button
|
||||
|
||||
companion object {
|
||||
fun newInstance(title: String, errorMsg: String? = null): StorageCheckFragment {
|
||||
val f = StorageCheckFragment()
|
||||
|
@ -28,7 +35,14 @@ class StorageCheckFragment : Fragment() {
|
|||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?): View? {
|
||||
return inflater.inflate(R.layout.fragment_storage_check, container, false)
|
||||
val v: View = inflater.inflate(R.layout.fragment_storage_check, container, false)
|
||||
|
||||
titleView = v.findViewById(R.id.titleView)
|
||||
progressBar = v.findViewById(R.id.progressBar)
|
||||
errorView = v.findViewById(R.id.errorView)
|
||||
backButton = v.findViewById(R.id.backButton)
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
|
|
|
@ -10,13 +10,16 @@ import android.view.View
|
|||
import android.view.View.INVISIBLE
|
||||
import android.view.View.VISIBLE
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.ProgressBar
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.app.AppCompatActivity.RESULT_OK
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.stevesoltys.seedvault.R
|
||||
import com.stevesoltys.seedvault.ui.INTENT_EXTRA_IS_RESTORE
|
||||
import com.stevesoltys.seedvault.ui.REQUEST_CODE_OPEN_DOCUMENT_TREE
|
||||
import kotlinx.android.synthetic.main.fragment_storage_root.*
|
||||
import org.koin.androidx.viewmodel.ext.android.getSharedViewModel
|
||||
|
||||
internal class StorageRootsFragment : Fragment(), StorageRootClickedListener {
|
||||
|
@ -32,12 +35,29 @@ internal class StorageRootsFragment : Fragment(), StorageRootClickedListener {
|
|||
}
|
||||
|
||||
private lateinit var viewModel: StorageViewModel
|
||||
private lateinit var titleView: TextView
|
||||
private lateinit var warningIcon: ImageView
|
||||
private lateinit var warningText: TextView
|
||||
private lateinit var divider: View
|
||||
private lateinit var listView: RecyclerView
|
||||
private lateinit var progressBar: ProgressBar
|
||||
private lateinit var backView: TextView
|
||||
|
||||
private val adapter by lazy { StorageRootAdapter(viewModel.isRestoreOperation, this) }
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?): View? {
|
||||
return inflater.inflate(R.layout.fragment_storage_root, container, false)
|
||||
val v: View = inflater.inflate(R.layout.fragment_storage_root, container, false)
|
||||
|
||||
titleView = v.findViewById(R.id.titleView)
|
||||
warningIcon = v.findViewById(R.id.warningIcon)
|
||||
warningText = v.findViewById(R.id.warningText)
|
||||
divider = v.findViewById(R.id.divider)
|
||||
listView = v.findViewById(R.id.listView)
|
||||
progressBar = v.findViewById(R.id.progressBar)
|
||||
backView = v.findViewById(R.id.backView)
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
|
|
Loading…
Reference in a new issue