|
|
|
@ -14,6 +14,7 @@ import android.widget.EditText
|
|
|
|
import android.widget.TextView
|
|
|
|
import android.widget.TextView
|
|
|
|
import androidx.activity.result.ActivityResultLauncher
|
|
|
|
import androidx.activity.result.ActivityResultLauncher
|
|
|
|
import androidx.activity.result.contract.ActivityResultContracts
|
|
|
|
import androidx.activity.result.contract.ActivityResultContracts
|
|
|
|
|
|
|
|
import androidx.appcompat.widget.SwitchCompat
|
|
|
|
import androidx.core.view.isVisible
|
|
|
|
import androidx.core.view.isVisible
|
|
|
|
import androidx.core.widget.doOnTextChanged
|
|
|
|
import androidx.core.widget.doOnTextChanged
|
|
|
|
import androidx.fragment.app.Fragment
|
|
|
|
import androidx.fragment.app.Fragment
|
|
|
|
@ -88,6 +89,7 @@ class GenerateYoutubePoTokensFragment : Fragment() {
|
|
|
|
val useVisitorData = requireView().findViewById<MaterialSwitch>(R.id.use_visitor_data)
|
|
|
|
val useVisitorData = requireView().findViewById<MaterialSwitch>(R.id.use_visitor_data)
|
|
|
|
|
|
|
|
|
|
|
|
switch.isChecked = conf.enabled
|
|
|
|
switch.isChecked = conf.enabled
|
|
|
|
|
|
|
|
switch.jumpDrawablesToCurrentState()
|
|
|
|
useVisitorData.isEnabled = conf.enabled
|
|
|
|
useVisitorData.isEnabled = conf.enabled
|
|
|
|
|
|
|
|
|
|
|
|
fun setValues(conf: YoutubeGeneratePoTokenItem) {
|
|
|
|
fun setValues(conf: YoutubeGeneratePoTokenItem) {
|
|
|
|
@ -175,6 +177,7 @@ class GenerateYoutubePoTokensFragment : Fragment() {
|
|
|
|
|
|
|
|
|
|
|
|
useVisitorData?.apply {
|
|
|
|
useVisitorData?.apply {
|
|
|
|
this.isChecked = conf.useVisitorData
|
|
|
|
this.isChecked = conf.useVisitorData
|
|
|
|
|
|
|
|
useVisitorData.jumpDrawablesToCurrentState()
|
|
|
|
setOnCheckedChangeListener { _, b ->
|
|
|
|
setOnCheckedChangeListener { _, b ->
|
|
|
|
configuration.remove(conf)
|
|
|
|
configuration.remove(conf)
|
|
|
|
conf.useVisitorData = b
|
|
|
|
conf.useVisitorData = b
|
|
|
|
@ -203,6 +206,7 @@ class GenerateYoutubePoTokensFragment : Fragment() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
regenerateBtn.setOnClickListener {
|
|
|
|
regenerateBtn.setOnClickListener {
|
|
|
|
|
|
|
|
layout.dismiss()
|
|
|
|
val intent = Intent(requireContext(), PoTokenWebViewLoginActivity::class.java)
|
|
|
|
val intent = Intent(requireContext(), PoTokenWebViewLoginActivity::class.java)
|
|
|
|
intent.putExtra("url", editText.text.toString())
|
|
|
|
intent.putExtra("url", editText.text.toString())
|
|
|
|
webPoTokenResultLauncher.launch(intent)
|
|
|
|
webPoTokenResultLauncher.launch(intent)
|
|
|
|
|