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
2023-07-18 17:37:11 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ff00e749bdb0751ada1063ff3c1b5544c9641ca0
ff00e749
1 parent
0057d46b
sm deals fixes
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
12 deletions
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponInfoActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/UnifiedCouponInfoActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/Coupon.java
warply_android_sdk/build.gradle
View file @
ff00e74
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4.6rc6
4
'
PUBLISH_VERSION
=
'4.5.4.6rc6
5
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponInfoActivity.java
View file @
ff00e74
...
...
@@ -59,7 +59,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
private
Coupon
mCoupon
;
private
Couponset
mCouponset
;
private
boolean
mIsBarcodeShown
=
false
,
mIsTermsShown
=
false
,
mIsFromWallet
=
false
,
mShopsPressed
=
false
,
mGiftPressed
=
false
,
mEshopPressed
=
false
;
mShopsPressed
=
false
,
mGiftPressed
=
false
,
mEshopPressed
=
false
,
mIsUnified
=
false
;
private
Merchant
mMerchant
;
// ===========================================================
...
...
@@ -73,6 +73,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
mCoupon
=
(
Coupon
)
getIntent
().
getSerializableExtra
(
"coupon"
);
mIsFromWallet
=
getIntent
().
getBooleanExtra
(
"isFromWallet"
,
false
);
mIsUnified
=
getIntent
().
getBooleanExtra
(
"isUnified"
,
false
);
mIvBack
=
findViewById
(
R
.
id
.
iv_coupon_info_back
);
mTvTerms
=
findViewById
(
R
.
id
.
tv_terms
);
...
...
@@ -213,7 +214,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
// ===========================================================
private
void
initViews
()
{
if
(
mIs
FromWallet
)
{
if
(
mIs
Unified
)
{
mTvCouponCodeTitle
.
setVisibility
(
View
.
GONE
);
mTvCouponCode
.
setVisibility
(
View
.
GONE
);
mLlGiftIt
.
setVisibility
(
View
.
GONE
);
...
...
@@ -222,8 +223,12 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
mLlBarcodeContainer
.
setVisibility
(
View
.
GONE
);
mIvBarcode
.
setVisibility
(
View
.
GONE
);
mTvCouponCode
.
setText
(
mCoupon
.
getCoupon
());
mTvCouponTitle
.
setText
(
mCoupon
.
getName
());
if
(
mIsUnified
)
{
mTvCouponTitle
.
setText
(
HtmlCompat
.
fromHtml
(
mCoupon
.
getInnerText
(),
HtmlCompat
.
FROM_HTML_MODE_COMPACT
));
}
else
{
mTvCouponCode
.
setText
(
mCoupon
.
getCoupon
());
mTvCouponTitle
.
setText
(
mCoupon
.
getName
());
}
// mTvCouponSubtitle.setText(mCoupon.getDescription());
if
(
WarplyManagerHelper
.
getCouponsets
()
!=
null
&&
WarplyManagerHelper
.
getCouponsets
().
size
()
>
0
)
{
...
...
@@ -274,12 +279,12 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
}
}
if
(
mMerchant
!=
null
&&
!
TextUtils
.
isEmpty
(
mMerchant
.
getBody
())
&&
!
mMerchant
.
getBody
().
equals
(
"null"
))
{
mTvDescription
.
setText
(
HtmlCompat
.
fromHtml
(
mMerchant
.
getBody
(),
HtmlCompat
.
FROM_HTML_MODE_COMPACT
));
mTvDescription
.
setMovementMethod
(
LinkMovementMethod
.
getInstance
());
}
else
{
mTvDescription
.
setVisibility
(
View
.
GONE
);
}
//
if (mMerchant != null && !TextUtils.isEmpty(mMerchant.getBody()) && !mMerchant.getBody().equals("null")) {
//
mTvDescription.setText(HtmlCompat.fromHtml(mMerchant.getBody(), HtmlCompat.FROM_HTML_MODE_COMPACT));
//
mTvDescription.setMovementMethod(LinkMovementMethod.getInstance());
//
} else {
mTvDescription
.
setVisibility
(
View
.
GONE
);
//
}
// if (mMerchant != null) {
// if (mMerchant.getExtraFields() != null && mMerchant.getExtraFields().has("show_map") && (mMerchant.getExtraFields().optBoolean("show_map") || mMerchant.getExtraFields().optString("show_map").equals("true"))) {
...
...
@@ -291,7 +296,11 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
// }
}
mTvCouponSubtitle
.
setText
(
mCoupon
.
getShort_description
());
if
(
mIsUnified
)
{
mTvCouponSubtitle
.
setText
(
HtmlCompat
.
fromHtml
(
mCoupon
.
getDescription
(),
HtmlCompat
.
FROM_HTML_MODE_COMPACT
));
}
else
{
mTvCouponSubtitle
.
setText
(
mCoupon
.
getShort_description
());
}
mTvTermsValue
.
setText
(
HtmlCompat
.
fromHtml
(
mCoupon
.
getTerms
(),
HtmlCompat
.
FROM_HTML_MODE_COMPACT
));
mTvTermsValue
.
setMovementMethod
(
LinkMovementMethod
.
getInstance
());
}
...
...
@@ -308,6 +317,12 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
mTvCouponDate
.
setText
(
String
.
format
(
getResources
().
getString
(
R
.
string
.
cos_mycoupon_date
),
simpleDateFormat
.
format
(
newDate
!=
null
?
newDate
:
""
)));
if
(!
TextUtils
.
isEmpty
(
mCoupon
.
getImage
()))
{
if
(
mIsUnified
)
{
mIvCouponPhoto
.
setScaleType
(
ImageView
.
ScaleType
.
CENTER_INSIDE
);
}
else
{
mIvCouponPhoto
.
setScaleType
(
ImageView
.
ScaleType
.
CENTER_CROP
);
}
Glide
.
with
(
this
)
// .setDefaultRequestOptions(
// RequestOptions
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/UnifiedCouponInfoActivity.java
View file @
ff00e74
...
...
@@ -213,6 +213,7 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL
Intent
intent
=
new
Intent
(
UnifiedCouponInfoActivity
.
this
,
CouponInfoActivity
.
class
);
intent
.
putExtra
(
"coupon"
,
(
Serializable
)
coupon
);
intent
.
putExtra
(
"isFromWallet"
,
true
);
intent
.
putExtra
(
"isUnified"
,
true
);
startActivity
(
intent
);
}
})
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/Coupon.java
View file @
ff00e74
...
...
@@ -145,6 +145,9 @@ public class Coupon implements Parcelable, Serializable {
this
.
created
=
json
.
optString
(
CREATED
);
this
.
description
=
json
.
optString
(
DESCRIPTION
);
this
.
discount
=
json
.
optString
(
DISCOUNT
);
if
(
this
.
discount
.
contains
(
","
))
{
this
.
discount
=
this
.
discount
.
replace
(
","
,
"."
);
}
this
.
expiration
=
json
.
optString
(
EXPIRATION
);
this
.
image
=
json
.
optString
(
IMAGE
);
this
.
name
=
json
.
optString
(
NAME
);
...
...
Please
register
or
login
to post a comment