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
2022-03-29 18:11:41 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c22206854ad62de8d7fe351073cead23fca9b2e3
c2220685
1 parent
d3851102
post message from campaign
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
22 deletions
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BaseFragmentActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/fragments/HomeFragment.java
warply_android_sdk/src/main/java/ly/warp/sdk/fragments/LoyaltyFragment.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/WarpView.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BaseFragmentActivity.java
View file @
c222068
...
...
@@ -70,20 +70,6 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
WarplyManager
.
getConsumer
(
new
WarplyConsumerRequest
(),
mConsumerReceiver
);
}
}).
start
();
// new Thread(() -> {
// if (!Thread.currentThread().isInterrupted()) {
// Warply.getInbox(new WarplyInboxRequest().setUseCache(false), mInboxReceiver);
// }
// }).start();
//
// new Thread(() -> {
// if (!Thread.currentThread().isInterrupted()) {
// WarplyManager.getUserCoupons(new WarplyUserCouponsRequest(), mUserCouponsReceiver);
// }
// }).start();
// initViews();
}
@Override
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/fragments/HomeFragment.java
View file @
c222068
...
...
@@ -81,13 +81,13 @@ public class HomeFragment extends Fragment implements View.OnClickListener {
mRecyclerCampaigns
.
setAdapter
(
mAdapterCampaigns
);
mAdapterCampaigns
.
getPositionClicks
()
.
doOnNext
(
campaign
->
{
String
tempUrl
=
BaseFragmentActivity
.
getUniqueCampaignList
().
get
(
"lucky_draw"
).
get
(
0
)
.
getIndexUrl
();
String
tempUrl
=
campaign
.
getIndexUrl
();
tempUrl
=
tempUrl
+
"?web_id="
+
WarpUtils
.
getWebId
(
getContext
())
+
"&app_uuid="
+
WarplyProperty
.
getAppUuid
(
getContext
())
+
"&api_key="
+
WarpUtils
.
getApiKey
(
getContext
())
+
"&session_uuid="
+
BaseFragmentActivity
.
getUniqueCampaignList
().
get
(
"lucky_draw"
).
get
(
0
)
.
getSessionUUID
()
+
"&session_uuid="
+
campaign
.
getSessionUUID
()
+
"&access_token="
+
WarplyDBHelper
.
getInstance
(
getContext
()).
getAuthValue
(
"access_token"
)
+
"&refresh_token="
+
WarplyDBHelper
.
getInstance
(
getContext
()).
getAuthValue
(
"refresh_token"
)
+
"&client_id="
+
WarplyDBHelper
.
getInstance
(
getContext
()).
getClientValue
(
"client_id"
)
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/fragments/LoyaltyFragment.java
View file @
c222068
...
...
@@ -73,13 +73,13 @@ public class LoyaltyFragment extends Fragment implements View.OnClickListener {
mRecyclerDeals
.
setAdapter
(
mAdapterDeals
);
mAdapterDeals
.
getPositionClicks
()
.
doOnNext
(
deal
->
{
String
tempUrl
=
BaseFragmentActivity
.
getUniqueCampaignList
().
get
(
"lucky_draw"
).
get
(
0
)
.
getIndexUrl
();
String
tempUrl
=
deal
.
getIndexUrl
();
tempUrl
=
tempUrl
+
"?web_id="
+
WarpUtils
.
getWebId
(
getContext
())
+
"&app_uuid="
+
WarplyProperty
.
getAppUuid
(
getContext
())
+
"&api_key="
+
WarpUtils
.
getApiKey
(
getContext
())
+
"&session_uuid="
+
BaseFragmentActivity
.
getUniqueCampaignList
().
get
(
"lucky_draw"
).
get
(
0
)
.
getSessionUUID
()
+
"&session_uuid="
+
deal
.
getSessionUUID
()
+
"&access_token="
+
WarplyDBHelper
.
getInstance
(
getContext
()).
getAuthValue
(
"access_token"
)
+
"&refresh_token="
+
WarplyDBHelper
.
getInstance
(
getContext
()).
getAuthValue
(
"refresh_token"
)
+
"&client_id="
+
WarplyDBHelper
.
getInstance
(
getContext
()).
getClientValue
(
"client_id"
)
...
...
@@ -102,13 +102,13 @@ public class LoyaltyFragment extends Fragment implements View.OnClickListener {
mRecyclerGifts
.
setAdapter
(
mAdapterGifts
);
mAdapterGifts
.
getPositionClicks
()
.
doOnNext
(
gift
->
{
String
tempUrl
=
BaseFragmentActivity
.
getUniqueCampaignList
().
get
(
"lucky_draw"
).
get
(
0
)
.
getIndexUrl
();
String
tempUrl
=
gift
.
getIndexUrl
();
tempUrl
=
tempUrl
+
"?web_id="
+
WarpUtils
.
getWebId
(
getContext
())
+
"&app_uuid="
+
WarplyProperty
.
getAppUuid
(
getContext
())
+
"&api_key="
+
WarpUtils
.
getApiKey
(
getContext
())
+
"&session_uuid="
+
BaseFragmentActivity
.
getUniqueCampaignList
().
get
(
"lucky_draw"
).
get
(
0
)
.
getSessionUUID
()
+
"&session_uuid="
+
gift
.
getSessionUUID
()
+
"&access_token="
+
WarplyDBHelper
.
getInstance
(
getContext
()).
getAuthValue
(
"access_token"
)
+
"&refresh_token="
+
WarplyDBHelper
.
getInstance
(
getContext
()).
getAuthValue
(
"refresh_token"
)
+
"&client_id="
+
WarplyDBHelper
.
getInstance
(
getContext
()).
getClientValue
(
"client_id"
)
...
...
@@ -131,13 +131,13 @@ public class LoyaltyFragment extends Fragment implements View.OnClickListener {
mRecyclerMore
.
setAdapter
(
mAdapterMore
);
mAdapterMore
.
getPositionClicks
()
.
doOnNext
(
more
->
{
String
tempUrl
=
BaseFragmentActivity
.
getUniqueCampaignList
().
get
(
"lucky_draw"
).
get
(
0
)
.
getIndexUrl
();
String
tempUrl
=
more
.
getIndexUrl
();
tempUrl
=
tempUrl
+
"?web_id="
+
WarpUtils
.
getWebId
(
getContext
())
+
"&app_uuid="
+
WarplyProperty
.
getAppUuid
(
getContext
())
+
"&api_key="
+
WarpUtils
.
getApiKey
(
getContext
())
+
"&session_uuid="
+
BaseFragmentActivity
.
getUniqueCampaignList
().
get
(
"lucky_draw"
).
get
(
0
)
.
getSessionUUID
()
+
"&session_uuid="
+
more
.
getSessionUUID
()
+
"&access_token="
+
WarplyDBHelper
.
getInstance
(
getContext
()).
getAuthValue
(
"access_token"
)
+
"&refresh_token="
+
WarplyDBHelper
.
getInstance
(
getContext
()).
getAuthValue
(
"refresh_token"
)
+
"&client_id="
+
WarplyDBHelper
.
getInstance
(
getContext
()).
getClientValue
(
"client_id"
)
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/WarpView.java
View file @
c222068
...
...
@@ -40,7 +40,9 @@ import androidx.core.content.ContextCompat;
import
android.text.TextUtils
;
import
android.util.AttributeSet
;
import
android.util.Log
;
import
android.webkit.GeolocationPermissions.Callback
;
import
android.webkit.JavascriptInterface
;
import
android.webkit.SslErrorHandler
;
import
android.webkit.WebChromeClient
;
import
android.webkit.WebSettings
;
...
...
@@ -124,6 +126,7 @@ public class WarpView extends WebView {
settings
.
setGeolocationDatabasePath
(
getContext
().
getCacheDir
().
getAbsolutePath
());
settings
.
setGeolocationEnabled
(
true
);
settings
.
setBuiltInZoomControls
(
true
);
WarpView
.
this
.
addJavascriptInterface
(
new
JSInterface
(),
"Cosmote"
);
setBackgroundColor
(
ContextCompat
.
getColor
(
getContext
(),
android
.
R
.
color
.
transparent
));
setWebViewClient
(
new
WarplyWebViewClient
());
setWebChromeClient
(
new
WarplyWebChromeClient
());
...
...
@@ -356,6 +359,16 @@ public class WarpView extends WebView {
// Inner and Anonymous Classes
// ===========================================================
public
class
JSInterface
{
@JavascriptInterface
public
void
sendMessage
(
String
message
)
{
Intent
intent
=
new
Intent
(
android
.
content
.
Intent
.
ACTION_SEND
);
intent
.
setType
(
"text/plain"
);
intent
.
putExtra
(
android
.
content
.
Intent
.
EXTRA_TEXT
,
message
);
getContext
().
startActivity
(
Intent
.
createChooser
(
intent
,
"Άνοιγμα με"
));
}
}
public
interface
ProgressChangeListener
{
void
onProgressChanged
(
WebView
view
,
int
newProgress
);
}
...
...
Please
register
or
login
to post a comment