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-07-26 18:06:28 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
81e9312219e2959c4f5f8468ef2c1cb2a97492dc
81e93122
1 parent
ee6ee87a
new gradle, fixes for new gradle
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
14 additions
and
2297 deletions
.idea/deploymentTargetDropDown.xml
app/build.gradle
app/src/main/AndroidManifest.xml
build.gradle
gradle/wrapper/gradle-wrapper.properties
scripts/publish-module.gradle
warply_android_sdk/build.gradle
warply_android_sdk/src/main/AndroidManifest.xml
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyWallet.java
warply_android_sdk/src/main/java/ly/warp/sdk/services/UpdateUserLocationService.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyLocationManager.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/CampaignItemWebHolder.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/CampaignViewLoader.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/WarpView.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/CampaignsArrayAdapter.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/mix/CampaignsMixListAdapter.java
warply_android_sdk/src/main/res/layout/activity_loyalty_wallet.xml
warply_android_sdk/src/main/res/values/attrs.xml
.idea/deploymentTargetDropDown.xml
View file @
81e9312
...
...
@@ -15,7 +15,7 @@
</deviceKey>
</Target>
</runningDeviceTargetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown
value=
"2024-07-26T1
3:26:33.140020
Z"
/>
<timeTargetWasSelectedWithDropDown
value=
"2024-07-26T1
4:53:01.900442
Z"
/>
</State>
</entry>
</value>
...
...
app/build.gradle
View file @
81e9312
...
...
@@ -3,6 +3,7 @@ apply plugin: 'com.android.application'
//apply plugin: 'com.huawei.agconnect'
android
{
namespace
"warp.ly.android_sdk"
compileSdkVersion
34
buildToolsVersion
"34.0.0"
...
...
app/src/main/AndroidManifest.xml
View file @
81e9312
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"warp.ly.android_sdk"
>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
...
...
build.gradle
View file @
81e9312
...
...
@@ -8,7 +8,7 @@ buildscript {
maven
{
url
'https://plugins.gradle.org/m2/'
}
}
dependencies
{
classpath
'com.android.tools.build:gradle:
7.1.3
'
classpath
'com.android.tools.build:gradle:
8.1.4
'
classpath
'com.google.gms:google-services:4.3.10'
classpath
'com.huawei.agconnect:agcp:1.7.2.300'
classpath
'io.github.gradle-nexus:publish-plugin:1.1.0'
...
...
gradle/wrapper/gradle-wrapper.properties
View file @
81e9312
#Fri Jul 26 17:08:44 EEST 2024
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-
7.2
-bin.zip
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-
8.0
-bin.zip
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
...
...
scripts/publish-module.gradle
View file @
81e9312
...
...
@@ -32,7 +32,7 @@ afterEvaluate {
// Two artifacts, the `aar` (or `jar`) and the sources
if
(
project
.
plugins
.
findPlugin
(
"com.android.library"
))
{
from
components
.
release
from
components
.
findByName
(
'release'
)
}
else
{
from
components
.
java
}
...
...
warply_android_sdk/build.gradle
View file @
81e9312
...
...
@@ -9,7 +9,7 @@ ext {
apply
from:
"${rootProject.projectDir}/scripts/publish-module.gradle"
android
{
namespace
'ly.warp.sdk'
compileSdkVersion
34
buildToolsVersion
"34.0.0"
...
...
@@ -107,9 +107,6 @@ dependencies {
implementation
'com.squareup.retrofit2:retrofit:2.9.0'
implementation
'com.squareup.retrofit2:converter-gson:2.9.0'
//------------------------------ Expandable Layout -----------------------------//
api
'net.cachapa.expandablelayout:expandablelayout:2.9.2'
//------------------------------ Lifecycle -----------------------------//
implementation
"androidx.lifecycle:lifecycle-extensions:2.2.0"
...
...
warply_android_sdk/src/main/AndroidManifest.xml
View file @
81e9312
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
package=
"ly.warp.sdk"
>
xmlns:tools=
"http://schemas.android.com/tools"
>
<uses-permission
android:name=
"android.permission.ACCESS_FINE_LOCATION"
/>
<uses-permission
android:name=
"android.permission.ACCESS_COARSE_LOCATION"
/>
...
...
@@ -177,57 +176,6 @@
</intent-filter>
</activity>
<!-- Service used for updating user's location. -->
<service
android:name=
".services.UpdateUserLocationService"
android:exported=
"false"
android:permission=
"android.permission.BIND_JOB_SERVICE"
/>
<service
android:name=
".services.EventService"
android:exported=
"false"
android:permission=
"android.permission.BIND_JOB_SERVICE"
/>
<service
android:name=
".services.VouchersFetchedService"
android:exported=
"false"
android:permission=
"android.permission.BIND_JOB_SERVICE"
/>
<service
android:name=
".services.EventCouponsService"
android:exported=
"false"
android:permission=
"android.permission.BIND_JOB_SERVICE"
/>
<service
android:name=
".services.EventRewardsCouponsService"
android:exported=
"false"
android:permission=
"android.permission.BIND_JOB_SERVICE"
/>
<service
android:name=
".services.EventUnifiedCouponsService"
android:exported=
"false"
android:permission=
"android.permission.BIND_JOB_SERVICE"
/>
<service
android:name=
".services.EventCampaignCouponService"
android:exported=
"false"
android:permission=
"android.permission.BIND_JOB_SERVICE"
/>
<service
android:name=
".services.EventCampaignService"
android:exported=
"false"
android:permission=
"android.permission.BIND_JOB_SERVICE"
/>
<service
android:name=
".services.EventRefreshDeviceTokenService"
android:exported=
"false"
android:permission=
"android.permission.BIND_JOB_SERVICE"
/>
<service
android:name=
".services.EventQuestionnaireService"
android:exported=
"false"
android:permission=
"android.permission.BIND_JOB_SERVICE"
/>
<!-- android:stopWithTask="false"-->
<!-- android:process=":warplyHealthService"-->
<!-- <service-->
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyWallet.java
deleted
100644 → 0
View file @
ee6ee87
package
ly
.
warp
.
sdk
.
activities
;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.text.TextUtils
;
import
android.view.View
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.RelativeLayout
;
import
android.widget.ScrollView
;
import
android.widget.TextView
;
import
androidx.appcompat.app.AlertDialog
;
import
androidx.cardview.widget.CardView
;
import
androidx.constraintlayout.widget.ConstraintLayout
;
import
androidx.core.content.ContextCompat
;
import
androidx.core.widget.NestedScrollView
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.bumptech.glide.Glide
;
import
com.bumptech.glide.load.engine.DiskCacheStrategy
;
import
net.cachapa.expandablelayout.ExpandableLayout
;
import
org.apmem.tools.layouts.FlowLayout
;
import
org.greenrobot.eventbus.EventBus
;
import
org.greenrobot.eventbus.Subscribe
;
import
java.util.ArrayList
;
import
ly.warp.sdk.R
;
import
ly.warp.sdk.io.models.ActiveDFYCouponEventModel
;
import
ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel
;
import
ly.warp.sdk.io.models.UnifiedCoupon
;
import
ly.warp.sdk.io.models.VouchersActivityEventModel
;
import
ly.warp.sdk.io.models.WarplyDealsAnalysisEventModel
;
import
ly.warp.sdk.utils.WarpUtils
;
import
ly.warp.sdk.utils.WarplyManagerHelper
;
import
ly.warp.sdk.utils.managers.WarplyAnalyticsManager
;
import
ly.warp.sdk.utils.managers.WarplyEventBusManager
;
import
ly.warp.sdk.views.adapters.ActiveCouponAdapter
;
import
ly.warp.sdk.views.adapters.MarketCouponAdapter
;
public
class
LoyaltyWallet
extends
Activity
implements
View
.
OnClickListener
,
View
.
OnScrollChangeListener
{
// ===========================================================
// Constants
// ===========================================================
// ===========================================================
// Fields
// ===========================================================
private
ImageView
mIvBack
,
mIvDealsLogo
,
mIvProfilePhoto
,
mIvExpArrow
;
private
TextView
mTvUsername
,
mTvDealsValue
,
mTvDealsValueAll
,
mTvUserBadge
,
mTvGiftsValue
,
mTvGiftsValueAll
,
mTvActiveCode
,
mTvActiveDate
,
mTvActiveTitle
,
mTvActiveCouponsHeader
,
mTvMarketValue
,
mTvMarketAll
,
mTvFavValue
,
mTvFavValueAll
,
mTvDealsCountBadge
,
mTvUnifiedCountBadge
,
mTvGiftsCountBadge
,
mTvVouchersDisabledTitle
,
mTvVouchersDisabledSubtitle
,
mTvVouchersTitle
,
mTvVouchersSubtitle
;
private
ConstraintLayout
mClDealsBanner
,
mClDealsView
,
mClGiftsBanner
,
mClToolbar
,
mClMarket
;
private
LinearLayout
mLlQuestionnaire
,
mLlUserBadge
,
mLlEmptyWallet
,
mLlDeals
,
mLlGifts
,
mLlMarketView
,
mLlHistory
,
mLlBannerInfo
,
mLlVouchers
,
mLlVouchersSpinner
,
mLlVouchersDisabled
;
private
FlowLayout
mLlActiveCodesView
;
private
float
couponDfyValue
=
0.0f
,
mFavValue
=
0.0f
;
private
RecyclerView
mRecyclerCoupons
,
mRvMarketCoupons
;
private
ActiveCouponAdapter
mAdapterCoupons
;
private
AlertDialog
mAlertDialogNonTelco
,
mAlertDialogVouchersService
;
private
ScrollView
mScActiveCodes
;
private
NestedScrollView
mSvLoyaltyWallet
;
private
int
mTimer
=
0
;
private
Handler
mSecondsHandler
;
private
ArrayList
<
UnifiedCoupon
>
mUnifiedCoupons
=
new
ArrayList
<
UnifiedCoupon
>();
private
float
countValue
=
0.0f
;
private
MarketCouponAdapter
mAdapterMarketCoupons
;
private
ExpandableLayout
mElGifts
;
private
boolean
mIsStayCollapsed
=
true
;
private
CardView
mClExp
,
mCvVouchers
,
mCvVouchersDisabled
;
private
boolean
mDfyPressed
=
false
,
mDealsBannerPressed
=
false
,
mQuestionnairePressed
=
false
,
mHistoryPressed
=
false
,
mHistoryMarketPressed
=
false
,
mUnifiedPressed
=
false
,
mCouponPressed
=
false
,
mHistoryBadgePressed
=
false
,
mUnifiedCountPressed
=
false
,
mGiftsCountPressed
=
false
;
private
RelativeLayout
mRlDeals
,
mRlUnified
,
mRlGifts
;
private
View
mSeparator
,
mSeparatorDisabled
;
// ===========================================================
// Methods for/from SuperClass/Interfaces
// ===========================================================
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_loyalty_wallet
);
mSecondsHandler
=
new
Handler
();
mIvBack
=
findViewById
(
R
.
id
.
iv_back
);
mTvUsername
=
findViewById
(
R
.
id
.
tv_profile_name
);
mLlQuestionnaire
=
findViewById
(
R
.
id
.
ll_user_questionnaire
);
mLlUserBadge
=
findViewById
(
R
.
id
.
ll_user_badge
);
mTvUserBadge
=
findViewById
(
R
.
id
.
tv_type
);
mTvGiftsValue
=
findViewById
(
R
.
id
.
tv_gifts_value
);
mTvGiftsValueAll
=
findViewById
(
R
.
id
.
tv_gifts_value_all
);
mClDealsBanner
=
findViewById
(
R
.
id
.
cl_deals_win_inner_cos
);
mClGiftsBanner
=
findViewById
(
R
.
id
.
cl_deals_win_inner
);
mTvDealsValue
=
findViewById
(
R
.
id
.
tv_deals_value
);
mTvDealsValueAll
=
findViewById
(
R
.
id
.
tv_deals_value_all
);
mTvActiveCode
=
findViewById
(
R
.
id
.
tv_active_deals_text
);
mTvActiveDate
=
findViewById
(
R
.
id
.
tv_active_deals_date_text
);
mIvDealsLogo
=
findViewById
(
R
.
id
.
dfy_logo
);
mClDealsView
=
findViewById
(
R
.
id
.
cl_mygifts
);
mLlDeals
=
findViewById
(
R
.
id
.
ll_mygifts
);
mIvProfilePhoto
=
findViewById
(
R
.
id
.
iv_profile_photo
);
mTvActiveTitle
=
findViewById
(
R
.
id
.
tv_active_gifts
);
mTvActiveCouponsHeader
=
findViewById
(
R
.
id
.
tv_active_coupons_header
);
mLlEmptyWallet
=
findViewById
(
R
.
id
.
ll_empty_wallet
);
mLlActiveCodesView
=
findViewById
(
R
.
id
.
ll_active_deals_codes_view
);
mScActiveCodes
=
findViewById
(
R
.
id
.
sv_active_deals_codes_view
);
mSvLoyaltyWallet
=
findViewById
(
R
.
id
.
sv_loyalty_wallet
);
mClToolbar
=
findViewById
(
R
.
id
.
cl_loyalty_wallet_header
);
mLlGifts
=
findViewById
(
R
.
id
.
ll_gifts_view
);
mLlMarketView
=
findViewById
(
R
.
id
.
ll_market_view
);
mRvMarketCoupons
=
findViewById
(
R
.
id
.
rv_market_coupons
);
mRvMarketCoupons
.
setNestedScrollingEnabled
(
false
);
mRvMarketCoupons
.
setLayoutManager
(
new
LinearLayoutManager
(
this
,
LinearLayoutManager
.
VERTICAL
,
false
));
mElGifts
=
findViewById
(
R
.
id
.
el_exp
);
mClExp
=
findViewById
(
R
.
id
.
cl_exp
);
mIvExpArrow
=
findViewById
(
R
.
id
.
iv_exp_arrow
);
mTvMarketValue
=
findViewById
(
R
.
id
.
tv_market_value
);
mTvMarketAll
=
findViewById
(
R
.
id
.
tv_market_value_all
);
mClMarket
=
findViewById
(
R
.
id
.
cl_market_inner
);
mTvFavValue
=
findViewById
(
R
.
id
.
tv_exp_value
);
mTvFavValueAll
=
findViewById
(
R
.
id
.
tv_exp_value_all
);
mLlHistory
=
findViewById
(
R
.
id
.
ll_loyalty_history
);
mTvDealsCountBadge
=
findViewById
(
R
.
id
.
tv_deals_count
);
mTvUnifiedCountBadge
=
findViewById
(
R
.
id
.
tv_sm_count
);
mTvGiftsCountBadge
=
findViewById
(
R
.
id
.
tv_gifts_count
);
mLlBannerInfo
=
findViewById
(
R
.
id
.
ll_banner_info_new
);
mRlDeals
=
findViewById
(
R
.
id
.
rv_deals_count
);
mRlUnified
=
findViewById
(
R
.
id
.
rv_sm_count
);
mRlGifts
=
findViewById
(
R
.
id
.
rv_gifts_count
);
mRecyclerCoupons
=
findViewById
(
R
.
id
.
rv_active_coupons
);
mCvVouchers
=
findViewById
(
R
.
id
.
cv_vouchers
);
mCvVouchersDisabled
=
findViewById
(
R
.
id
.
cv_vouchers_disabled
);
mLlVouchers
=
findViewById
(
R
.
id
.
ll_vouchers
);
mLlVouchersDisabled
=
findViewById
(
R
.
id
.
ll_vouchers_disabled
);
mLlVouchersSpinner
=
findViewById
(
R
.
id
.
ll_vouchers_spinner
);
mSeparator
=
findViewById
(
R
.
id
.
v_separator_vouchers
);
mSeparatorDisabled
=
findViewById
(
R
.
id
.
v_separator_vouchers_disabled
);
mTvVouchersDisabledTitle
=
findViewById
(
R
.
id
.
tv_vouchers_title_disabled
);
mTvVouchersDisabledSubtitle
=
findViewById
(
R
.
id
.
tv_vouchers_info_title_disabled
);
mTvVouchersTitle
=
findViewById
(
R
.
id
.
tv_vouchers_title
);
mTvVouchersSubtitle
=
findViewById
(
R
.
id
.
tv_vouchers_info_title
);
/** Deals Badge */
// if (WarplyManagerHelper.getActiveDFYCoupons() != null) {
// Collections.sort(WarplyManagerHelper.getActiveDFYCoupons(), new Comparator<ActiveDFYCouponModel>() {
// public int compare(ActiveDFYCouponModel o1, ActiveDFYCouponModel o2) {
// return o1.getDate().compareTo(o2.getDate());
// }
// });
// }
/** Deals Badge */
}
@Override
protected
void
onStart
()
{
super
.
onStart
();
if
(!
EventBus
.
getDefault
().
isRegistered
(
this
))
EventBus
.
getDefault
().
register
(
this
);
}
@Override
protected
void
onStop
()
{
super
.
onStop
();
// EventBus.getDefault().unregister(this);
}
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
WarplyManagerHelper
.
clearShowVouchersBanner
();
EventBus
.
getDefault
().
unregister
(
this
);
}
@Override
public
void
onResume
()
{
super
.
onResume
();
WarplyAnalyticsManager
.
logTrackersEvent
(
this
,
"screen"
,
"LoyaltyWalletScreen"
);
mTimer
=
0
;
mSecondsHandler
.
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
mTimer
++;
mSecondsHandler
.
postDelayed
(
this
,
1000
);
}
});
mDfyPressed
=
false
;
mDealsBannerPressed
=
false
;
mQuestionnairePressed
=
false
;
mHistoryPressed
=
false
;
mHistoryMarketPressed
=
false
;
mUnifiedPressed
=
false
;
mCouponPressed
=
false
;
mHistoryBadgePressed
=
false
;
mGiftsCountPressed
=
false
;
mUnifiedCountPressed
=
false
;
initViews
();
}
@Override
public
void
onPause
()
{
super
.
onPause
();
if
(
mSecondsHandler
!=
null
)
{
mSecondsHandler
.
removeCallbacksAndMessages
(
null
);
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"time_spent_on_loyalty_sdk"
);
analyticsEvent
.
setParameter
(
"name"
,
"MyRewards"
);
analyticsEvent
.
setParameter
(
"seconds"
,
String
.
valueOf
(
mTimer
));
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
}
}
@Override
public
void
onClick
(
View
view
)
{
if
(
view
.
getId
()
==
R
.
id
.
iv_back
)
{
onBackPressed
();
return
;
}
if
(
view
.
getId
()
==
R
.
id
.
ll_user_questionnaire
||
view
.
getId
()
==
R
.
id
.
ll_user_badge
)
{
if
(!
WarplyManagerHelper
.
noInternetDialog
(
this
,
true
))
{
WarplyManagerHelper
.
noInternetDialog
(
this
);
return
;
}
if
(!
mQuestionnairePressed
)
{
mQuestionnairePressed
=
true
;
WarplyAnalyticsManager
.
logTrackersEvent
(
this
,
"click"
,
(
"LoyaltyWalletScreen"
)
.
concat
(
":"
)
.
concat
(
"Questionnaire"
));
startActivityForResult
(
WarpViewActivity
.
createIntentFromURL
(
LoyaltyWallet
.
this
,
WarplyManagerHelper
.
openQuestionnaire
()),
1000
);
}
return
;
}
/** Deals History */
if
(
view
.
getId
()
==
R
.
id
.
cl_deals_win_inner_cos
)
{
if
(!
mDealsBannerPressed
)
{
mDealsBannerPressed
=
true
;
WarplyAnalyticsManager
.
logTrackersEvent
(
this
,
"click"
,
(
"LoyaltyWalletScreen"
)
.
concat
(
":"
)
.
concat
(
"DealsBanner"
));
WarplyDealsAnalysisEventModel
warplyDealsAnalysisEventModel
=
new
WarplyDealsAnalysisEventModel
();
warplyDealsAnalysisEventModel
.
setPressed
(
true
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
warplyDealsAnalysisEventModel
));
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"did_tap_deals_for_you_badge"
);
analyticsEvent
.
setParameter
(
"screen"
,
"Loyalty Wallet"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
}
return
;
}
/** Active Unified Banner */
if
(
view
.
getId
()
==
R
.
id
.
rv_sm_count
)
{
if
(!
mUnifiedCountPressed
)
{
mUnifiedCountPressed
=
true
;
WarplyAnalyticsManager
.
logTrackersEvent
(
this
,
"click"
,
(
"LoyaltyWalletScreen"
)
.
concat
(
":"
)
.
concat
(
"ActiveMarketBanner"
));
// LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
// analyticsEvent.setEventName("did_tap_sm_deals_badge");
// analyticsEvent.setParameter("screen", "Loyalty Wallet");
// EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"did_tap_market_active_badge"
);
analyticsEvent
.
setParameter
(
"screen"
,
"Loyalty Wallet"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
Intent
intent
=
new
Intent
(
LoyaltyWallet
.
this
,
ActiveUnifiedCouponsActivity
.
class
);
startActivity
(
intent
);
}
return
;
}
/** Active Coupons Banner */
if
(
view
.
getId
()
==
R
.
id
.
rv_gifts_count
)
{
if
(!
mGiftsCountPressed
)
{
mGiftsCountPressed
=
true
;
WarplyAnalyticsManager
.
logTrackersEvent
(
this
,
"click"
,
(
"LoyaltyWalletScreen"
)
.
concat
(
":"
)
.
concat
(
"ActiveLoyaltyBanner"
));
// LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
// analyticsEvent.setEventName("did_tap_gifts_badge");
// analyticsEvent.setParameter("screen", "Loyalty Wallet");
// EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"did_tap_gifts_for_you_active_badge"
);
analyticsEvent
.
setParameter
(
"screen"
,
"Loyalty Wallet"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
Intent
intent
=
new
Intent
(
LoyaltyWallet
.
this
,
ActiveCouponsActivity
.
class
);
startActivity
(
intent
);
}
return
;
}
/** Coupons History */
if
(
view
.
getId
()
==
R
.
id
.
cl_deals_win_inner
)
{
if
(!
mHistoryPressed
)
{
mHistoryPressed
=
true
;
WarplyAnalyticsManager
.
logTrackersEvent
(
this
,
"click"
,
(
"LoyaltyWalletScreen"
)
.
concat
(
":"
)
.
concat
(
"LoyaltyBanner"
));
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"did_tap_gifts_for_you_badge"
);
analyticsEvent
.
setParameter
(
"screen"
,
"Loyalty Wallet"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
Intent
intent
=
new
Intent
(
LoyaltyWallet
.
this
,
LoyaltyAnalysisActivity
.
class
);
startActivity
(
intent
);
}
return
;
}
if
(
view
.
getId
()
==
R
.
id
.
cl_exp
)
{
if
(!
mIsStayCollapsed
)
{
mElGifts
.
toggle
(
true
);
if
(
mElGifts
.
isExpanded
())
{
mIvExpArrow
.
setImageDrawable
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
ic_up_dark_new
));
}
else
{
mIvExpArrow
.
setImageDrawable
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
ic_down_dark_new
));
}
}
return
;
}
/** Unified History */
if
(
view
.
getId
()
==
R
.
id
.
cl_market_inner
)
{
if
(!
mHistoryMarketPressed
)
{
mHistoryMarketPressed
=
true
;
WarplyAnalyticsManager
.
logTrackersEvent
(
this
,
"click"
,
(
"LoyaltyWalletScreen"
)
.
concat
(
":"
)
.
concat
(
"MarketBanner"
));
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"did_tap_market_badge"
);
analyticsEvent
.
setParameter
(
"screen"
,
"Loyalty Wallet"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
Intent
intent
=
new
Intent
(
LoyaltyWallet
.
this
,
LoyaltyMarketAnalysisActivity
.
class
);
startActivity
(
intent
);
}
return
;
}
/** New History */
if
(
view
.
getId
()
==
R
.
id
.
ll_loyalty_history
)
{
if
(!
mHistoryBadgePressed
)
{
WarplyAnalyticsManager
.
logTrackersEvent
(
this
,
"click"
,
(
"LoyaltyWalletScreen"
)
.
concat
(
":"
)
.
concat
(
"LoyaltyHistoryBadge"
));
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"did_tap_history_badge"
);
analyticsEvent
.
setParameter
(
"screen"
,
"Loyalty Wallet"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
Intent
intent
=
new
Intent
(
LoyaltyWallet
.
this
,
LoyaltyHistoryActivity
.
class
);
startActivity
(
intent
);
}
return
;
}
/** Vouchers Client's Screen */
if
(
view
.
getId
()
==
R
.
id
.
cv_vouchers
||
view
.
getId
()
==
R
.
id
.
cv_vouchers_disabled
)
{
WarplyAnalyticsManager
.
logTrackersEvent
(
this
,
"click"
,
(
"LoyaltyWalletScreen"
)
.
concat
(
":"
)
.
concat
(
"VouchersBadge"
));
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"did_tap_vouchers_badge"
);
analyticsEvent
.
setParameter
(
"screen"
,
"Loyalty Wallet"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
VouchersActivityEventModel
vouchersActivity
=
new
VouchersActivityEventModel
();
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
vouchersActivity
));
return
;
}
/** Active Deals Banner */
if
(
view
.
getId
()
==
R
.
id
.
cl_mygifts
||
view
.
getId
()
==
R
.
id
.
rv_deals_count
)
{
if
(!
mDfyPressed
)
{
mDfyPressed
=
true
;
WarplyAnalyticsManager
.
logTrackersEvent
(
this
,
"click"
,
(
"LoyaltyWalletScreen"
)
.
concat
(
":"
)
.
concat
(
"ActiveDealsBanner"
));
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"did_tap_deals_for_you_active_badge"
);
analyticsEvent
.
setParameter
(
"screen"
,
"Loyalty Wallet"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
ActiveDFYCouponEventModel
activeCouponEventModel
=
new
ActiveDFYCouponEventModel
();
activeCouponEventModel
.
setPressed
(
true
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
activeCouponEventModel
));
}
}
}
@Override
public
void
onScrollChange
(
View
view
,
int
scrollX
,
int
scrollY
,
int
oldScrollX
,
int
oldScrollY
)
{
if
(
scrollY
>
oldScrollY
)
{
mClToolbar
.
setElevation
(
14
);
}
if
(
scrollY
<
oldScrollY
)
{
mClToolbar
.
setElevation
(
14
);
}
if
(
scrollY
==
0
)
{
mClToolbar
.
setElevation
(
0
);
}
}
@Override
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
Intent
data
)
{
if
(
requestCode
==
1000
)
{
if
(
resultCode
==
RESULT_OK
)
{
if
(!
TextUtils
.
isEmpty
(
WarplyManagerHelper
.
getUserTag
(
LoyaltyWallet
.
this
)))
{
mTvUserBadge
.
setText
(
WarplyManagerHelper
.
getUserTag
(
LoyaltyWallet
.
this
));
mLlQuestionnaire
.
setVisibility
(
View
.
GONE
);
mLlUserBadge
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
mLlUserBadge
.
setVisibility
(
View
.
GONE
);
mLlQuestionnaire
.
setVisibility
(
View
.
VISIBLE
);
}
}
}
}
@Subscribe
()
public
void
onMessageEvent
(
WarplyEventBusManager
event
)
{
if
(
event
.
getVouchersServiceUnavailableEventModel
()
!=
null
)
{
runOnUiThread
(
this
::
vouchersServiceUnavailableDialog
);
return
;
}
if
(
event
.
getVouchersFetched
()
!=
null
)
{
/** Vouchers */
runOnUiThread
(
this
::
checkForEmpty
);
/** Vouchers */
return
;
}
if
(
event
.
getUnifiedCouponsAdded
()
!=
null
)
{
/** Unified Coupons List */
// if (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() > 0) {
// ArrayList<UnifiedCoupon> tempCouponList = new ArrayList<UnifiedCoupon>();
// tempCouponList.addAll(WarplyManagerHelper.getMarketCouponsList());
//
// ArrayList<UnifiedCoupon> unilist = new ArrayList<UnifiedCoupon>();
// for (UnifiedCoupon unicpn : tempCouponList) {
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
// Date newDate = new Date();
// try {
// newDate = simpleDateFormat.parse(unicpn.getCreated());
// } catch (ParseException e) {
// e.printStackTrace();
// }
// unicpn.setExpirationDate(newDate);
// unilist.add(unicpn);
// }
//
// Collections.sort(unilist, (coupon1, coupon2) -> coupon2.getExpirationDate().compareTo(coupon1.getExpirationDate()));
//
// runOnUiThread(() -> {
// mAdapterMarketCoupons = new MarketCouponAdapter(this, unilist);
// mRvMarketCoupons.setAdapter(mAdapterMarketCoupons);
// mAdapterMarketCoupons.getPositionClicks()
// .doOnNext(coupon -> {
// if (!mUnifiedPressed) {
// mUnifiedPressed = true;
// WarplyAnalyticsManager.logTrackersEvent(this, "click", ("UnifiedCoupon").concat(":").concat(coupon.getBarcode()));
// Intent intent = new Intent(LoyaltyWallet.this, UnifiedCouponInfoActivity.class);
// intent.putExtra("coupon", (Serializable) coupon);
// intent.putExtra("isFromWallet", true);
// startActivity(intent);
// }
//// startActivityForResult(intent, 1002);
// })
// .doOnError(error -> {
// })
// .subscribe();
// mAdapterMarketCoupons.notifyDataSetChanged();
// mLlMarketView.setVisibility(View.VISIBLE);
//
// // Third Expandable Banner
// if (tempCouponList != null && tempCouponList.size() > 0) {
// countValue = 0.0f;
//
// if (WarplyManagerHelper.getCouponRedeemedList().size() > 0) {
// if (WarplyManagerHelper.getCouponsetsDeals().size() > 0) {
// for (Couponset couset : WarplyManagerHelper.getCouponsetsDeals()) {
// for (Coupon cou : WarplyManagerHelper.getCouponRedeemedList()) {
// if (cou.getCouponsetUuid().equals(couset.getUuid())) {
// countValue += Float.valueOf(cou.getDiscount());
// cou.setDescription(couset.getShortDescription());
// cou.setImage(couset.getImgPreview());
// cou.setName(couset.getName());
// cou.setMerchantUuid(couset.getMerchantUuid());
// cou.setInnerText(couset.getInnerText());
// cou.setDiscount_type(couset.getDiscount_type());
// cou.setFinal_price(couset.getFinal_price());
// break;
// }
// }
// }
// }
// }
//
// mFavValue += countValue;
// String badgeValue = String.format("%.02f", countValue);
// mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue));
// if (String.valueOf(countValue).length() >= 3) {
// mTvMarketValue.setTextSize(12);
// } else {
// mTvMarketValue.setTextSize(14);
// }
// SpannableStringBuilder sBuilderThird = new SpannableStringBuilder();
// sBuilderThird.append(String.format(getString(R.string.cos_supermarket_win), badgeValue));
// CalligraphyTypefaceSpan typefaceBoldSpanThird = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
// sBuilderThird.setSpan(typefaceBoldSpanThird, 15, 16 + badgeValue.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
// mTvMarketAll.setText(sBuilderThird, TextView.BufferType.SPANNABLE);
// } else {
// String badgeValue = String.format("%.02f", 0.0f);
// mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue));
// SpannableStringBuilder sBuilderThird = new SpannableStringBuilder();
// sBuilderThird.append(String.format(getString(R.string.cos_supermarket_win), badgeValue));
// CalligraphyTypefaceSpan typefaceBoldSpanThird = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
// sBuilderThird.setSpan(typefaceBoldSpanThird, 15, 16 + badgeValue.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
// mTvMarketAll.setText(sBuilderThird, TextView.BufferType.SPANNABLE);
// }
// });
// } else {
// runOnUiThread(() -> {
// mLlMarketView.setVisibility(View.GONE);
// });
// }
/** Unified Coupons List */
runOnUiThread
(()
->
{
if
(
WarplyManagerHelper
.
getMarketCouponsList
()
!=
null
&&
WarplyManagerHelper
.
getMarketCouponsList
().
size
()
>
0
)
mTvUnifiedCountBadge
.
setText
(
String
.
valueOf
(
WarplyManagerHelper
.
getMarketCouponsList
().
size
()));
else
mTvUnifiedCountBadge
.
setText
(
"0"
);
checkForEmpty
();
});
return
;
}
if
(
event
.
getCouponsAdded
()
!=
null
)
{
/** Coupons List */
// CouponList tempCouponList = new CouponList();
// CouponList cpnlist = new CouponList();
// tempCouponList.clear();
// tempCouponList.addAll(WarplyManagerHelper.getCouponList());
//
// for (Coupon cpn : tempCouponList) {
// if (cpn.getStatus() == 1) {
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
// Date newDate = new Date();
// try {
// newDate = simpleDateFormat.parse(cpn.getExpiration());
// } catch (ParseException e) {
// e.printStackTrace();
// }
// cpn.setExpirationDate(newDate);
// cpnlist.add(cpn);
// }
// }
//
// Collections.sort(cpnlist, (coupon1, coupon2) -> coupon1.getExpirationDate().compareTo(coupon2.getExpirationDate()));
//
// runOnUiThread(() -> {
// if (cpnlist != null && cpnlist.size() > 0) {
// mAdapterCoupons = new ActiveCouponAdapter(this, cpnlist);
// mRecyclerCoupons.setAdapter(mAdapterCoupons);
// mAdapterCoupons.getPositionClicks()
// .doOnNext(coupon -> {
// if (!mCouponPressed) {
// mCouponPressed = true;
// WarplyAnalyticsManager.logTrackersEvent(this, "click", ("Coupon").concat(":").concat(coupon.getName()));
// Intent intent = new Intent(LoyaltyWallet.this, CouponInfoActivity.class);
// intent.putExtra("coupon", (Serializable) coupon);
// intent.putExtra("isFromWallet", true);
// startActivityForResult(intent, 1002);
// }
// })
// .doOnError(error -> {
// })
// .subscribe();
// mAdapterCoupons.notifyDataSetChanged();
//// mLlGifts.setVisibility(View.VISIBLE);
// } else {
// mLlGifts.setVisibility(View.GONE);
// }
// });
/** Coupons List */
runOnUiThread
(()
->
{
if
(
WarplyManagerHelper
.
getCouponList
()
!=
null
&&
WarplyManagerHelper
.
getCouponList
().
size
()
>
0
)
mTvGiftsCountBadge
.
setText
(
String
.
valueOf
(
WarplyManagerHelper
.
getCouponList
().
size
()));
else
mTvGiftsCountBadge
.
setText
(
"0"
);
checkForEmpty
();
});
}
}
// @Override
// protected void attachBaseContext(Context newBase) {
// super.attachBaseContext(ViewPumpContextWrapper.wrap(newBase));
// }
// ===========================================================
// Methods
// ===========================================================
private
void
initViews
()
{
if
(
WarpUtils
.
getUserNonTelco
(
this
))
{
nonTelcoDialog
();
}
/** Unified Coupons List */
// if (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() > 0) {
// ArrayList<UnifiedCoupon> unilist = new ArrayList<UnifiedCoupon>();
// for (UnifiedCoupon unicpn : WarplyManagerHelper.getMarketCouponsList()) {
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
// Date newDate = new Date();
// try {
// newDate = simpleDateFormat.parse(unicpn.getCreated());
// } catch (ParseException e) {
// e.printStackTrace();
// }
// unicpn.setExpirationDate(newDate);
// unilist.add(unicpn);
// }
//
// Collections.sort(unilist, (coupon1, coupon2) -> coupon2.getExpirationDate().compareTo(coupon1.getExpirationDate()));
//
// mAdapterMarketCoupons = new MarketCouponAdapter(this, unilist);
// mRvMarketCoupons.setAdapter(mAdapterMarketCoupons);
// mAdapterMarketCoupons.getPositionClicks()
// .doOnNext(coupon -> {
// if (!mUnifiedPressed) {
// mUnifiedPressed = true;
// WarplyAnalyticsManager.logTrackersEvent(this, "click", ("UnifiedCoupon").concat(":").concat(coupon.getBarcode()));
// Intent intent = new Intent(LoyaltyWallet.this, UnifiedCouponInfoActivity.class);
// intent.putExtra("coupon", (Serializable) coupon);
// intent.putExtra("isFromWallet", true);
// startActivity(intent);
// }
//// startActivityForResult(intent, 1002);
// })
// .doOnError(error -> {
// })
// .subscribe();
// mLlMarketView.setVisibility(View.VISIBLE);
// } else {
// mLlMarketView.setVisibility(View.GONE);
// }
if
(
WarplyManagerHelper
.
getMarketCouponsList
()
!=
null
&&
WarplyManagerHelper
.
getMarketCouponsList
().
size
()
>
0
)
mTvUnifiedCountBadge
.
setText
(
String
.
valueOf
(
WarplyManagerHelper
.
getMarketCouponsList
().
size
()));
else
mTvUnifiedCountBadge
.
setText
(
"0"
);
/** Unified Coupons List */
/** Coupon List */
// if (WarplyManagerHelper.getCouponList() != null && WarplyManagerHelper.getCouponList().size() > 0) {
// CouponList cpnlist = new CouponList();
// for (Coupon cpn : WarplyManagerHelper.getCouponList()) {
// if (cpn.getStatus() == 1) {
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
// Date newDate = new Date();
// try {
// newDate = simpleDateFormat.parse(cpn.getExpiration());
// } catch (ParseException e) {
// e.printStackTrace();
// }
// cpn.setExpirationDate(newDate);
// cpnlist.add(cpn);
// }
// }
//
// Collections.sort(cpnlist, (coupon1, coupon2) -> coupon1.getExpirationDate().compareTo(coupon2.getExpirationDate()));
//
// mRecyclerCoupons.setNestedScrollingEnabled(false);
// mRecyclerCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
// mAdapterCoupons = new ActiveCouponAdapter(this, cpnlist);
// mRecyclerCoupons.setAdapter(mAdapterCoupons);
// mAdapterCoupons.getPositionClicks()
// .doOnNext(coupon -> {
// if (!mCouponPressed) {
// mCouponPressed = true;
// WarplyAnalyticsManager.logTrackersEvent(this, "click", ("Coupon").concat(":").concat(coupon.getName()));
// Intent intent = new Intent(LoyaltyWallet.this, CouponInfoActivity.class);
// intent.putExtra("coupon", (Serializable) coupon);
// intent.putExtra("isFromWallet", true);
// startActivityForResult(intent, 1002);
// }
// })
// .doOnError(error -> {
// })
// .subscribe();
// mLlGifts.setVisibility(View.VISIBLE);
// } else {
// mLlGifts.setVisibility(View.GONE);
// }
if
(
WarplyManagerHelper
.
getCouponList
()
!=
null
&&
WarplyManagerHelper
.
getCouponList
().
size
()
>
0
)
mTvGiftsCountBadge
.
setText
(
String
.
valueOf
(
WarplyManagerHelper
.
getCouponList
().
size
()));
else
mTvGiftsCountBadge
.
setText
(
"0"
);
/** Coupon List */
/** First Expandable Banner */
// String badgeValueFirst = String.format("%.02f", WarplyManagerHelper.getDealsCouponsSum());
// mTvDealsValue.setText(String.format(getString(R.string.cos_value), badgeValueFirst));
// if (String.valueOf(WarplyManagerHelper.getDealsCouponsSum()).length() >= 3) {
// mTvDealsValue.setTextSize(12);
// } else {
// mTvDealsValue.setTextSize(14);
// }
// SpannableStringBuilder sBuilder = new SpannableStringBuilder();
// sBuilder.append(String.format(getString(R.string.cos_deals_win_title_cos), badgeValueFirst));
// CalligraphyTypefaceSpan typefaceBoldSpanFirst = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
// sBuilder.setSpan(typefaceBoldSpanFirst, 15, 16 + badgeValueFirst.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
// mTvDealsValueAll.setText(sBuilder, TextView.BufferType.SPANNABLE);
// mFavValue += WarplyManagerHelper.getDealsCouponsSum();
/** First Expandable Banner */
/** Second Expandable Banner */
// if (WarplyManagerHelper.getLoyaltyBadge() != null && (WarplyManagerHelper.getLoyaltyBadge().getCouponCount() > 0 || WarplyManagerHelper.getLoyaltyBadge().getCouponCount() == 0)) {
// String badgeValue = String.format("%.02f", WarplyManagerHelper.getLoyaltyBadge().getValue());
// mTvGiftsValue.setText(String.format(getString(R.string.cos_value), badgeValue));
// if (String.valueOf(WarplyManagerHelper.getLoyaltyBadge().getValue()).length() >= 3) {
// mTvGiftsValue.setTextSize(12);
// } else {
// mTvGiftsValue.setTextSize(14);
// }
// SpannableStringBuilder sBuilderSecond = new SpannableStringBuilder();
// sBuilderSecond.append(String.format(getString(R.string.cos_deals_win_title), badgeValue));
// CalligraphyTypefaceSpan typefaceBoldSpanSecond = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
// sBuilderSecond.setSpan(typefaceBoldSpanSecond, 15, 16 + badgeValue.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
// mTvGiftsValueAll.setText(sBuilderSecond, TextView.BufferType.SPANNABLE);
// mFavValue += WarplyManagerHelper.getLoyaltyBadge().getValue();
// }
/** Second Expandable Banner */
/** Third Expandable Banner */
// if (WarplyManagerHelper.getMarketCoupons() != null && WarplyManagerHelper.getMarketCoupons().size() > 0) {
// countValue = 0.0f;
//// for (UnifiedCoupon unicou : WarplyManagerHelper.getMarketCoupons()) {
//// if (unicou.getCoupons() != null && unicou.getCoupons().size() > 0) {
//// for (Coupon inncou : unicou.getCoupons()) {
//// if (inncou.getStatus() == 0) {
//// countValue += Float.valueOf(inncou.getDiscount());
//// }
//// }
//// }
//// }
//
// if (WarplyManagerHelper.getCouponRedeemedList().size() > 0) {
// if (WarplyManagerHelper.getCouponsetsDeals().size() > 0) {
// for (Couponset couset : WarplyManagerHelper.getCouponsetsDeals()) {
// for (Coupon cou : WarplyManagerHelper.getCouponRedeemedList()) {
// if (cou.getCouponsetUuid().equals(couset.getUuid())) {
// countValue += Float.valueOf(cou.getDiscount());
// cou.setDescription(couset.getShortDescription());
// cou.setImage(couset.getImgPreview());
// cou.setName(couset.getName());
// cou.setMerchantUuid(couset.getMerchantUuid());
// cou.setInnerText(couset.getInnerText());
// cou.setDiscount_type(couset.getDiscount_type());
// cou.setFinal_price(couset.getFinal_price());
// break;
// }
// }
// }
// }
// }
//
// mFavValue += countValue;
// String badgeValue = String.format("%.02f", countValue);
// mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue));
// if (String.valueOf(countValue).length() >= 3) {
// mTvMarketValue.setTextSize(12);
// } else {
// mTvMarketValue.setTextSize(14);
// }
// SpannableStringBuilder sBuilderThird = new SpannableStringBuilder();
// sBuilderThird.append(String.format(getString(R.string.cos_supermarket_win), badgeValue));
// CalligraphyTypefaceSpan typefaceBoldSpanThird = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
// sBuilderThird.setSpan(typefaceBoldSpanThird, 15, 16 + badgeValue.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
// mTvMarketAll.setText(sBuilderThird, TextView.BufferType.SPANNABLE);
// } else {
// String badgeValue = String.format("%.02f", 0.0f);
// mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue));
// SpannableStringBuilder sBuilderThird = new SpannableStringBuilder();
// sBuilderThird.append(String.format(getString(R.string.cos_supermarket_win), badgeValue));
// CalligraphyTypefaceSpan typefaceBoldSpanThird = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
// sBuilderThird.setSpan(typefaceBoldSpanThird, 15, 16 + badgeValue.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
// mTvMarketAll.setText(sBuilderThird, TextView.BufferType.SPANNABLE);
// }
/** Third Expandable Banner */
/** Sum Expandable Banner */
// String allValue = String.format("%.02f", mFavValue);
// mTvFavValue.setText(String.format(getString(R.string.cos_value), allValue));
// if (String.valueOf(mFavValue).length() >= 3) {
// mTvFavValue.setTextSize(12);
// } else {
// mTvFavValue.setTextSize(14);
// }
// SpannableStringBuilder sBuilderExp = new SpannableStringBuilder();
// sBuilderExp.append(String.format(getString(R.string.cos_for_you_all), allValue));
// CalligraphyTypefaceSpan typefaceBoldExp = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
// sBuilderExp.setSpan(typefaceBoldExp, 26, 27 + allValue.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
// mTvFavValueAll.setText(sBuilderExp, TextView.BufferType.SPANNABLE);
// mClExp.setVisibility(View.VISIBLE);
/** Sum Expandable Banner */
/** Deals Badge */
// if (WarplyManagerHelper.getActiveDFYCoupons() != null && WarplyManagerHelper.getActiveDFYCoupons().size() > 0) {
// String codes = "";
// if (WarplyManagerHelper.getActiveDFYCoupons().size() == 1) {
// codes = WarplyManagerHelper.getActiveDFYCoupons().get(0).getCode();
// mTvActiveTitle.setText(String.format(getString(R.string.cos_active_deals), String.valueOf(1)));
//
// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
// String date1 = WarplyManagerHelper.getActiveDFYCoupons().get(0).getDate();
// String date2 = dateFormat.format(new Date());
//
// mTvActiveCode.setText(codes);
//
// try {
// Date toDate = dateFormat.parse(date2);
// Date fromDate = dateFormat.parse(date1);
// long diff = TimeUnit.MILLISECONDS.toDays(fromDate.getTime() - toDate.getTime()) + 1;
// mTvActiveDate.setText(String.format(getString(R.string.cos_active_coupon_date), String.valueOf(diff)));
// mTvActiveDate.setVisibility(View.VISIBLE);
// } catch (ParseException e) {
// e.printStackTrace();
// }
// } else {
//// for (ActiveDFYCouponModel coupon : WarplyManagerHelper.getActiveDFYCoupons()) {
//// codes = codes + coupon.getCode() + ",";
//// }
//// codes = codes.substring(0, codes.length() - 1);
//
// mTvActiveTitle.setText(String.format(getString(R.string.cos_active_deals_plural), String.valueOf(WarplyManagerHelper.getActiveDFYCoupons().size())));
// mTvActiveCode.setVisibility(View.GONE);
//
//// Collections.reverse(WarplyManagerHelper.getActiveDFYCoupons());
// for (int i = 0; i < WarplyManagerHelper.getActiveDFYCoupons().size(); i++) {
// LayoutInflater vi = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// LinearLayout v = (LinearLayout) vi.inflate(R.layout.item_selectable, null);
// TextView textView = (TextView) v.findViewById(R.id.tv_code_copy);
// TextView textViewComma = (TextView) v.findViewById(R.id.tv_code_comma);
// CalligraphyTypefaceSpan typefaceBoldSpanDFY = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
// SpannableStringBuilder sBuilderDFY = new SpannableStringBuilder(WarplyManagerHelper.getActiveDFYCoupons().get(i).getCode());
// SpannableStringBuilder sBuilderComma = new SpannableStringBuilder(getString(R.string.cos_comma));
// sBuilderDFY.setSpan(typefaceBoldSpanDFY, 0, sBuilderDFY.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
// sBuilderComma.setSpan(typefaceBoldSpanDFY, 0, sBuilderComma.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
// textView.setText(sBuilderDFY, TextView.BufferType.SPANNABLE);
// textView.setTextIsSelectable(true);
// textViewComma.setText(sBuilderComma, TextView.BufferType.SPANNABLE);
// mLlActiveCodesView.addView(v, 0, new ViewGroup.LayoutParams(
// ViewGroup.LayoutParams.WRAP_CONTENT,
// ViewGroup.LayoutParams.WRAP_CONTENT));
// }
//
// mScActiveCodes.setVisibility(View.VISIBLE);
// mLlActiveCodesView.setVisibility(View.VISIBLE);
// }
//// mTvActiveCode.setText(codes);
// mLlDeals.setVisibility(View.VISIBLE);
// } else {
// mLlDeals.setVisibility(View.GONE);
// }
if
(
WarplyManagerHelper
.
getActiveDFYCoupons
()
!=
null
)
mTvDealsCountBadge
.
setText
(
String
.
valueOf
(
WarplyManagerHelper
.
getActiveDFYCoupons
().
size
()));
else
mTvDealsCountBadge
.
setText
(
"0"
);
/** Deals Badge */
if
(
WarplyManagerHelper
.
getConsumer
()
!=
null
)
{
mTvUsername
.
setText
(
String
.
format
(
getResources
().
getString
(
R
.
string
.
cos_profile_loyalty_name
),
WarplyManagerHelper
.
getConsumer
().
getFirstName
(),
WarplyManagerHelper
.
getConsumer
().
getLastName
()));
if
(!
TextUtils
.
isEmpty
(
WarplyManagerHelper
.
getConsumer
().
getImageUrl
())
&&
!
WarplyManagerHelper
.
getConsumer
().
getImageUrl
().
equals
(
"null"
))
{
Glide
.
with
(
this
)
.
load
(
WarplyManagerHelper
.
getConsumer
().
getImageUrl
())
.
diskCacheStrategy
(
DiskCacheStrategy
.
DATA
)
.
into
(
mIvProfilePhoto
);
}
else
{
Glide
.
with
(
this
)
.
load
(
R
.
drawable
.
ic_default_photo
)
.
into
(
mIvProfilePhoto
);
}
if
(!
TextUtils
.
isEmpty
(
WarplyManagerHelper
.
getUserTag
(
this
)))
{
mTvUserBadge
.
setText
(
WarplyManagerHelper
.
getUserTag
(
this
));
mLlQuestionnaire
.
setVisibility
(
View
.
GONE
);
mLlUserBadge
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
mLlUserBadge
.
setVisibility
(
View
.
GONE
);
mLlQuestionnaire
.
setVisibility
(
View
.
VISIBLE
);
}
}
/** Expandable Banner */
// if (mLlMarketView.getVisibility() == View.GONE
// && WarplyManagerHelper.getDealsCouponsSum() == 0
// && (WarplyManagerHelper.getLoyaltyBadge() != null && WarplyManagerHelper.getLoyaltyBadge().getCouponCount() == 0)
// && countValue == 0) {
// mIvExpArrow.setVisibility(View.GONE);
//// mLlEmptyWallet.setVisibility(View.VISIBLE);
// mIsStayCollapsed = true;
// } else {
// mIvExpArrow.setVisibility(View.VISIBLE);
// mIsStayCollapsed = false;
// }
/** Expandable Banner */
/** Empty View */
checkForEmpty
();
/** Empty View */
mIvBack
.
setOnClickListener
(
this
);
mLlQuestionnaire
.
setOnClickListener
(
this
);
mLlUserBadge
.
setOnClickListener
(
this
);
mClDealsBanner
.
setOnClickListener
(
this
);
mClGiftsBanner
.
setOnClickListener
(
this
);
mClDealsView
.
setOnClickListener
(
this
);
mSvLoyaltyWallet
.
setOnScrollChangeListener
(
this
);
mClExp
.
setOnClickListener
(
this
);
mClMarket
.
setOnClickListener
(
this
);
mLlHistory
.
setOnClickListener
(
this
);
mRlDeals
.
setOnClickListener
(
this
);
mRlUnified
.
setOnClickListener
(
this
);
mRlGifts
.
setOnClickListener
(
this
);
mCvVouchers
.
setOnClickListener
(
this
);
mCvVouchersDisabled
.
setOnClickListener
(
this
);
}
private
void
nonTelcoDialog
()
{
if
(!
isFinishing
())
{
mAlertDialogNonTelco
=
new
AlertDialog
.
Builder
(
this
)
.
setTitle
(
R
.
string
.
cos_dlg_non_telco_title
)
.
setMessage
(
R
.
string
.
cos_dlg_non_telco
)
.
setPositiveButton
(
R
.
string
.
cos_dlg_positive_button2
,
(
dialogPositive
,
whichPositive
)
->
{
dialogPositive
.
dismiss
();
onBackPressed
();
})
.
setCancelable
(
false
)
.
show
();
}
}
private
void
vouchersServiceUnavailableDialog
()
{
if
(!
isFinishing
())
{
mLlVouchersSpinner
.
setVisibility
(
View
.
GONE
);
mAlertDialogVouchersService
=
new
AlertDialog
.
Builder
(
this
)
.
setTitle
(
R
.
string
.
cos_dlg_try_again
)
.
setMessage
(
R
.
string
.
cos_dlg_service_unavailable
)
.
setPositiveButton
(
R
.
string
.
cos_dlg_return
,
(
dialogPositive
,
whichPositive
)
->
{
dialogPositive
.
dismiss
();
onBackPressed
();
})
.
setCancelable
(
false
)
.
show
();
}
}
private
void
checkForEmpty
()
{
if
(
TextUtils
.
isEmpty
(
WarplyManagerHelper
.
getShowVouchersBanner
())
||
(!
TextUtils
.
isEmpty
(
WarplyManagerHelper
.
getShowVouchersBanner
())
&&
WarplyManagerHelper
.
getShowVouchersBanner
().
equals
(
"null"
)))
{
/** Show spinner only if empty */
mLlVouchers
.
setVisibility
(
View
.
GONE
);
mSeparator
.
setVisibility
(
View
.
VISIBLE
);
if
(
TextUtils
.
isEmpty
(
WarplyManagerHelper
.
getShowVouchersBanner
()))
mLlVouchersSpinner
.
setVisibility
(
View
.
VISIBLE
);
if
(!
TextUtils
.
isEmpty
(
WarplyManagerHelper
.
getShowVouchersBanner
())
&&
WarplyManagerHelper
.
getShowVouchersBanner
().
equals
(
"null"
))
mLlVouchersSpinner
.
setVisibility
(
View
.
GONE
);
if
((
WarplyManagerHelper
.
getActiveDFYCoupons
()
!=
null
&&
WarplyManagerHelper
.
getActiveDFYCoupons
().
size
()
==
0
)
&&
(
WarplyManagerHelper
.
getMarketCouponsList
()
!=
null
&&
WarplyManagerHelper
.
getMarketCouponsList
().
size
()
==
0
)
&&
(
WarplyManagerHelper
.
getCouponList
()
!=
null
&&
WarplyManagerHelper
.
getCouponList
().
size
()
==
0
))
{
/** Hide all and show empty view */
mLlVouchers
.
setVisibility
(
View
.
GONE
);
mLlVouchersSpinner
.
setVisibility
(
View
.
GONE
);
mSeparator
.
setVisibility
(
View
.
VISIBLE
);
mLlEmptyWallet
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
/** Show loyalty banners and hide empty view
* Show spinner only if empty */
mLlEmptyWallet
.
setVisibility
(
View
.
GONE
);
mLlBannerInfo
.
setVisibility
(
View
.
VISIBLE
);
}
}
else
{
if
(
WarplyManagerHelper
.
getShowVouchersBanner
().
equals
(
"true"
))
{
/** Hide spinner and hide empty view and show vouchers and hide disabled vouchers */
mLlVouchersSpinner
.
setVisibility
(
View
.
GONE
);
mLlEmptyWallet
.
setVisibility
(
View
.
GONE
);
if
(
TextUtils
.
isEmpty
(
WarpUtils
.
getLanguage
(
this
))
||
WarpUtils
.
getLanguage
(
this
).
equals
(
"el"
))
{
mTvVouchersTitle
.
setText
(
getString
(
R
.
string
.
cos_vouchers_title
));
mTvVouchersSubtitle
.
setText
(
getString
(
R
.
string
.
cos_vouchers_info_title
));
}
else
{
mTvVouchersTitle
.
setText
(
getString
(
R
.
string
.
cos_vouchers_title_en
));
mTvVouchersSubtitle
.
setText
(
getString
(
R
.
string
.
cos_vouchers_info_title_en
));
}
mLlVouchers
.
setVisibility
(
View
.
VISIBLE
);
mLlVouchersDisabled
.
setVisibility
(
View
.
GONE
);
mSeparatorDisabled
.
setVisibility
(
View
.
VISIBLE
);
if
((
WarplyManagerHelper
.
getActiveDFYCoupons
()
!=
null
&&
WarplyManagerHelper
.
getActiveDFYCoupons
().
size
()
==
0
)
&&
(
WarplyManagerHelper
.
getMarketCouponsList
()
!=
null
&&
WarplyManagerHelper
.
getMarketCouponsList
().
size
()
==
0
)
&&
(
WarplyManagerHelper
.
getCouponList
()
!=
null
&&
WarplyManagerHelper
.
getCouponList
().
size
()
==
0
))
{
/** Hide loyalty banners and hide separator */
mSeparator
.
setVisibility
(
View
.
GONE
);
mLlBannerInfo
.
setVisibility
(
View
.
GONE
);
}
else
{
/** Show loyalty banners and show separator */
mSeparator
.
setVisibility
(
View
.
VISIBLE
);
mLlBannerInfo
.
setVisibility
(
View
.
VISIBLE
);
}
}
else
if
(
WarplyManagerHelper
.
getShowVouchersBanner
().
equals
(
"false"
))
{
/** Hide spinner and hide vouchers and hide empty view and show disabled vouchers and show disabled separator */
mLlVouchersSpinner
.
setVisibility
(
View
.
GONE
);
mLlEmptyWallet
.
setVisibility
(
View
.
GONE
);
mLlVouchers
.
setVisibility
(
View
.
GONE
);
mSeparator
.
setVisibility
(
View
.
VISIBLE
);
if
(
TextUtils
.
isEmpty
(
WarpUtils
.
getLanguage
(
this
))
||
WarpUtils
.
getLanguage
(
this
).
equals
(
"el"
))
{
mTvVouchersDisabledTitle
.
setText
(
getString
(
R
.
string
.
cos_vouchers_title
));
mTvVouchersDisabledSubtitle
.
setText
(
getString
(
R
.
string
.
cos_vouchers_info_title_disabled
));
}
else
{
mTvVouchersDisabledTitle
.
setText
(
getString
(
R
.
string
.
cos_vouchers_title_en
));
mTvVouchersDisabledSubtitle
.
setText
(
getString
(
R
.
string
.
cos_vouchers_info_title_disabled_en
));
}
mLlVouchersDisabled
.
setVisibility
(
View
.
VISIBLE
);
mSeparatorDisabled
.
setVisibility
(
View
.
VISIBLE
);
if
((
WarplyManagerHelper
.
getActiveDFYCoupons
()
!=
null
&&
WarplyManagerHelper
.
getActiveDFYCoupons
().
size
()
==
0
)
&&
(
WarplyManagerHelper
.
getMarketCouponsList
()
!=
null
&&
WarplyManagerHelper
.
getMarketCouponsList
().
size
()
==
0
)
&&
(
WarplyManagerHelper
.
getCouponList
()
!=
null
&&
WarplyManagerHelper
.
getCouponList
().
size
()
==
0
))
{
/** Hide loyalty banners and hide empty view and hide disabled separator */
mLlBannerInfo
.
setVisibility
(
View
.
GONE
);
mLlEmptyWallet
.
setVisibility
(
View
.
GONE
);
mSeparatorDisabled
.
setVisibility
(
View
.
GONE
);
}
else
{
/** Show loyalty banners and show disabled separator */
mLlBannerInfo
.
setVisibility
(
View
.
VISIBLE
);
mSeparatorDisabled
.
setVisibility
(
View
.
VISIBLE
);
}
}
}
}
// ===========================================================
// Inner and Anonymous Classes
// ===========================================================
}
warply_android_sdk/src/main/java/ly/warp/sdk/services/UpdateUserLocationService.java
View file @
81e9312
...
...
@@ -52,7 +52,6 @@ import java.util.List;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
import
ly.warp.sdk.BuildConfig
;
import
ly.warp.sdk.Warply
;
import
ly.warp.sdk.dexter.listener.DexterError
;
import
ly.warp.sdk.dexter.listener.PermissionDeniedResponse
;
...
...
@@ -102,11 +101,9 @@ public class UpdateUserLocationService extends Worker {
PermissionsUtil
.
PERMISSION_LOCATION_FINE
).
requestPermissions
();
}
catch
(
SecurityException
e
)
{
if
(
BuildConfig
.
DEBUG
)
{
e
.
printStackTrace
();
WorkManager
.
getInstance
(
Warply
.
getWarplyContext
()).
cancelAllWorkByTag
(
TAG
);
}
}
}
else
{
WorkManager
.
getInstance
(
Warply
.
getWarplyContext
()).
cancelAllWorkByTag
(
TAG
);
}
...
...
@@ -187,7 +184,6 @@ public class UpdateUserLocationService extends Worker {
getGeofences
().
add
(
new
WarpGeoFence
(
geoArray
.
getJSONObject
(
i
)));
}
}
catch
(
JSONException
e
)
{
if
(
BuildConfig
.
DEBUG
)
e
.
printStackTrace
();
geofences
=
null
;
WarpUtils
.
log
(
"failed during parsing geofencing data."
);
...
...
@@ -427,10 +423,8 @@ public class UpdateUserLocationService extends Worker {
WarpUtils
.
log
(
"Could not get location data."
);
});
}
catch
(
SecurityException
e
)
{
if
(
BuildConfig
.
DEBUG
)
{
e
.
printStackTrace
();
}
}
}
};
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyLocationManager.java
View file @
81e9312
...
...
@@ -38,7 +38,6 @@ import androidx.work.WorkManager;
import
java.util.List
;
import
ly.warp.sdk.BuildConfig
;
import
ly.warp.sdk.Warply
;
import
ly.warp.sdk.dexter.listener.DexterError
;
import
ly.warp.sdk.dexter.listener.PermissionDeniedResponse
;
...
...
@@ -122,11 +121,9 @@ public class WarplyLocationManager {
defaultMinTime
,
defaultMinDistance
,
locationListenerPendingIntent
);
}
catch
(
SecurityException
e
)
{
if
(
BuildConfig
.
DEBUG
)
{
e
.
printStackTrace
();
}
}
}
};
try
{
...
...
@@ -137,7 +134,6 @@ public class WarplyLocationManager {
PermissionsUtil
.
PERMISSION_LOCATION_FINE
).
requestPermissions
();
}
catch
(
Exception
e
)
{
if
(
BuildConfig
.
DEBUG
)
e
.
printStackTrace
();
}
}
...
...
@@ -262,11 +258,9 @@ public class WarplyLocationManager {
lm
.
requestLocationUpdates
(
bestProvider
,
minTime
,
minDistance
,
locationListenerPendingIntent
);
}
}
catch
(
SecurityException
e
)
{
if
(
BuildConfig
.
DEBUG
)
{
e
.
printStackTrace
();
}
}
}
};
new
PermissionsUtil
(
...
...
@@ -276,12 +270,10 @@ public class WarplyLocationManager {
PermissionsUtil
.
PERMISSION_LOCATION_FINE
).
requestPermissions
();
}
catch
(
SecurityException
e
)
{
if
(
BuildConfig
.
DEBUG
)
{
e
.
printStackTrace
();
}
}
}
}
// MicroAppIndexes geofencingIndex = MicroAppIndexes.GEOFENCING_INDEX;
//
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/CampaignItemWebHolder.java
View file @
81e9312
...
...
@@ -16,7 +16,6 @@ import android.widget.ImageView;
import
android.widget.RelativeLayout
;
import
ly.warp.sdk.BuildConfig
;
import
ly.warp.sdk.io.models.Campaign
;
import
ly.warp.sdk.utils.WarpUtils
;
import
ly.warp.sdk.utils.WarplyDeviceInfoCollector
;
...
...
@@ -117,11 +116,9 @@ public class CampaignItemWebHolder extends CampaignItemViewHolder {
try
{
context
.
startActivity
(
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
url
)));
}
catch
(
ActivityNotFoundException
e
)
{
if
(
BuildConfig
.
DEBUG
)
{
e
.
printStackTrace
();
}
}
}
});
warpView
.
setOnTouchListener
(
new
View
.
OnTouchListener
()
{
@Override
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/CampaignViewLoader.java
View file @
81e9312
package
ly
.
warp
.
sdk
.
views
;
import
android.content.Context
;
import
androidx.fragment.app.Fragment
;
import
androidx.fragment.app.FragmentActivity
;
import
androidx.fragment.app.FragmentManager
;
import
androidx.fragment.app.FragmentTransaction
;
import
android.text.TextUtils
;
import
ly.warp.sdk.BuildConfig
;
import
ly.warp.sdk.Warply
;
import
ly.warp.sdk.fragments.WarpViewFragment
;
import
ly.warp.sdk.io.callbacks.CallbackReceiver
;
...
...
@@ -87,12 +88,10 @@ public class CampaignViewLoader implements CallbackReceiver<CampaignList> {
try
{
transaction
.
commit
();
}
catch
(
IllegalStateException
e
)
{
if
(
BuildConfig
.
DEBUG
)
{
e
.
printStackTrace
();
}
}
}
}
private
void
notifySuccessExternalListener
(
CampaignList
campaigns
)
{
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/WarpView.java
View file @
81e9312
...
...
@@ -35,7 +35,6 @@ import android.content.Context;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.content.IntentSender
;
import
android.content.pm.ApplicationInfo
;
import
android.content.pm.PackageManager
;
import
android.location.LocationManager
;
import
android.net.Uri
;
...
...
@@ -103,12 +102,9 @@ import ly.warp.sdk.io.models.RefreshVouchersEventModel;
import
ly.warp.sdk.io.models.UnifiedCoupon
;
import
ly.warp.sdk.io.models.WarplyCCMSEnabledModel
;
import
ly.warp.sdk.io.models.WarplyCouponsChangedEventModel
;
import
ly.warp.sdk.io.models.WarplyHealthEventModel
;
import
ly.warp.sdk.io.models.WarplyPacingCardEventModel
;
import
ly.warp.sdk.io.models.WarplyPacingEventModel
;
import
ly.warp.sdk.io.models.WarplyUnifiedActivatedEventModel
;
import
ly.warp.sdk.services.EventCampaignService
;
import
ly.warp.sdk.services.WarplyHealthService
;
import
ly.warp.sdk.utils.WarpUtils
;
import
ly.warp.sdk.utils.WarplyManagerHelper
;
import
ly.warp.sdk.utils.WarplyProperty
;
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/CampaignsArrayAdapter.java
View file @
81e9312
...
...
@@ -10,7 +10,6 @@ import java.util.Collections;
import
java.util.Comparator
;
import
java.util.concurrent.atomic.AtomicBoolean
;
import
ly.warp.sdk.BuildConfig
;
import
ly.warp.sdk.Warply
;
import
ly.warp.sdk.io.callbacks.CallbackReceiver
;
import
ly.warp.sdk.io.callbacks.SimpleCallbackReceiver
;
...
...
@@ -142,10 +141,8 @@ public class CampaignsArrayAdapter<VH extends CampaignItemViewHolder> extends Ba
itemView
=
viewHolder
.
itemView
;
itemView
.
setTag
(
viewHolder
);
}
catch
(
Exception
e
)
{
if
(
BuildConfig
.
DEBUG
)
{
e
.
printStackTrace
();
}
}
}
else
{
viewHolder
=
(
VH
)
itemView
.
getTag
();
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/mix/CampaignsMixListAdapter.java
View file @
81e9312
package
ly
.
warp
.
sdk
.
views
.
adapters
.
mix
;
import
android.database.DataSetObserver
;
import
androidx.annotation.NonNull
;
import
androidx.recyclerview.widget.RecyclerView
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.AbsListView
;
import
android.widget.BaseAdapter
;
import
android.widget.ListView
;
import
ly.warp.sdk.BuildConfig
;
import
ly.warp.sdk.io.callbacks.SimpleCallbackReceiver
;
import
ly.warp.sdk.io.models.Campaign
;
import
ly.warp.sdk.io.models.CampaignList
;
...
...
@@ -185,10 +186,8 @@ public class CampaignsMixListAdapter<VH extends CampaignItemViewHolder> extends
itemView
=
viewHolder
.
itemView
;
itemView
.
setTag
(
viewHolder
);
}
catch
(
Exception
e
)
{
if
(
BuildConfig
.
DEBUG
)
{
e
.
printStackTrace
();
}
}
}
else
{
viewHolder
=
(
VH
)
itemView
.
getTag
();
}
...
...
warply_android_sdk/src/main/res/layout/activity_loyalty_wallet.xml
deleted
100644 → 0
View file @
ee6ee87
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/cos_light_grey3"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/cl_loyalty_wallet_header"
android:layout_width=
"match_parent"
android:layout_height=
"64dp"
android:background=
"@color/white"
>
<ImageView
android:id=
"@+id/iv_back"
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:layout_marginStart=
"16dp"
android:scaleType=
"centerInside"
android:src=
"@drawable/ic_close"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/cos_profile_title"
android:textColor=
"@color/cos_light_black"
android:textSize=
"19sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.core.widget.NestedScrollView
android:id=
"@+id/sv_loyalty_wallet"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_below=
"@+id/cl_loyalty_wallet_header"
android:fillViewport=
"true"
android:overScrollMode=
"never"
android:scrollbars=
"none"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@android:color/white"
android:orientation=
"vertical"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/ll_first_view"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:paddingHorizontal=
"16dp"
android:paddingVertical=
"24dp"
>
<com.google.android.material.imageview.ShapeableImageView
android:id=
"@+id/iv_profile_photo"
android:layout_width=
"74dp"
android:layout_height=
"74dp"
android:padding=
"1dp"
android:src=
"@drawable/ic_default_photo"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:shapeAppearanceOverlay=
"@style/ShapeAppearanceProfileImage"
app:strokeColor=
"@color/cos_grey2"
app:strokeWidth=
"1dp"
/>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"8dp"
android:orientation=
"vertical"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@+id/iv_profile_photo"
app:layout_constraintTop_toTopOf=
"parent"
>
<TextView
android:id=
"@+id/tv_profile_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"4dp"
android:includeFontPadding=
"false"
android:maxLines=
"1"
android:textColor=
"@color/cos_light_black"
android:textSize=
"22sp"
tools:text=
"Test Name"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<LinearLayout
android:id=
"@+id/ll_user_badge"
android:layout_width=
"wrap_content"
android:layout_height=
"42dp"
android:background=
"@drawable/selector_button_green_border"
android:gravity=
"center"
android:visibility=
"gone"
tools:visibility=
"gone"
>
<TextView
android:id=
"@+id/tv_type"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"20dp"
android:includeFontPadding=
"false"
android:textColor=
"@color/cos_green12"
android:textSize=
"16sp"
tools:text=
"@string/cos_profile_preferences_placeholder"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_user_questionnaire"
android:layout_width=
"160dp"
android:layout_height=
"42dp"
android:background=
"@drawable/selector_button_green_border"
android:gravity=
"center"
android:visibility=
"gone"
tools:visibility=
"visible"
>
<ImageView
android:layout_width=
"16dp"
android:layout_height=
"16dp"
android:layout_marginEnd=
"4dp"
android:src=
"@drawable/sv_plus_sign_green"
/>
<TextView
android:id=
"@+id/tv_questionnaire"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:includeFontPadding=
"false"
android:text=
"@string/cos_profile_preferences"
android:textColor=
"@color/cos_green12"
android:textSize=
"16sp"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_loyalty_history"
android:layout_width=
"52dp"
android:layout_height=
"42dp"
android:layout_marginStart=
"4dp"
android:background=
"@drawable/selector_button_green_border"
android:gravity=
"center"
android:orientation=
"vertical"
>
<ImageView
android:layout_width=
"16dp"
android:layout_height=
"16dp"
android:src=
"@drawable/sv_history"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<LinearLayout
android:id=
"@+id/ll_second_view"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
>
<LinearLayout
android:id=
"@+id/ll_banner_info_new"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"14dp"
android:layout_marginTop=
"16dp"
android:orientation=
"vertical"
android:visibility=
"gone"
tools:visibility=
"visible"
>
<TextView
android:id=
"@+id/tv_coupons_header"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:includeFontPadding=
"false"
android:maxLines=
"1"
android:text=
"@string/cos_coupons_loyalty_title"
android:textColor=
"@color/cos_light_black"
android:textSize=
"22sp"
/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"18dp"
>
<RelativeLayout
android:id=
"@+id/rv_deals_count"
android:layout_width=
"0dp"
android:layout_height=
"104dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@+id/rv_sm_count"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
>
<androidx.cardview.widget.CardView
android:id=
"@+id/cv_deals_count"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginHorizontal=
"2dp"
android:layout_marginVertical=
"4dp"
app:cardCornerRadius=
"16dp"
app:cardElevation=
"2dp"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/cos_green_tr"
>
<ImageView
android:id=
"@+id/iv_deals_logo_count"
android:layout_width=
"52dp"
android:layout_height=
"32dp"
android:src=
"@drawable/sv_deals_logo_redesign"
app:layout_constraintBottom_toTopOf=
"@+id/v_separator_deals_count"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<View
android:id=
"@+id/v_separator_deals_count"
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:layout_marginHorizontal=
"8dp"
android:background=
"@color/cos_grey2"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_deals_count_title"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"8dp"
android:gravity=
"center"
android:includeFontPadding=
"false"
android:text=
"@string/cos_deals_title2"
android:textColor=
"@color/cos_light_black"
android:textSize=
"10sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/v_separator_deals_count"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<LinearLayout
android:layout_width=
"16dp"
android:layout_height=
"16dp"
android:layout_alignParentEnd=
"true"
android:layout_marginTop=
"4dp"
android:layout_marginEnd=
"1dp"
android:background=
"@drawable/shape_cos_counter_orange"
android:gravity=
"center"
android:orientation=
"vertical"
android:translationZ=
"2dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
>
<TextView
android:id=
"@+id/tv_deals_count"
android:layout_width=
"wrap_content"
android:layout_height=
"16dp"
android:includeFontPadding=
"false"
android:maxLines=
"1"
android:textColor=
"@color/cos_light_black"
android:textSize=
"12sp"
tools:text=
"6"
/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:id=
"@+id/rv_sm_count"
android:layout_width=
"0dp"
android:layout_height=
"104dp"
android:layout_marginHorizontal=
"12dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@+id/rv_gifts_count"
app:layout_constraintStart_toEndOf=
"@+id/rv_deals_count"
app:layout_constraintTop_toTopOf=
"parent"
>
<androidx.cardview.widget.CardView
android:id=
"@+id/cv_sm_count"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginHorizontal=
"2dp"
android:layout_marginVertical=
"4dp"
app:cardCornerRadius=
"16dp"
app:cardElevation=
"2dp"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/cos_creme"
>
<ImageView
android:id=
"@+id/iv_sm_logo_count"
android:layout_width=
"32dp"
android:layout_height=
"32dp"
android:src=
"@drawable/sv_unified_redesign"
app:layout_constraintBottom_toTopOf=
"@+id/v_separator_sm_count"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<View
android:id=
"@+id/v_separator_sm_count"
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:layout_marginHorizontal=
"8dp"
android:background=
"@color/cos_grey2"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_sm_count_title"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"8dp"
android:gravity=
"center"
android:includeFontPadding=
"false"
android:text=
"@string/cos_market_title"
android:textColor=
"@color/cos_light_black"
android:textSize=
"10sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/v_separator_sm_count"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<LinearLayout
android:layout_width=
"16dp"
android:layout_height=
"16dp"
android:layout_alignParentEnd=
"true"
android:layout_marginTop=
"4dp"
android:layout_marginEnd=
"1dp"
android:background=
"@drawable/shape_cos_counter_orange"
android:gravity=
"center"
android:orientation=
"vertical"
android:translationZ=
"2dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
>
<TextView
android:id=
"@+id/tv_sm_count"
android:layout_width=
"wrap_content"
android:layout_height=
"16dp"
android:includeFontPadding=
"false"
android:maxLines=
"1"
android:textColor=
"@color/cos_light_black"
android:textSize=
"12sp"
tools:text=
"6"
/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:id=
"@+id/rv_gifts_count"
android:layout_width=
"0dp"
android:layout_height=
"104dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@+id/rv_sm_count"
app:layout_constraintTop_toTopOf=
"parent"
>
<androidx.cardview.widget.CardView
android:id=
"@+id/cv_gifts_count"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginHorizontal=
"2dp"
android:layout_marginVertical=
"4dp"
app:cardCornerRadius=
"16dp"
app:cardElevation=
"2dp"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/cos_skyblue5"
>
<ImageView
android:id=
"@+id/iv_gifts_logo_count"
android:layout_width=
"34dp"
android:layout_height=
"34dp"
android:src=
"@drawable/sv_gifts_redesign"
app:layout_constraintBottom_toTopOf=
"@+id/v_separator_gifts_count"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<View
android:id=
"@+id/v_separator_gifts_count"
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:layout_marginHorizontal=
"8dp"
android:background=
"@color/cos_grey2"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_gifts_count_title"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"8dp"
android:gravity=
"center"
android:includeFontPadding=
"false"
android:text=
"@string/cos_gifts_title"
android:textColor=
"@color/cos_light_black"
android:textSize=
"10sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/v_separator_gifts_count"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<LinearLayout
android:layout_width=
"16dp"
android:layout_height=
"16dp"
android:layout_alignParentEnd=
"true"
android:layout_marginTop=
"4dp"
android:layout_marginEnd=
"1dp"
android:background=
"@drawable/shape_cos_counter_orange"
android:gravity=
"center"
android:orientation=
"vertical"
android:translationZ=
"2dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
>
<TextView
android:id=
"@+id/tv_gifts_count"
android:layout_width=
"wrap_content"
android:layout_height=
"16dp"
android:includeFontPadding=
"false"
android:maxLines=
"1"
android:textColor=
"@color/cos_light_black"
android:textSize=
"12sp"
tools:text=
"6"
/>
</LinearLayout>
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_vouchers_spinner"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"14dp"
android:layout_marginTop=
"32dp"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:visibility=
"gone"
tools:visibility=
"visible"
>
<ProgressBar
android:id=
"@+id/pb_vouchers"
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:theme=
"@style/progressBarGreen"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_vouchers"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"14dp"
android:layout_marginTop=
"32dp"
android:orientation=
"vertical"
android:visibility=
"gone"
tools:visibility=
"gone"
>
<View
android:id=
"@+id/v_separator_vouchers"
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:background=
"@color/cos_gray"
/>
<TextView
android:id=
"@+id/tv_vouchers_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"24dp"
android:includeFontPadding=
"false"
android:maxLines=
"1"
android:text=
"@string/cos_vouchers_title"
android:textColor=
"@color/cos_light_black"
android:textSize=
"22sp"
/>
<androidx.cardview.widget.CardView
android:id=
"@+id/cv_vouchers"
android:layout_width=
"match_parent"
android:layout_height=
"70dp"
android:layout_marginHorizontal=
"2dp"
android:layout_marginTop=
"24dp"
android:layout_marginBottom=
"4dp"
app:cardCornerRadius=
"16dp"
app:cardElevation=
"2dp"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
>
<ImageView
android:id=
"@+id/iv_vouchers_logo"
android:layout_width=
"32dp"
android:layout_height=
"30dp"
android:layout_marginStart=
"16dp"
android:src=
"@drawable/sv_vouchers"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_vouchers_info_title"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"8dp"
android:includeFontPadding=
"false"
android:lineHeight=
"24dp"
android:text=
"@string/cos_vouchers_info_title"
android:textColor=
"@color/cos_light_black"
android:textSize=
"14sp"
app:layout_constraintBottom_toBottomOf=
"@+id/iv_vouchers_logo"
app:layout_constraintEnd_toStartOf=
"@+id/iv_vouchers_arrow"
app:layout_constraintHorizontal_bias=
"0.0"
app:layout_constraintStart_toEndOf=
"@+id/iv_vouchers_logo"
app:layout_constraintTop_toTopOf=
"@+id/iv_vouchers_logo"
/>
<ImageView
android:id=
"@+id/iv_vouchers_arrow"
android:layout_width=
"16dp"
android:layout_height=
"10dp"
android:layout_marginEnd=
"16dp"
android:rotation=
"270"
android:src=
"@drawable/sv_arrow_down"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_vouchers_disabled"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"14dp"
android:layout_marginTop=
"32dp"
android:orientation=
"vertical"
android:visibility=
"gone"
tools:visibility=
"gone"
>
<View
android:id=
"@+id/v_separator_vouchers_disabled"
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:background=
"@color/cos_gray"
/>
<TextView
android:id=
"@+id/tv_vouchers_title_disabled"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"24dp"
android:includeFontPadding=
"false"
android:maxLines=
"1"
android:text=
"@string/cos_vouchers_title"
android:textColor=
"@color/cos_light_black"
android:textSize=
"22sp"
/>
<androidx.cardview.widget.CardView
android:id=
"@+id/cv_vouchers_disabled"
android:layout_width=
"match_parent"
android:layout_height=
"70dp"
android:layout_marginHorizontal=
"2dp"
android:layout_marginTop=
"24dp"
android:layout_marginBottom=
"4dp"
app:cardCornerRadius=
"16dp"
app:cardElevation=
"2dp"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
>
<ImageView
android:id=
"@+id/iv_vouchers_logo_disabled"
android:layout_width=
"32dp"
android:layout_height=
"30dp"
android:layout_marginStart=
"16dp"
android:src=
"@drawable/sv_vouchers_disabled"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_vouchers_info_title_disabled"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"8dp"
android:includeFontPadding=
"false"
android:lineHeight=
"24dp"
android:text=
"@string/cos_vouchers_info_title_disabled"
android:textColor=
"@color/cos_gray2"
android:textSize=
"14sp"
app:layout_constraintBottom_toBottomOf=
"@+id/iv_vouchers_logo_disabled"
app:layout_constraintEnd_toStartOf=
"@+id/iv_vouchers_arrow_disabled"
app:layout_constraintHorizontal_bias=
"0.0"
app:layout_constraintStart_toEndOf=
"@+id/iv_vouchers_logo_disabled"
app:layout_constraintTop_toTopOf=
"@+id/iv_vouchers_logo_disabled"
/>
<ImageView
android:id=
"@+id/iv_vouchers_arrow_disabled"
android:layout_width=
"16dp"
android:layout_height=
"10dp"
android:layout_marginEnd=
"16dp"
android:rotation=
"270"
android:src=
"@drawable/sv_arrow_down"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<LinearLayout
android:layout_width=
"16dp"
android:layout_height=
"16dp"
android:layout_marginStart=
"2dp"
android:background=
"@drawable/shape_cos_counter_orange"
android:gravity=
"center"
android:orientation=
"vertical"
app:layout_constraintBottom_toTopOf=
"@+id/tv_vouchers_info_title_disabled"
app:layout_constraintStart_toEndOf=
"@+id/tv_vouchers_info_title_disabled"
app:layout_constraintTop_toTopOf=
"@+id/tv_vouchers_info_title_disabled"
>
<TextView
android:id=
"@+id/tv_vouchers_count_disabled"
android:layout_width=
"wrap_content"
android:layout_height=
"16dp"
android:includeFontPadding=
"false"
android:maxLines=
"1"
android:text=
"0"
android:textColor=
"@color/cos_light_black"
android:textSize=
"12sp"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_empty_wallet"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"32dp"
android:layout_marginTop=
"32dp"
android:gravity=
"center"
android:orientation=
"vertical"
android:visibility=
"gone"
tools:visibility=
"gone"
>
<ImageView
android:layout_width=
"72dp"
android:layout_height=
"72dp"
android:src=
"@drawable/ic_empty_wallet"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"8dp"
android:gravity=
"center"
android:text=
"@string/cos_empty_wallet"
android:textColor=
"@color/cos_light_black"
android:textSize=
"16sp"
/>
</LinearLayout>
<androidx.cardview.widget.CardView
android:id=
"@+id/cl_exp"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"11dp"
android:layout_marginTop=
"24dp"
android:visibility=
"gone"
app:cardCornerRadius=
"16dp"
app:cardElevation=
"2dp"
tools:visibility=
"gone"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
android:paddingHorizontal=
"14dp"
android:paddingVertical=
"14dp"
>
<androidx.constraintlayout.widget.Guideline
android:id=
"@+id/gl_horizontal_64_exp"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
app:layout_constraintGuide_percent=
"0.64"
/>
<ImageView
android:id=
"@+id/iv_exp_logo"
android:layout_width=
"76dp"
android:layout_height=
"76dp"
android:layout_marginVertical=
"4dp"
android:src=
"@drawable/ic_foryou_polygon_new"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_exp_value"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:includeFontPadding=
"false"
android:textColor=
"@color/cos_light_black"
android:textSize=
"14sp"
app:layout_constraintEnd_toEndOf=
"@+id/iv_exp_logo"
app:layout_constraintStart_toStartOf=
"@+id/iv_exp_logo"
app:layout_constraintTop_toBottomOf=
"@+id/gl_horizontal_64_exp"
tools:text=
"18.00€"
/>
<TextView
android:id=
"@+id/tv_exp_value_all"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"8dp"
android:includeFontPadding=
"false"
android:text=
"@string/cos_for_you_all"
android:textColor=
"@color/cos_light_black"
android:textSize=
"15sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@+id/iv_exp_arrow"
app:layout_constraintStart_toEndOf=
"@+id/iv_exp_logo"
app:layout_constraintTop_toTopOf=
"parent"
/>
<ImageView
android:id=
"@+id/iv_exp_arrow"
android:layout_width=
"14dp"
android:layout_height=
"14dp"
android:src=
"@drawable/ic_down_dark_new"
android:visibility=
"gone"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<net.cachapa.expandablelayout.ExpandableLayout
android:id=
"@+id/el_exp"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:el_duration=
"300"
app:el_expanded=
"false"
app:el_parallax=
"0.5"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<androidx.cardview.widget.CardView
android:id=
"@+id/cv_deals_win_inner_cos"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"16dp"
android:layout_marginTop=
"6dp"
app:cardCornerRadius=
"16dp"
app:cardElevation=
"2dp"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/cl_deals_win_inner_cos"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
android:paddingHorizontal=
"6dp"
android:paddingVertical=
"4dp"
>
<androidx.constraintlayout.widget.Guideline
android:id=
"@+id/gl_horizontal_50_cos"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
app:layout_constraintGuide_percent=
"0.64"
/>
<ImageView
android:id=
"@+id/iv_deals_logo"
android:layout_width=
"76dp"
android:layout_height=
"76dp"
android:src=
"@drawable/ic_deals_polygon_new"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_deals_value_all"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"8dp"
android:includeFontPadding=
"false"
android:text=
"@string/cos_deals_win_title_cos"
android:textColor=
"@color/cos_light_black"
android:textSize=
"15sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@+id/iv_deals_logo"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_deals_value"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:includeFontPadding=
"false"
android:textColor=
"@color/cos_light_black"
android:textSize=
"14sp"
app:layout_constraintEnd_toEndOf=
"@+id/iv_deals_logo"
app:layout_constraintStart_toStartOf=
"@+id/iv_deals_logo"
app:layout_constraintTop_toBottomOf=
"@+id/gl_horizontal_50_cos"
tools:text=
"18.00€"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id=
"@+id/cv_deals_win_inner"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/cv_deals_win_inner_cos"
android:layout_marginHorizontal=
"16dp"
android:layout_marginTop=
"6dp"
app:cardCornerRadius=
"16dp"
app:cardElevation=
"2dp"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/cl_deals_win_inner"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
android:paddingHorizontal=
"6dp"
android:paddingVertical=
"4dp"
>
<androidx.constraintlayout.widget.Guideline
android:id=
"@+id/gl_horizontal_50"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
app:layout_constraintGuide_percent=
"0.64"
/>
<ImageView
android:id=
"@+id/iv_gifts_logo"
android:layout_width=
"76dp"
android:layout_height=
"76dp"
android:src=
"@drawable/ic_gifts_polygon_new"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_gifts_value_all"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"8dp"
android:includeFontPadding=
"false"
android:text=
"@string/cos_deals_win_title"
android:textColor=
"@color/cos_light_black"
android:textSize=
"15sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@+id/iv_gifts_logo"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_gifts_value"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:includeFontPadding=
"false"
android:textColor=
"@color/cos_light_black"
android:textSize=
"14sp"
app:layout_constraintEnd_toEndOf=
"@+id/iv_gifts_logo"
app:layout_constraintStart_toStartOf=
"@+id/iv_gifts_logo"
app:layout_constraintTop_toBottomOf=
"@+id/gl_horizontal_50"
tools:text=
"20.00€"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id=
"@+id/cv_market_inner"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/cv_deals_win_inner"
android:layout_marginHorizontal=
"16dp"
android:layout_marginTop=
"6dp"
android:layout_marginBottom=
"6dp"
app:cardCornerRadius=
"16dp"
app:cardElevation=
"2dp"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/cl_market_inner"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
android:paddingHorizontal=
"6dp"
android:paddingVertical=
"4dp"
>
<androidx.constraintlayout.widget.Guideline
android:id=
"@+id/gl_horizontal_50_market"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
app:layout_constraintGuide_percent=
"0.64"
/>
<ImageView
android:id=
"@+id/iv_market_logo"
android:layout_width=
"76dp"
android:layout_height=
"76dp"
android:src=
"@drawable/ic_market_polygon"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_market_value_all"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"8dp"
android:includeFontPadding=
"false"
android:text=
"@string/cos_supermarket_win"
android:textColor=
"@color/cos_light_black"
android:textSize=
"15sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@+id/iv_market_logo"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_market_value"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:includeFontPadding=
"false"
android:textColor=
"@color/cos_light_black"
android:textSize=
"14sp"
app:layout_constraintEnd_toEndOf=
"@+id/iv_market_logo"
app:layout_constraintStart_toStartOf=
"@+id/iv_market_logo"
app:layout_constraintTop_toBottomOf=
"@+id/gl_horizontal_50_market"
tools:text=
"20.00€"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>
</net.cachapa.expandablelayout.ExpandableLayout>
<LinearLayout
android:id=
"@+id/ll_market_view"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"20dp"
android:orientation=
"vertical"
android:visibility=
"gone"
tools:visibility=
"gone"
>
<TextView
android:id=
"@+id/tv_market_header"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"start"
android:layout_marginHorizontal=
"16dp"
android:layout_marginBottom=
"10dp"
android:text=
"@string/cos_market_title"
android:textColor=
"@color/cos_light_blue"
android:textSize=
"19sp"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_market_coupons"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"2dp"
android:overScrollMode=
"never"
android:scrollbars=
"none"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_mygifts"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"24dp"
android:orientation=
"vertical"
android:visibility=
"gone"
tools:visibility=
"gone"
>
<ImageView
android:id=
"@+id/dfy_logo"
android:layout_width=
"200dp"
android:layout_height=
"30dp"
android:layout_gravity=
"start"
android:layout_marginHorizontal=
"16dp"
android:src=
"@drawable/ic_deals_horizontal"
/>
<androidx.cardview.widget.CardView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"11dp"
android:layout_marginTop=
"8dp"
android:layout_marginBottom=
"6dp"
android:paddingVertical=
"10dp"
app:cardCornerRadius=
"16dp"
app:cardElevation=
"2dp"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/cl_mygifts"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
android:paddingVertical=
"8dp"
>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"20dp"
android:layout_marginEnd=
"24dp"
android:orientation=
"vertical"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@+id/iv_deals_circle"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
>
<TextView
android:id=
"@+id/tv_active_gifts"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"@color/cos_light_black"
android:textSize=
"18sp"
tools:text=
"@string/cos_active_deals"
/>
<TextView
android:id=
"@+id/tv_active_deals_text"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:ellipsize=
"end"
android:maxLines=
"2"
android:textColor=
"@color/cos_light_black"
android:textIsSelectable=
"true"
android:textSize=
"18sp"
tools:text=
"961544809"
tools:visibility=
"gone"
/>
<ScrollView
android:id=
"@+id/sv_active_deals_codes_view"
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:nestedScrollingEnabled=
"true"
android:visibility=
"gone"
>
<org.apmem.tools.layouts.FlowLayout
android:id=
"@+id/ll_active_deals_codes_view"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:visibility=
"gone"
>
</org.apmem.tools.layouts.FlowLayout>
</ScrollView>
<TextView
android:id=
"@+id/tv_active_deals_date_text"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"@color/cos_light_black"
android:visibility=
"gone"
tools:text=
"@string/cos_active_coupon_date"
/>
</LinearLayout>
<ImageView
android:id=
"@+id/iv_deals_circle"
android:layout_width=
"86dp"
android:layout_height=
"86dp"
android:layout_marginVertical=
"4dp"
android:layout_marginEnd=
"20dp"
android:src=
"@drawable/ic_deals_new"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_gifts_view"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"24dp"
android:orientation=
"vertical"
android:visibility=
"gone"
tools:visibility=
"gone"
>
<TextView
android:id=
"@+id/tv_active_coupons_header"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"start"
android:layout_marginHorizontal=
"16dp"
android:layout_marginBottom=
"10dp"
android:text=
"@string/cos_gifts_title"
android:textColor=
"@color/cos_light_blue"
android:textSize=
"19sp"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_active_coupons"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"2dp"
android:overScrollMode=
"never"
android:paddingBottom=
"40dp"
android:scrollbars=
"none"
/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>
warply_android_sdk/src/main/res/values/attrs.xml
View file @
81e9312
...
...
@@ -5,6 +5,7 @@
<attr
name=
"dashLength"
format=
"dimension"
/>
<attr
name=
"dashGap"
format=
"dimension"
/>
<attr
name=
"dashThickness"
format=
"dimension"
/>
<attr
name=
"colorPrimary"
format=
"color"
/>
<attr
name=
"orientation"
format=
"enum"
>
<enum
name=
"horizontal"
value=
"0"
/>
<enum
name=
"vertical"
value=
"1"
/>
...
...
Please
register
or
login
to post a comment