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-12-07 15:49:48 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6c31e73414145c68353c8bb1dd7f7a7285083ab7
6c31e734
1 parent
78dfd254
crash fixes
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
37 additions
and
66 deletions
.idea/misc.xml
app/src/main/java/warp/ly/android_sdk/activities/BaseActivity.java
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BaseFragmentActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/volley/RequestQueue.java
warply_android_sdk/src/main/java/ly/warp/sdk/receivers/BluetoothStateChangeReceiver.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyProvider.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyAnalyticsManager.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplySessionManager.java
.idea/misc.xml
View file @
6c31e73
...
...
@@ -102,7 +102,7 @@
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_active_rewards.xml"
value=
"0.358695652173913"
/>
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_base_fragment.xml"
value=
"0.25"
/>
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_bill_payment.xml"
value=
"0.358695652173913"
/>
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_contextual.xml"
value=
"0.
36666666666666664
"
/>
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_contextual.xml"
value=
"0.
22
"
/>
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_coupon_gift.xml"
value=
"0.36666666666666664"
/>
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_coupon_info.xml"
value=
"0.33"
/>
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_coupon_share.xml"
value=
"0.36666666666666664"
/>
...
...
app/src/main/java/warp/ly/android_sdk/activities/BaseActivity.java
View file @
6c31e73
package
warp
.
ly
.
android_sdk
.
activities
;
import
android.os.Bundle
;
import
androidx.fragment.app.FragmentActivity
;
import
android.widget.Toast
;
import
ly.warp.sdk.utils.managers.WarplySessionManager
;
import
androidx.fragment.app.FragmentActivity
;
public
abstract
class
BaseActivity
extends
FragmentActivity
{
...
...
warply_android_sdk/build.gradle
View file @
6c31e73
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4.6rc3
1
'
PUBLISH_VERSION
=
'4.5.4.6rc3
3
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BaseFragmentActivity.java
View file @
6c31e73
package
ly
.
warp
.
sdk
.
activities
;
import
android.app.Dialog
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Looper
;
import
android.view.MenuItem
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
androidx.annotation.NonNull
;
...
...
@@ -28,10 +23,7 @@ import ly.warp.sdk.io.models.CampaignList;
import
ly.warp.sdk.io.models.Consumer
;
import
ly.warp.sdk.io.models.CouponList
;
import
ly.warp.sdk.io.request.WarplyGetCampaignsRequest
;
import
ly.warp.sdk.io.request.WarplyUserCouponsRequest
;
import
ly.warp.sdk.utils.WarplyManagerHelper
;
import
ly.warp.sdk.utils.managers.WarplyManager
;
import
ly.warp.sdk.utils.managers.WarplySessionManager
;
public
class
BaseFragmentActivity
extends
FragmentActivity
implements
NavigationBarView
.
OnItemSelectedListener
{
...
...
@@ -45,8 +37,6 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
private
BottomNavigationView
mBottomNavigationView
;
private
Fragment
mFragmentToSet
=
null
;
private
static
Consumer
mConsumer
;
private
static
HashMap
<
String
,
CampaignList
>
mUniqueCampaignList
=
new
HashMap
<
String
,
CampaignList
>();
// ===========================================================
// Methods for/from SuperClass/Interfaces
...
...
@@ -105,27 +95,6 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
// Methods
// ===========================================================
private
void
showDialog
(
String
parameter
)
{
Dialog
dialog
=
new
Dialog
(
this
,
R
.
style
.
PopUpDialog
);
dialog
.
setContentView
(
R
.
layout
.
dl_dialog
);
dialog
.
getWindow
().
setBackgroundDrawableResource
(
R
.
drawable
.
banner_border_white
);
dialog
.
show
();
TextView
mTvDlTitle
=
dialog
.
findViewById
(
R
.
id
.
tv_dl_subtitle
);
LinearLayout
mLlRedeem
=
dialog
.
findViewById
(
R
.
id
.
ll_dl_redeem
);
mTvDlTitle
.
setText
(
String
.
format
(
getResources
().
getString
(
R
.
string
.
cos_dl_title
),
parameter
));
mLlRedeem
.
setOnClickListener
(
view
->
{
if
(
mUniqueCampaignList
!=
null
&&
!
mUniqueCampaignList
.
isEmpty
())
{
if
(
mUniqueCampaignList
.
containsKey
(
"lucky_draw"
)
&&
mUniqueCampaignList
.
get
(
"lucky_draw"
).
size
()
>
0
)
{
startActivity
(
WarpViewActivity
.
createIntentFromURL
(
this
,
WarplyManagerHelper
.
constructCampaignUrl
(
mUniqueCampaignList
.
get
(
"lucky_draw"
).
get
(
0
))));
dialog
.
dismiss
();
}
}
});
}
private
void
initViews
()
{
mBottomNavigationView
.
setOnItemSelectedListener
(
this
);
mFragmentToSet
=
HomeFragment
.
newInstance
();
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/volley/RequestQueue.java
View file @
6c31e73
...
...
@@ -129,17 +129,21 @@ public class RequestQueue {
* Starts the dispatchers in this queue.
*/
public
void
start
()
{
stop
();
// Make sure any currently running dispatchers are stopped.
// Create the cache dispatcher and start it.
mCacheDispatcher
=
new
CacheDispatcher
(
mCacheQueue
,
mNetworkQueue
,
mCache
,
mDelivery
);
mCacheDispatcher
.
start
();
// Create network dispatchers (and corresponding threads) up to the pool size.
for
(
int
i
=
0
;
i
<
mDispatchers
.
length
;
i
++)
{
NetworkDispatcher
networkDispatcher
=
new
NetworkDispatcher
(
mNetworkQueue
,
mNetwork
,
mCache
,
mDelivery
);
mDispatchers
[
i
]
=
networkDispatcher
;
networkDispatcher
.
start
();
try
{
stop
();
// Make sure any currently running dispatchers are stopped.
// Create the cache dispatcher and start it.
mCacheDispatcher
=
new
CacheDispatcher
(
mCacheQueue
,
mNetworkQueue
,
mCache
,
mDelivery
);
mCacheDispatcher
.
start
();
// Create network dispatchers (and corresponding threads) up to the pool size.
for
(
int
i
=
0
;
i
<
mDispatchers
.
length
;
i
++)
{
NetworkDispatcher
networkDispatcher
=
new
NetworkDispatcher
(
mNetworkQueue
,
mNetwork
,
mCache
,
mDelivery
);
mDispatchers
[
i
]
=
networkDispatcher
;
networkDispatcher
.
start
();
}
}
catch
(
OutOfMemoryError
e
)
{
stop
();
}
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/receivers/BluetoothStateChangeReceiver.java
View file @
6c31e73
...
...
@@ -37,7 +37,7 @@ public class BluetoothStateChangeReceiver extends BroadcastReceiver {
if
(!
Warply
.
isInitialized
())
{
Warply
.
getInitializer
(
context
).
init
();
}
Warply
.
INSTANCE
.
initBeaconsApplicationIfNeed
();
Warply
.
initBeaconsApplicationIfNeed
();
break
;
default
:
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyProvider.java
View file @
6c31e73
...
...
@@ -20,8 +20,6 @@ import ly.warp.sdk.R;
*/
public
class
WarplyProvider
extends
ContentProvider
{
private
static
Typeface
PF_BOLD
;
@Override
public
boolean
onCreate
()
{
ViewPump
.
init
(
ViewPump
.
builder
()
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyAnalyticsManager.java
View file @
6c31e73
...
...
@@ -304,6 +304,8 @@ public class WarplyAnalyticsManager {
* @param eventId Event ID
*/
private
static
void
sendLifecycleEvent
(
String
eventPage
,
String
eventId
)
{
if
(
getWarplyContext
()
==
null
)
return
;
boolean
isLifecycleAnalyticsMicroAppActive
=
WarpUtils
.
getIsLIFECYCLEANALYTICSENABLED
(
getWarplyContext
());
if
(!
isLifecycleAnalyticsMicroAppActive
)
{
WarpUtils
.
log
(
"session analytics micro-app is not active"
);
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplySessionManager.java
View file @
6c31e73
...
...
@@ -42,8 +42,8 @@ import android.net.ConnectivityManager;
import
android.net.NetworkInfo
;
public
class
WarplySessionManager
{
private
final
static
HashSet
<
Activity
>
_activities
=
new
HashSet
<
Activity
>();
private
static
ConnectivityReceiver
_receiver
;
//
private final static HashSet<Activity> _activities = new HashSet<Activity>();
//
private static ConnectivityReceiver _receiver;
/**
* Must be called in <b>every</b> Activity's onCreate method, in order to
...
...
@@ -53,12 +53,12 @@ public class WarplySessionManager {
* @param activity The Activity that was started
*/
public
static
void
onCreateActivity
(
Activity
activity
)
{
synchronized
(
_activities
)
{
//
synchronized (_activities) {
Warply
.
getInitializer
(
activity
).
init
();
_activities
.
add
(
activity
);
if
(
_activities
.
size
()
==
1
)
//
_activities.add(activity);
//
if (_activities.size() == 1)
onApplicationStart
();
}
//
}
}
/**
...
...
@@ -73,12 +73,12 @@ public class WarplySessionManager {
* @param activity The Activity that was started
*/
public
static
void
onStartActivity
(
Activity
activity
)
{
synchronized
(
_activities
)
{
//
Warply.getInitializer(activity).init();
_activities
.
add
(
activity
);
if
(
_activities
.
size
()
==
1
)
//
synchronized (_activities) {
Warply
.
getInitializer
(
activity
).
init
();
//
_activities.add(activity);
//
if (_activities.size() == 1)
onApplicationEnterForeground
();
}
//
}
}
/**
...
...
@@ -93,11 +93,12 @@ public class WarplySessionManager {
* @param activity The Activity that was stopped
*/
public
static
void
onStopActivity
(
Activity
activity
)
{
synchronized
(
_activities
)
{
_activities
.
remove
(
activity
);
if
(
_activities
.
size
()
==
0
)
// synchronized (_activities) {
Warply
.
getInitializer
(
activity
).
init
();
// _activities.remove(activity);
// if (_activities.size() == 0)
onApplicationEnterBackground
();
}
//
}
}
private
static
void
onApplicationStart
()
{
...
...
Please
register
or
login
to post a comment