Alias
This commit is contained in:
parent
527e8c395b
commit
cec312c93c
1 changed files with 8 additions and 10 deletions
|
@ -3,6 +3,7 @@ package com.mylloon.mobidl
|
|||
|
||||
import android.Manifest
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.AlertDialog
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.SharedPreferences
|
||||
|
@ -24,12 +25,9 @@ import androidx.recyclerview.widget.RecyclerView
|
|||
import com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import java.util.*
|
||||
import android.widget.Toast
|
||||
|
||||
|
||||
|
||||
import kotlinx.coroutines.*
|
||||
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
|
@ -154,8 +152,8 @@ class MainActivity : AppCompatActivity() {
|
|||
init {
|
||||
button = itemView?.findViewById(R.id.text_list_item)
|
||||
button?.setOnLongClickListener {
|
||||
val builder: android.app.AlertDialog.Builder =
|
||||
android.app.AlertDialog.Builder(instance)
|
||||
val builder: AlertDialog.Builder =
|
||||
AlertDialog.Builder(instance)
|
||||
builder.setTitle("${getString(R.string.remove)} ${button?.text} ?")
|
||||
builder.setPositiveButton(R.string.remove) { _, _ ->
|
||||
instance?.mainPage(
|
||||
|
@ -216,7 +214,7 @@ class MainActivity : AppCompatActivity() {
|
|||
|
||||
val addButton = findViewById<FloatingActionButton>(R.id.addButton)
|
||||
addButton.setOnClickListener {
|
||||
val builder: android.app.AlertDialog.Builder = android.app.AlertDialog.Builder(this)
|
||||
val builder: AlertDialog.Builder = AlertDialog.Builder(this)
|
||||
builder.setTitle(R.string.newAppDialogTitle)
|
||||
val input = EditText(this)
|
||||
input.inputType = InputType.TYPE_CLASS_TEXT
|
||||
|
@ -243,7 +241,7 @@ class MainActivity : AppCompatActivity() {
|
|||
.show()
|
||||
this.finishAffinity()
|
||||
} else {
|
||||
runBlocking {
|
||||
runBlocking { // GlobalScope.launch {
|
||||
val returns: MutableList<String>? = Scraper(user, password, app, captchaID = captchaID, captchaResponse = captchaResponse, debug = true).search()
|
||||
if (returns != null) { // if job is needed
|
||||
if (returns[0] == "errorNotConnected") loginPage()
|
||||
|
@ -257,7 +255,7 @@ class MainActivity : AppCompatActivity() {
|
|||
for((key, value) in registeredAnswered){
|
||||
if (returns[1] == key) return@runBlocking callScrapper(user, password, app, returns[2], value)
|
||||
}
|
||||
val builder: android.app.AlertDialog.Builder = android.app.AlertDialog.Builder(
|
||||
val builder: AlertDialog.Builder = AlertDialog.Builder(
|
||||
instance)
|
||||
builder.setTitle("Captcha")
|
||||
builder.setMessage(returns[1])
|
||||
|
|
Reference in a new issue