From 3f4ce3bb394f3d674aa8b3c7321d3354a3f5fa18 Mon Sep 17 00:00:00 2001 From: Mygod Date: Fri, 12 Jan 2024 22:26:45 -0500 Subject: [PATCH 01/10] Update dependencies --- gradle/libs.versions.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 00a61e0..bba1e20 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] activity = "1.8.2" -agp = "8.3.0-beta01" +agp = "8.3.0-beta02" androidx-test-ext-junit = "1.1.5" browser = "1.8.0-beta01" core = "1.12.0" @@ -12,7 +12,7 @@ fragment = "1.6.2" hiddenapibypass = "4.3" junit = "4.13.2" kotlin = "1.9.22" -lifecycle = "2.7.0-rc02" +lifecycle = "2.7.0" google-services = "4.4.0" play-services-location = "21.0.1" timber = "5.0.1" From 7aac4c9ad514b3ea7d51f8e93a6668f20025f9d0 Mon Sep 17 00:00:00 2001 From: Mygod Date: Sat, 13 Jan 2024 10:40:36 -0500 Subject: [PATCH 02/10] Listen for WebView crashes --- app/build.gradle.kts | 2 +- gradle/libs.versions.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index d59850c..bd5cc3c 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -65,7 +65,7 @@ dependencies { implementation(libs.browser) implementation(libs.core.ktx) implementation(libs.firebase.analytics) - implementation(libs.firebase.crashlytics) + implementation(libs.firebase.crashlytics.ndk) // without Play console we need to use ndk to see native crashes implementation(libs.fragment.ktx) implementation(libs.hiddenapibypass) implementation(libs.play.services.location) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index bba1e20..1bb33d5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -28,7 +28,7 @@ desugar = { group = "com.android.tools", name = "desugar_jdk_libs", version.ref espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso-core" } firebase-analytics = { group = "com.google.firebase", name = "firebase-analytics" } firebase-bom = { group = "com.google.firebase", name = "firebase-bom", version.ref = "firebase" } -firebase-crashlytics = { group = "com.google.firebase", name = "firebase-crashlytics" } +firebase-crashlytics-ndk = { group = "com.google.firebase", name = "firebase-crashlytics-ndk" } fragment-ktx = { group = "androidx.fragment", name = "fragment-ktx", version.ref = "fragment" } hiddenapibypass = { group = "org.lsposed.hiddenapibypass", name = "hiddenapibypass", version.ref = "hiddenapibypass" } junit = { group = "junit", name = "junit", version.ref = "junit" } From 9f9bb3f991c920f93f85195b1b5ac403f7ddea58 Mon Sep 17 00:00:00 2001 From: Mygod Date: Sat, 13 Jan 2024 10:55:55 -0500 Subject: [PATCH 03/10] Add abiFilters --- app/build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index bd5cc3c..e736c50 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -31,6 +31,7 @@ android { extra["reactmap.githubReleases"] as String } else "null") resourceConfigurations.addAll(arrayOf("en-rUS", "pl")) + ndk.abiFilters.addAll(listOf("armeabi-v7a", "arm64-v8a")) } buildTypes { From f3568c219aec9af65abe1579c35ad9e46914103d Mon Sep 17 00:00:00 2001 From: Mygod Date: Sat, 27 Jan 2024 12:15:00 -0500 Subject: [PATCH 04/10] Update dependencies --- gradle/libs.versions.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1bb33d5..7909807 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,17 +7,17 @@ core = "1.12.0" crashlytics = "2.9.9" desugar = "2.0.4" espresso-core = "3.5.1" -firebase = "32.7.0" +firebase = "32.7.1" fragment = "1.6.2" hiddenapibypass = "4.3" junit = "4.13.2" kotlin = "1.9.22" lifecycle = "2.7.0" google-services = "4.4.0" -play-services-location = "21.0.1" +play-services-location = "21.1.0" timber = "5.0.1" work = "2.9.0" -gradle-versions = "0.50.0" +gradle-versions = "0.51.0" [libraries] activity = { group = "androidx.activity", name = "activity", version.ref = "activity" } From 72011841964f63d8eb190bbb41426e5b81bc64d7 Mon Sep 17 00:00:00 2001 From: Mygod Date: Sat, 27 Jan 2024 12:17:54 -0500 Subject: [PATCH 05/10] Fix vendorJsMatcher and better error logging Updated to support https://github.com/WatWowMap/ReactMap/commit/06851916355280d33a4a45c2dd5e333fef455210 Also backwards compatible. --- .../be/mygod/reactmap/webkit/ReactMapFragment.kt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/be/mygod/reactmap/webkit/ReactMapFragment.kt b/app/src/main/java/be/mygod/reactmap/webkit/ReactMapFragment.kt index f121e3f..ca87c62 100644 --- a/app/src/main/java/be/mygod/reactmap/webkit/ReactMapFragment.kt +++ b/app/src/main/java/be/mygod/reactmap/webkit/ReactMapFragment.kt @@ -50,10 +50,10 @@ import java.util.Locale class ReactMapFragment @JvmOverloads constructor(private var overrideUri: Uri? = null) : Fragment() { companion object { private val filenameExtractor = "filename=(\"([^\"]+)\"|[^;]+)".toRegex(RegexOption.IGNORE_CASE) - private val vendorJsMatcher = "/vendor-[0-9a-f]{8}\\.js".toRegex() + private val vendorJsMatcher = "/vendor-[0-9a-z]{8}\\.js".toRegex(RegexOption.IGNORE_CASE) private val flyToMatcher = "/@/([0-9.-]+)/([0-9.-]+)(?:/([0-9.-]+))?/?".toRegex() private val mapHijacker = "(?<=[\\n\\r\\s,])this(?=.callInitHooks\\(\\)[,;][\\n\\r\\s]*this._zoomAnimated\\s*=)" - .toRegex() + .toPattern() private val supportedHosts = setOf("discordapp.com", "discord.com", "telegram.org", "oauth.telegram.org") } @@ -266,7 +266,15 @@ class ReactMapFragment @JvmOverloads constructor(private var overrideUri: Uri? = response } private fun handleVendorJs(request: WebResourceRequest) = buildResponse(request) { reader -> - mapHijacker.replace(reader.readText(), "(window._hijackedMap=this)") + val response = reader.readText() + val matcher = mapHijacker.matcher(response) + if (matcher.find()) StringBuilder().also { + matcher.appendReplacement(it, "(console.log(this),window._hijackedMap=this)") + matcher.appendTail(it) + }.toString() else { + Timber.w(Exception("vendor.js unmatched")) + response + } } override fun onDestroyView() { From a2977dfeafead7e7427e763b401cf37c8e83ee34 Mon Sep 17 00:00:00 2001 From: Mygod Date: Sat, 27 Jan 2024 12:48:23 -0500 Subject: [PATCH 06/10] Fix missing API --- app/src/main/java/be/mygod/reactmap/webkit/ReactMapFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/be/mygod/reactmap/webkit/ReactMapFragment.kt b/app/src/main/java/be/mygod/reactmap/webkit/ReactMapFragment.kt index ca87c62..d8e54ce 100644 --- a/app/src/main/java/be/mygod/reactmap/webkit/ReactMapFragment.kt +++ b/app/src/main/java/be/mygod/reactmap/webkit/ReactMapFragment.kt @@ -268,7 +268,7 @@ class ReactMapFragment @JvmOverloads constructor(private var overrideUri: Uri? = private fun handleVendorJs(request: WebResourceRequest) = buildResponse(request) { reader -> val response = reader.readText() val matcher = mapHijacker.matcher(response) - if (matcher.find()) StringBuilder().also { + if (matcher.find()) StringBuffer().also { matcher.appendReplacement(it, "(console.log(this),window._hijackedMap=this)") matcher.appendTail(it) }.toString() else { From 946497be8659bd9d0e2860b2c0872689b2574cae Mon Sep 17 00:00:00 2001 From: Mygod Date: Sat, 27 Jan 2024 12:51:50 -0500 Subject: [PATCH 07/10] Improve performance --- .../java/be/mygod/reactmap/webkit/ReactMapFragment.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/be/mygod/reactmap/webkit/ReactMapFragment.kt b/app/src/main/java/be/mygod/reactmap/webkit/ReactMapFragment.kt index d8e54ce..60a83cf 100644 --- a/app/src/main/java/be/mygod/reactmap/webkit/ReactMapFragment.kt +++ b/app/src/main/java/be/mygod/reactmap/webkit/ReactMapFragment.kt @@ -3,6 +3,7 @@ package be.mygod.reactmap.webkit import android.annotation.SuppressLint import android.graphics.Bitmap import android.net.Uri +import android.os.Build import android.os.Bundle import android.util.JsonWriter import android.util.Log @@ -268,10 +269,13 @@ class ReactMapFragment @JvmOverloads constructor(private var overrideUri: Uri? = private fun handleVendorJs(request: WebResourceRequest) = buildResponse(request) { reader -> val response = reader.readText() val matcher = mapHijacker.matcher(response) - if (matcher.find()) StringBuffer().also { - matcher.appendReplacement(it, "(console.log(this),window._hijackedMap=this)") + if (matcher.find()) (if (Build.VERSION.SDK_INT >= 34) StringBuilder().also { + matcher.appendReplacement(it, "(window._hijackedMap=this)") matcher.appendTail(it) - }.toString() else { + } else StringBuffer().also { + matcher.appendReplacement(it, "(window._hijackedMap=this)") + matcher.appendTail(it) + }).toString() else { Timber.w(Exception("vendor.js unmatched")) response } From c88a12447a5505cdce3d366f540f2babfc4fbdcd Mon Sep 17 00:00:00 2001 From: Mygod Date: Sat, 27 Jan 2024 14:06:57 -0500 Subject: [PATCH 08/10] Use Material 3 and add load error snackbar --- app/build.gradle.kts | 1 + .../be/mygod/reactmap/webkit/ReactMapFragment.kt | 14 +++++++++++++- app/src/main/res/values-night/theme.xml | 4 ---- app/src/main/res/values/theme.xml | 7 +------ gradle/libs.versions.toml | 2 ++ 5 files changed, 17 insertions(+), 11 deletions(-) delete mode 100644 app/src/main/res/values-night/theme.xml diff --git a/app/build.gradle.kts b/app/build.gradle.kts index e736c50..015db97 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -69,6 +69,7 @@ dependencies { implementation(libs.firebase.crashlytics.ndk) // without Play console we need to use ndk to see native crashes implementation(libs.fragment.ktx) implementation(libs.hiddenapibypass) + implementation(libs.material) implementation(libs.play.services.location) implementation(libs.lifecycle.common) implementation(libs.timber) diff --git a/app/src/main/java/be/mygod/reactmap/webkit/ReactMapFragment.kt b/app/src/main/java/be/mygod/reactmap/webkit/ReactMapFragment.kt index 60a83cf..f1ec96f 100644 --- a/app/src/main/java/be/mygod/reactmap/webkit/ReactMapFragment.kt +++ b/app/src/main/java/be/mygod/reactmap/webkit/ReactMapFragment.kt @@ -14,6 +14,7 @@ import android.webkit.ConsoleMessage import android.webkit.RenderProcessGoneDetail import android.webkit.ValueCallback import android.webkit.WebChromeClient +import android.webkit.WebResourceError import android.webkit.WebResourceRequest import android.webkit.WebResourceResponse import android.webkit.WebView @@ -21,6 +22,7 @@ import android.webkit.WebViewClient import android.widget.Toast import androidx.activity.OnBackPressedCallback import androidx.activity.result.contract.ActivityResultContracts +import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.core.net.toUri import androidx.core.os.bundleOf import androidx.core.view.WindowCompat @@ -34,6 +36,7 @@ import be.mygod.reactmap.R import be.mygod.reactmap.follower.BackgroundLocationReceiver import be.mygod.reactmap.util.CreateDynamicDocument import be.mygod.reactmap.util.findErrorStream +import com.google.android.material.snackbar.Snackbar import com.google.firebase.analytics.FirebaseAnalytics import kotlinx.coroutines.launch import org.json.JSONArray @@ -181,6 +184,13 @@ class ReactMapFragment @JvmOverloads constructor(private var overrideUri: Uri? = } else if (vendorJsMatcher.matchEntire(path) != null) handleVendorJs(request) else null } + override fun onReceivedError(view: WebView?, request: WebResourceRequest, error: WebResourceError) { + if (!request.isForMainFrame) return + Snackbar.make(web, "${error.description} (${error.errorCode})", Snackbar.LENGTH_INDEFINITE).apply { + setAction("Refresh") { web.reload() } + }.show() + } + override fun onRenderProcessGone(view: WebView, detail: RenderProcessGoneDetail): Boolean { if (detail.didCrash()) { Timber.w(Exception("WebView crashed @ priority ${detail.rendererPriorityAtExit()}")) @@ -206,7 +216,9 @@ class ReactMapFragment @JvmOverloads constructor(private var overrideUri: Uri? = } loadUrl(activeUrl) } - return web + return CoordinatorLayout(activity).apply { + addView(web, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) + } } private fun buildResponse(request: WebResourceRequest, transform: (Reader) -> String) = try { diff --git a/app/src/main/res/values-night/theme.xml b/app/src/main/res/values-night/theme.xml deleted file mode 100644 index 199d541..0000000 --- a/app/src/main/res/values-night/theme.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7909807..36b2680 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -14,6 +14,7 @@ junit = "4.13.2" kotlin = "1.9.22" lifecycle = "2.7.0" google-services = "4.4.0" +material = "1.11.0" play-services-location = "21.1.0" timber = "5.0.1" work = "2.9.0" @@ -33,6 +34,7 @@ fragment-ktx = { group = "androidx.fragment", name = "fragment-ktx", version.ref hiddenapibypass = { group = "org.lsposed.hiddenapibypass", name = "hiddenapibypass", version.ref = "hiddenapibypass" } junit = { group = "junit", name = "junit", version.ref = "junit" } lifecycle-common = { group = "androidx.lifecycle", name = "lifecycle-common", version.ref = "lifecycle" } +material = { group = "com.google.android.material", name = "material", version.ref = "material" } play-services-location = { group = "com.google.android.gms", name = "play-services-location", version.ref = "play-services-location" } timber = { group = "com.jakewharton.timber", name = "timber", version.ref = "timber" } work = { group = "androidx.work", name = "work-runtime", version.ref = "work" } From 68f4267aa8b8726e9798aa3ca0f05c6b7fba3e1f Mon Sep 17 00:00:00 2001 From: Mygod Date: Sat, 27 Jan 2024 14:58:14 -0500 Subject: [PATCH 09/10] Refine design --- .../be/mygod/reactmap/ConfigDialogFragment.kt | 56 +++++++++---------- .../java/be/mygod/reactmap/MainActivity.kt | 11 +++- .../reactmap/util/AlertDialogFragment.kt | 5 +- app/src/main/res/layout/dialog_config.xml | 28 ++++++++++ app/src/main/res/layout/layout_main.xml | 3 +- 5 files changed, 65 insertions(+), 38 deletions(-) create mode 100644 app/src/main/res/layout/dialog_config.xml diff --git a/app/src/main/java/be/mygod/reactmap/ConfigDialogFragment.kt b/app/src/main/java/be/mygod/reactmap/ConfigDialogFragment.kt index 662681d..745fbb1 100644 --- a/app/src/main/java/be/mygod/reactmap/ConfigDialogFragment.kt +++ b/app/src/main/java/be/mygod/reactmap/ConfigDialogFragment.kt @@ -1,16 +1,15 @@ package be.mygod.reactmap import android.Manifest -import android.app.AlertDialog import android.content.DialogInterface import android.content.pm.PackageManager +import android.os.Bundle import android.os.Parcelable import android.widget.ArrayAdapter import android.widget.AutoCompleteTextView -import android.widget.LinearLayout -import android.widget.Switch import android.widget.Toast import androidx.activity.result.contract.ActivityResultContracts +import androidx.appcompat.app.AlertDialog import androidx.core.content.edit import androidx.core.net.toUri import be.mygod.reactmap.App.Companion.app @@ -19,6 +18,7 @@ import be.mygod.reactmap.util.AlertDialogFragment import be.mygod.reactmap.util.Empty import be.mygod.reactmap.util.readableMessage import be.mygod.reactmap.webkit.ReactMapHttpEngine +import com.google.android.material.materialswitch.MaterialSwitch import kotlinx.parcelize.Parcelize class ConfigDialogFragment : AlertDialogFragment() { @@ -31,7 +31,7 @@ class ConfigDialogFragment : AlertDialogFragment private lateinit var urlEdit: AutoCompleteTextView - private lateinit var followerSwitch: Switch + private lateinit var followerSwitch: MaterialSwitch private val requestLocation = registerForActivityResult(ActivityResultContracts.RequestMultiplePermissions()) { if (it.any { (_, v) -> v }) { @@ -47,39 +47,33 @@ class ConfigDialogFragment : AlertDialogFragment - if (isChecked) requestLocation.launch(arrayOf( - Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION)) - } - } - setView(LinearLayout(context).apply { - orientation = LinearLayout.VERTICAL - addView(urlEdit, LinearLayout.LayoutParams( - LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)) - addView(followerSwitch, LinearLayout.LayoutParams( - LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)) - }) + setView(R.layout.dialog_config) setTitle(R.string.config_dialog_title) if (arg.welcome) setMessage(R.string.config_welcome) setPositiveButton(android.R.string.ok, listener) setNegativeButton(android.R.string.cancel, null) } + override fun onCreateDialog(savedInstanceState: Bundle?) = super.onCreateDialog(savedInstanceState).apply { + create() + historyUrl = app.pref.getStringSet(KEY_HISTORY_URL, null) ?: setOf("https://${BuildConfig.DEFAULT_DOMAIN}") + val context = requireContext() + urlEdit = findViewById(android.R.id.edit)!! + urlEdit.setAdapter(ArrayAdapter(context, android.R.layout.select_dialog_item, historyUrl.toTypedArray())) + urlEdit.setText(app.activeUrl) + followerSwitch = findViewById(android.R.id.switch_widget)!! + followerSwitch.isChecked = BackgroundLocationReceiver.enabled && (context.checkSelfPermission( + Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED || + context.checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) == + PackageManager.PERMISSION_GRANTED) && + context.checkSelfPermission(Manifest.permission.ACCESS_BACKGROUND_LOCATION) == + PackageManager.PERMISSION_GRANTED + followerSwitch.setOnCheckedChangeListener { _, isChecked -> + if (isChecked) requestLocation.launch(arrayOf( + Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION)) + } + } + override val ret get() = try { val uri = urlEdit.text!!.toString().toUri().let { require("https".equals(it.scheme, true)) { getText(R.string.error_https_only) } diff --git a/app/src/main/java/be/mygod/reactmap/MainActivity.kt b/app/src/main/java/be/mygod/reactmap/MainActivity.kt index c952949..1d5b033 100644 --- a/app/src/main/java/be/mygod/reactmap/MainActivity.kt +++ b/app/src/main/java/be/mygod/reactmap/MainActivity.kt @@ -1,6 +1,5 @@ package be.mygod.reactmap -import android.app.AlertDialog import android.content.DialogInterface import android.content.Intent import android.net.Uri @@ -11,10 +10,10 @@ import android.system.Os import android.system.OsConstants import android.view.WindowManager import android.webkit.WebView -import android.widget.Switch import android.widget.Toast import androidx.activity.enableEdgeToEdge import androidx.annotation.RequiresApi +import androidx.appcompat.app.AlertDialog import androidx.core.content.edit import androidx.fragment.app.FragmentActivity import androidx.fragment.app.commit @@ -28,6 +27,7 @@ import be.mygod.reactmap.util.UnblockCentral import be.mygod.reactmap.util.UpdateChecker import be.mygod.reactmap.util.readableMessage import be.mygod.reactmap.webkit.ReactMapFragment +import com.google.android.material.materialswitch.MaterialSwitch import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.delay import kotlinx.coroutines.launch @@ -127,9 +127,14 @@ class MainActivity : FragmentActivity() { ACTION_RESTART_GAME -> AlertDialog.Builder(this).apply { setTitle(R.string.restart_game_dialog_title) setMessage(R.string.restart_game_dialog_message) - val switch = Switch(this@MainActivity).apply { + val switch = MaterialSwitch(this@MainActivity).apply { setText(R.string.pip_phone_enter_split) isChecked = isInMultiWindowMode + val padding = context.obtainStyledAttributes(intArrayOf( + com.google.android.material.R.attr.dialogPreferredPadding)).use { + it.getDimensionPixelOffset(0, 0) + } + setPadding(padding, 0, padding, 0) } setView(switch) setPositiveButton(R.string.restart_game_standard) { _, _ -> diff --git a/app/src/main/java/be/mygod/reactmap/util/AlertDialogFragment.kt b/app/src/main/java/be/mygod/reactmap/util/AlertDialogFragment.kt index 1b6db17..a092261 100644 --- a/app/src/main/java/be/mygod/reactmap/util/AlertDialogFragment.kt +++ b/app/src/main/java/be/mygod/reactmap/util/AlertDialogFragment.kt @@ -1,16 +1,17 @@ package be.mygod.reactmap.util import android.app.Activity -import android.app.AlertDialog import android.content.DialogInterface import android.os.Bundle import android.os.Parcelable +import androidx.appcompat.app.AlertDialog import androidx.core.os.bundleOf import androidx.fragment.app.DialogFragment import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity import androidx.fragment.app.setFragmentResult import androidx.fragment.app.setFragmentResultListener +import com.google.android.material.dialog.MaterialAlertDialogBuilder import kotlinx.parcelize.Parcelize /** @@ -54,7 +55,7 @@ abstract class AlertDialogFragment : fun key(resultKey: String = javaClass.name) = args().putString(KEY_RESULT, resultKey) override fun onCreateDialog(savedInstanceState: Bundle?): AlertDialog = - AlertDialog.Builder(requireContext()).also { it.prepare(this) }.create() + MaterialAlertDialogBuilder(requireContext()).also { it.prepare(this) }.create() override fun onClick(dialog: DialogInterface?, which: Int) { setFragmentResult(resultKey ?: return, Bundle().apply { diff --git a/app/src/main/res/layout/dialog_config.xml b/app/src/main/res/layout/dialog_config.xml new file mode 100644 index 0000000..a30fbd0 --- /dev/null +++ b/app/src/main/res/layout/dialog_config.xml @@ -0,0 +1,28 @@ + + + + + + + diff --git a/app/src/main/res/layout/layout_main.xml b/app/src/main/res/layout/layout_main.xml index a79beec..e0241a3 100644 --- a/app/src/main/res/layout/layout_main.xml +++ b/app/src/main/res/layout/layout_main.xml @@ -1,6 +1,5 @@ - From 7f42182d39088a6aa1a4256fc19c369069b467fe Mon Sep 17 00:00:00 2001 From: Mygod Date: Sat, 27 Jan 2024 15:06:47 -0500 Subject: [PATCH 10/10] Add translation for refresh --- app/src/main/java/be/mygod/reactmap/webkit/ReactMapFragment.kt | 2 +- app/src/main/res/values-pl/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/be/mygod/reactmap/webkit/ReactMapFragment.kt b/app/src/main/java/be/mygod/reactmap/webkit/ReactMapFragment.kt index f1ec96f..19a27fc 100644 --- a/app/src/main/java/be/mygod/reactmap/webkit/ReactMapFragment.kt +++ b/app/src/main/java/be/mygod/reactmap/webkit/ReactMapFragment.kt @@ -187,7 +187,7 @@ class ReactMapFragment @JvmOverloads constructor(private var overrideUri: Uri? = override fun onReceivedError(view: WebView?, request: WebResourceRequest, error: WebResourceError) { if (!request.isForMainFrame) return Snackbar.make(web, "${error.description} (${error.errorCode})", Snackbar.LENGTH_INDEFINITE).apply { - setAction("Refresh") { web.reload() } + setAction(R.string.web_refresh) { web.reload() } }.show() } diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 8ed6364..f4f8d47 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -31,4 +31,5 @@ Użytkownik nieznaleziony - brak dostępu do powiadomień Włącz podzielony ekran + Odśwież diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a0b486b..548f3e4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -34,4 +34,5 @@ Human not found Enter split screen + Refresh