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-10-16 17:50:29 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cc4e0c149e1ac0cfddb5feea6569c10f94546504
cc4e0c14
1 parent
b444967a
unified screen basket part3
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
61 additions
and
15 deletions
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/activities/ActiveUnifiedCouponsActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponInfoActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
warply_android_sdk/src/main/res/values/strings.xml
warply_android_sdk/build.gradle
View file @
cc4e0c1
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.5.4r3
7
'
PUBLISH_VERSION
=
'4.5.5.4r3
8
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/ActiveUnifiedCouponsActivity.java
View file @
cc4e0c1
...
...
@@ -11,6 +11,7 @@ import android.widget.LinearLayout;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
androidx.appcompat.app.AlertDialog
;
import
androidx.constraintlayout.widget.ConstraintLayout
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
...
...
@@ -63,6 +64,7 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli
private
ActiveCouponAdapter
mAdapterCoupons
;
private
Set
<
Coupon
>
mSelectedItems
=
new
HashSet
<>();
private
LinearLayout
mLlActivateunified
;
private
AlertDialog
mAlertDialog
;
// ===========================================================
// Methods for/from SuperClass/Interfaces
...
...
@@ -258,8 +260,7 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli
Intent
intent
=
new
Intent
(
ActiveUnifiedCouponsActivity
.
this
,
CouponInfoActivity
.
class
);
intent
.
putExtra
(
"coupon"
,
coupon
.
getCoupon
());
intent
.
putExtra
(
"isFromWallet"
,
true
);
// intent.putExtra("isUnified", true);
// intent.putExtra("unifiedCoupon", coupon.getBarcode());
intent
.
putExtra
(
"isActiveUnified"
,
true
);
startActivity
(
intent
);
}
})
...
...
@@ -321,11 +322,29 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli
mIvChooseAll
.
setBackgroundResource
(
R
.
drawable
.
ic_circle_gray
);
mLlActivateunified
.
setBackgroundResource
(
R
.
drawable
.
selector_button_grey_dark
);
mSelectedItems
.
clear
();
if
(!
isFinishing
())
{
mAlertDialog
=
new
AlertDialog
.
Builder
(
ActiveUnifiedCouponsActivity
.
this
)
.
setTitle
(
R
.
string
.
cos_dlg_success_unified_title
)
.
setMessage
(
R
.
string
.
cos_dlg_success_unified_subtitle
)
.
setPositiveButton
(
R
.
string
.
cos_dlg_positive_button2
,
(
dialogPositive
,
whichPositive
)
->
{
dialogPositive
.
dismiss
();
})
.
show
();
}
}
@Override
public
void
onFailure
(
int
errorCode
)
{
if
(!
isFinishing
())
{
mAlertDialog
=
new
AlertDialog
.
Builder
(
ActiveUnifiedCouponsActivity
.
this
)
.
setTitle
(
R
.
string
.
cos_dlg_error_unified_title
)
.
setMessage
(
R
.
string
.
cos_dlg_error_subtitle
)
.
setPositiveButton
(
R
.
string
.
cos_dlg_positive_button2
,
(
dialogPositive
,
whichPositive
)
->
{
dialogPositive
.
dismiss
();
})
.
show
();
}
}
};
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponInfoActivity.java
View file @
cc4e0c1
...
...
@@ -56,7 +56,8 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
private
LinearLayout
mLlGiftIt
,
mLlShops
,
mLlBarcodeShown
,
mLlBarcodeContainer
,
mLlTerms
,
mLlWebsite
;
private
Coupon
mCoupon
;
private
boolean
mIsBarcodeShown
=
false
,
mIsTermsShown
=
false
,
mIsFromWallet
=
false
,
mShopsPressed
=
false
,
mGiftPressed
=
false
,
mEshopPressed
=
false
,
mIsUnified
=
false
;
mShopsPressed
=
false
,
mGiftPressed
=
false
,
mEshopPressed
=
false
,
mIsUnified
=
false
,
mIsActiveUnified
=
false
;
// ===========================================================
// Methods for/from SuperClass/Interfaces
...
...
@@ -70,6 +71,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
String
couponCode
=
getIntent
().
getStringExtra
(
"coupon"
);
mIsFromWallet
=
getIntent
().
getBooleanExtra
(
"isFromWallet"
,
false
);
mIsUnified
=
getIntent
().
getBooleanExtra
(
"isUnified"
,
false
);
mIsActiveUnified
=
getIntent
().
getBooleanExtra
(
"isActiveUnified"
,
false
);
if
(
mIsUnified
)
{
String
couponUnifiedCode
=
getIntent
().
getStringExtra
(
"unifiedCoupon"
);
...
...
@@ -85,10 +87,19 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
}
}
}
else
{
for
(
Coupon
cpn
:
WarplyManagerHelper
.
getCouponList
())
{
if
(
cpn
.
getCoupon
().
equals
(
couponCode
))
{
mCoupon
=
cpn
;
break
;
if
(
mIsActiveUnified
)
{
for
(
Coupon
cpn
:
WarplyManagerHelper
.
getSmCouponsList
())
{
if
(
cpn
.
getCoupon
().
equals
(
couponCode
))
{
mCoupon
=
cpn
;
break
;
}
}
}
else
{
for
(
Coupon
cpn
:
WarplyManagerHelper
.
getCouponList
())
{
if
(
cpn
.
getCoupon
().
equals
(
couponCode
))
{
mCoupon
=
cpn
;
break
;
}
}
}
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
View file @
cc4e0c1
...
...
@@ -1369,7 +1369,7 @@ public class WarplyManagerHelper {
mCouponRedeemedList
.
addAll
(
couponRedeemedList
);
}
public
static
void
setSmCouponsList
(
CouponList
couponRedeemedList
)
{
public
static
void
setSmCouponsList
(
ArrayList
<
Coupon
>
couponRedeemedList
)
{
mSmCouponsList
.
clear
();
mSmCouponsList
.
addAll
(
couponRedeemedList
);
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
View file @
cc4e0c1
...
...
@@ -56,6 +56,8 @@ import java.text.SimpleDateFormat;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.HashSet
;
import
java.util.Iterator
;
import
java.util.LinkedHashSet
;
import
java.util.List
;
import
java.util.Locale
;
...
...
@@ -3264,14 +3266,25 @@ public class WarplyManager {
Futures
.
addCallback
(
mergedResultFuture
,
new
FutureCallback
<
CouponList
>()
{
@Override
public
void
onSuccess
(
CouponList
mergedResult
)
{
CouponList
mfinalActiveSMCoupons
=
new
CouponList
();
for
(
Coupon
mergedItem
:
mergedResult
)
{
for
(
Coupon
tempItem
:
mTempActiveSMCoupons
)
{
if
(
!
mergedItem
.
getCoupon
().
equals
(
tempItem
.
getCoupon
()))
{
mfinalActiveSMCoupons
.
add
(
mergedItem
);
HashSet
<
String
>
commonIds
=
new
HashSet
<>
();
for
(
Coupon
c1
:
mergedResult
)
{
for
(
Coupon
c2
:
mTempActiveSMCoupons
)
{
if
(
c1
.
getCoupon
().
equals
(
c2
.
getCoupon
()))
{
commonIds
.
add
(
c1
.
getCoupon
()
);
}
}
}
HashSet
<
Coupon
>
allItems
=
new
HashSet
<>(
mergedResult
);
allItems
.
addAll
(
mTempActiveSMCoupons
);
Iterator
<
Coupon
>
iterator
=
allItems
.
iterator
();
while
(
iterator
.
hasNext
())
{
Coupon
coupon
=
iterator
.
next
();
if
(
commonIds
.
contains
(
coupon
.
getCoupon
()))
{
iterator
.
remove
();
// Remove items with common 'id'
}
}
ArrayList
<
Coupon
>
mfinalActiveSMCoupons
=
new
ArrayList
<>(
allItems
);
WarplyManagerHelper
.
setSmCouponsList
(
mfinalActiveSMCoupons
);
executorService
.
shutdownNow
();
}
...
...
warply_android_sdk/src/main/res/values/strings.xml
View file @
cc4e0c1
...
...
@@ -46,6 +46,9 @@
<string
name=
"cos_redeem_coupon2"
>
Απόκτησέ το δωρεάν
</string>
<string
name=
"cos_dlg_success_subtitle"
>
Το κουπόνι εξαργυρώθηκε με επιτυχία
</string>
<string
name=
"cos_dlg_error_title"
>
Αποτυχία
</string>
<string
name=
"cos_dlg_error_unified_title"
>
Αποτυχία Δημιουργίας Κουπονιού
</string>
<string
name=
"cos_dlg_success_unified_title"
>
Δημιουργία Κουπονιού
</string>
<string
name=
"cos_dlg_success_unified_subtitle"
>
Το ενιαίο κουπόνι σου δημιουργήθηκε επιτυχώς.
</string>
<string
name=
"cos_dlg_error_title2"
>
Αποτυχία αποστολής
</string>
<string
name=
"cos_dlg_return_title"
>
Επιστροφή δώρου
</string>
<string
name=
"cos_dlg_error_subtitle"
>
Κάτι πήγε στραβά
</string>
...
...
Please
register
or
login
to post a comment