Compare commits

..

2 Commits
1.4.1 ... 1.4.2

Author SHA1 Message Date
johan12345
dcc03da237 Release 1.4.2 2022-11-18 22:27:27 +01:00
johan12345
295c00ea55 prefer to open URLs in custom tab, even if native app available
(such as EVMap itself)
2022-11-18 22:02:09 +01:00
5 changed files with 16 additions and 2 deletions

View File

@@ -21,8 +21,8 @@ android {
minSdkVersion 21
targetSdkVersion 33
// NOTE: always increase versionCode by 2 since automotive flavor uses versionCode + 1
versionCode 140
versionName "1.4.1"
versionCode 142
versionName "1.4.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resConfigs supportedLocales.split(",")

View File

@@ -15,6 +15,9 @@
<action android:name="android.intent.action.VIEW" />
<data android:scheme="google.navigation" />
</intent>
<intent>
<action android:name="android.support.customtabs.action.CustomTabsService" />
</intent>
</queries>
<application

View File

@@ -11,6 +11,7 @@ import android.view.View
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.browser.customtabs.CustomTabColorSchemeParams
import androidx.browser.customtabs.CustomTabsClient
import androidx.browser.customtabs.CustomTabsIntent
import androidx.core.content.ContextCompat
import androidx.core.splashscreen.SplashScreen
@@ -228,6 +229,7 @@ class MapsActivity : AppCompatActivity(),
}
fun openUrl(url: String) {
val pkg = CustomTabsClient.getPackageName(this, null)
val intent = CustomTabsIntent.Builder()
.setDefaultColorSchemeParams(
CustomTabColorSchemeParams.Builder()
@@ -235,6 +237,11 @@ class MapsActivity : AppCompatActivity(),
.build()
)
.build()
pkg?.let {
// prefer to open URL in custom tab, even if native app
// available (such as EVMap itself)
intent.intent.setPackage(pkg)
}
try {
intent.launchUrl(this, Uri.parse(url))
} catch (e: ActivityNotFoundException) {

View File

@@ -0,0 +1,2 @@
Fehler behoben:
- Links zur Datenquelle werden im Browser geöffnet auch wenn EVMap als Standard für Links von GoingElectric/OpenChargeMap gesetzt ist

View File

@@ -0,0 +1,2 @@
Bugfixes:
- Open links to data source in browser even if EVMap is set to open GoingElectric/OpenChargeMap links by default