some customizations (#59)

* quickfix

* android locale tuning

* toggle option to setting

* some customizations

---------

Co-authored-by: rebelonion <87634197+rebelonion@users.noreply.github.com>
This commit is contained in:
aayush262 2023-11-24 12:58:44 +05:30 committed by GitHub
parent ba351df331
commit af326c8258
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 40 additions and 33 deletions

View file

@ -182,17 +182,21 @@ OS Version: $CODENAME $RELEASE ($SDK_INT)
val dialogView = layoutInflater.inflate(R.layout.dialog_user_agent, null)
val editText = dialogView.findViewById<TextInputEditText>(R.id.userAgentTextBox)
editText.setText(networkPreferences.defaultUserAgent().get())
val alertDialog = AlertDialog.Builder(this)
val alertDialog = AlertDialog.Builder(this ,R.style.MyPopup)
.setTitle("User Agent")
.setView(dialogView)
.setPositiveButton("OK") { dialog, _ ->
networkPreferences.defaultUserAgent().set(editText.text.toString())
dialog.dismiss()
}
.setNegativeButton("Reset") { dialog, _ ->
.setNeutralButton("Reset") { dialog, _ ->
networkPreferences.defaultUserAgent().set("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:110.0) Gecko/20100101 Firefox/110.0") // Reset to default or empty
editText.setText("")
dialog.dismiss()
}
.setNegativeButton("Cancel") { dialog, _ ->
dialog.dismiss()
}
.create()
alertDialog.show()