Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_android_sdk_maven_plugin
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Panagiotis Triantafyllou
2024-09-04 11:42:01 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b7f9b720020ed683a9fffd14c6a22c977e112e97
b7f9b720
1 parent
81e93122
added geo scheme handler to webview
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
15 deletions
.idea/deploymentTargetDropDown.xml
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/views/WarpView.java
.idea/deploymentTargetDropDown.xml
View file @
b7f9b72
...
...
@@ -3,20 +3,7 @@
<component
name=
"deploymentTargetDropDown"
>
<value>
<entry
key=
"app"
>
<State>
<runningDeviceTargetSelectedWithDropDown>
<Target>
<type
value=
"RUNNING_DEVICE_TARGET"
/>
<deviceKey>
<Key>
<type
value=
"SERIAL_NUMBER"
/>
<value
value=
"R58M42EM7YT"
/>
</Key>
</deviceKey>
</Target>
</runningDeviceTargetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown
value=
"2024-07-26T14:53:01.900442Z"
/>
</State>
<State
/>
</entry>
</value>
</component>
...
...
warply_android_sdk/build.gradle
View file @
b7f9b72
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.5.4r3
3
'
PUBLISH_VERSION
=
'4.5.5.4r3
4
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/WarpView.java
View file @
b7f9b72
...
...
@@ -122,6 +122,9 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
private
static
final
String
URL_ACTION_MAIL
=
"mailto"
;
private
static
final
String
URL_ACTION_MARKET
=
"market"
;
private
static
final
String
URL_ACTION_INTENT
=
"intent"
;
private
static
final
String
URL_ACTION_MAPS
=
"geo"
;
private
static
final
String
URL_FALLBACK_MAPS
=
"https://www.google.com/maps/search/?api=1&query="
;
private
static
final
String
URL_ACTION_MARKET_AUTHORITY
=
"play.google.com"
;
// ===========================================================
...
...
@@ -230,6 +233,39 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
}
}
private
void
actionMap
(
String
strUrl
)
{
try
{
Uri
webpage
=
Uri
.
parse
(
strUrl
);
Intent
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
,
webpage
);
getContext
().
startActivity
(
intent
);
}
catch
(
ActivityNotFoundException
e
)
{
if
(
WarpConstants
.
DEBUG
)
{
e
.
printStackTrace
();
}
// String tempUrl = strUrl.split("q=")[1];
// Find the start index after "geo:"
int
startIndex
=
strUrl
.
indexOf
(
"geo:"
)
+
4
;
// Find the index of "?" to ignore everything after it
int
endIndex
=
strUrl
.
indexOf
(
"?"
);
// If there is no "?", set the endIndex to the length of the string
if
(
endIndex
==
-
1
)
{
endIndex
=
strUrl
.
length
();
}
// Extract the latitude and longitude part
String
tempUrl
=
strUrl
.
substring
(
startIndex
,
endIndex
);
if
(!
TextUtils
.
isEmpty
(
tempUrl
))
{
Uri
webpage
=
Uri
.
parse
(
URL_FALLBACK_MAPS
+
tempUrl
);
Intent
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
,
webpage
);
getContext
().
startActivity
(
intent
);
}
}
}
private
void
actionTel
(
Uri
uri
)
{
try
{
...
...
@@ -905,6 +941,9 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
}
catch
(
URISyntaxException
e
)
{
return
true
;
}
}
else
if
(
scheme
.
equals
(
URL_ACTION_MAPS
))
{
actionMap
(
strUrl
);
return
true
;
}
return
false
;
}
...
...
Please
register
or
login
to post a comment