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-04-11 15:31:36 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e462e2a07cad7fc05164108278280e1726d5175f
e462e2a0
1 parent
ca6013fa
webview fix for sm deals campaign
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
13 deletions
app/src/main/java/warp/ly/android_sdk/activities/SplashActivity.java
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/activities/WarpViewActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/WarpView.java
app/src/main/java/warp/ly/android_sdk/activities/SplashActivity.java
View file @
e462e2a
...
...
@@ -38,7 +38,7 @@ public class SplashActivity extends BaseActivity {
if
(!
WarplyDBHelper
.
getInstance
(
SplashActivity
.
this
).
isTableNotEmpty
(
"auth"
))
{
//6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons
//prod 6006552990, prod 6005892749, live 3000184910,prod 7000070282, live 3000136179
WarplyManager
.
getCosmoteUser
(
"70000
00833
"
,
mLoginReceiver
);
WarplyManager
.
getCosmoteUser
(
"70000
23687
"
,
mLoginReceiver
);
// WarplyManager.verifyTicket("", "7000023699", mLoginReceiver);
}
else
{
startNextActivity
();
...
...
warply_android_sdk/build.gradle
View file @
e462e2a
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.5.4r2
0
'
PUBLISH_VERSION
=
'4.5.5.4r2
1
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/WarpViewActivity.java
View file @
e462e2a
...
...
@@ -91,6 +91,7 @@ public class WarpViewActivity extends WarpBaseActivity {
private
WarpView
mWarpView
;
private
static
Handler
metersHandler
;
private
static
boolean
mWebviewSupermarket
=
false
;
// ===========================================================
// Methods for/from SuperClass/Interfaces
...
...
@@ -100,6 +101,7 @@ public class WarpViewActivity extends WarpBaseActivity {
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
metersHandler
=
new
Handler
();
mWebviewSupermarket
=
false
;
WarplySessionManager
.
onCreateActivity
(
this
);
initViews
();
Warply
.
getInitializer
(
this
).
init
();
...
...
@@ -118,6 +120,16 @@ public class WarpViewActivity extends WarpBaseActivity {
super
.
onStart
();
WarplySessionManager
.
onStartActivity
(
this
);
EventBus
.
getDefault
().
register
(
this
);
if
(
mWarpView
!=
null
)
{
if
(
getWebviewSupermarket
())
{
String
scriptSourceInit
=
"webviewDidFocusRefresh("
+
String
.
valueOf
(
getWebviewSupermarket
())
+
");"
;
mWarpView
.
evaluateJavascript
(
scriptSourceInit
,
s
->
{
});
setWebviewSupermarket
(
false
);
}
}
}
@Override
...
...
@@ -133,6 +145,7 @@ public class WarpViewActivity extends WarpBaseActivity {
if
(
metersHandler
!=
null
)
metersHandler
.
removeCallbacksAndMessages
(
null
);
sendSteps
();
WarpUtils
.
setWebviewParams
(
this
,
new
JSONObject
());
setWebviewSupermarket
(
false
);
}
@Override
...
...
@@ -326,6 +339,14 @@ public class WarpViewActivity extends WarpBaseActivity {
return
metersHandler
;
}
public
static
boolean
getWebviewSupermarket
()
{
return
mWebviewSupermarket
;
}
public
static
void
setWebviewSupermarket
(
boolean
isLoaded
)
{
mWebviewSupermarket
=
isLoaded
;
}
private
void
sendSteps
()
{
String
date
=
new
SimpleDateFormat
(
"yyyy-MM-dd hh:mm:ss"
,
Locale
.
getDefault
()).
format
(
new
Date
());
WarpUtils
.
log
(
"SEND_STEPS: "
+
String
.
valueOf
(
WarpUtils
.
getStepsCounter
(
this
)));
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/WarpView.java
View file @
e462e2a
...
...
@@ -139,7 +139,7 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
private
Activity
WarpActivity
;
private
String
geolocationOrigin
=
""
;
private
Callback
geolocationCallback
;
private
static
boolean
mWebviewLoaded
=
false
,
mWebviewSupermarket
=
false
;
private
static
boolean
mWebviewLoaded
=
false
;
// ===========================================================
// Constructors
...
...
@@ -159,7 +159,6 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
ProcessLifecycleOwner
.
get
().
getLifecycle
().
addObserver
(
this
);
WarpActivity
=
activity
;
mWebviewLoaded
=
false
;
mWebviewSupermarket
=
false
;
init
();
}
...
...
@@ -437,13 +436,6 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
});
}
if
(
mWebviewSupermarket
)
{
String
scriptSourceInit
=
"webviewDidFocusRefresh("
+
String
.
valueOf
(
mWebviewSupermarket
)
+
");"
;
WarpView
.
this
.
evaluateJavascript
(
scriptSourceInit
,
s
->
{
});
mWebviewSupermarket
=
false
;
}
}
@Override
...
...
@@ -481,9 +473,9 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
if
(
message
.
contains
(
"event"
))
{
String
[]
parts
=
message
.
split
(
":"
);
if
(
parts
[
1
].
equals
(
"webviewRefresh"
))
{
mWebviewSupermarket
=
true
;
WarpViewActivity
.
setWebviewSupermarket
(
true
)
;
}
else
if
(
parts
[
1
].
equals
(
"closeArtwork"
))
{
mWebviewSupermarket
=
false
;
WarpViewActivity
.
setWebviewSupermarket
(
false
)
;
QuestionnaireEventModel
questionnaireEvent
=
new
QuestionnaireEventModel
();
questionnaireEvent
.
setName
(
parts
[
1
]);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
questionnaireEvent
));
...
...
Please
register
or
login
to post a comment