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-04-25 12:56:26 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
519311f98f62d5d658c7da7ce3559f372afb4d54
519311f9
1 parent
ba851c00
redesign supermarket part2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
30 additions
and
40 deletions
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyWallet.java
warply_android_sdk/src/main/res/drawable-xhdpi/unified_coupon_banner.jpg
warply_android_sdk/src/main/res/layout/activity_coupon_info.xml
warply_android_sdk/src/main/res/layout/activity_loyalty_wallet.xml
warply_android_sdk/src/main/res/layout/activity_unified_coupon_info.xml
warply_android_sdk/src/main/res/layout/custom_coupon_layout.xml
warply_android_sdk/src/main/res/layout/market_coupon_layout.xml
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyWallet.java
View file @
519311f
...
...
@@ -461,15 +461,9 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
String
badgeValueFirst
=
String
.
format
(
"%.02f"
,
WarplyManagerHelper
.
getDealsCouponsSum
());
mTvDealsValue
.
setText
(
String
.
format
(
getString
(
R
.
string
.
cos_value
),
badgeValueFirst
));
SpannableStringBuilder
sBuilder
=
new
SpannableStringBuilder
();
sBuilder
.
append
(
getString
(
R
.
string
.
cos_wallet_text1
))
.
append
(
String
.
format
(
getString
(
R
.
string
.
cos_value
),
String
.
valueOf
(
WarplyManagerHelper
.
getDealsCouponsSum
())))
.
append
(
getString
(
R
.
string
.
cos_wallet_text2
));
CalligraphyTypefaceSpan
typefaceRegularSpan
=
new
CalligraphyTypefaceSpan
(
TypefaceUtils
.
load
(
getAssets
(),
"fonts/PeridotPE-Regular.ttf"
));
CalligraphyTypefaceSpan
typefaceBoldSpan
=
new
CalligraphyTypefaceSpan
(
TypefaceUtils
.
load
(
getAssets
(),
"fonts/PeridotPE-Bold.ttf"
));
sBuilder
.
setSpan
(
typefaceRegularSpan
,
0
,
getString
(
R
.
string
.
cos_wallet_text1
).
length
(),
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
);
sBuilder
.
setSpan
(
typefaceRegularSpan
,
getString
(
R
.
string
.
cos_wallet_text1
).
length
()
+
String
.
valueOf
(
WarplyManagerHelper
.
getDealsCouponsSum
()).
length
(),
getString
(
R
.
string
.
cos_wallet_text1
).
length
()
+
String
.
valueOf
(
WarplyManagerHelper
.
getDealsCouponsSum
()).
length
()
+
getString
(
R
.
string
.
cos_wallet_text2
).
length
(),
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
);
sBuilder
.
setSpan
(
typefaceBoldSpan
,
getString
(
R
.
string
.
cos_wallet_text1
).
length
(),
getString
(
R
.
string
.
cos_wallet_text1
).
length
()
+
String
.
valueOf
(
WarplyManagerHelper
.
getDealsCouponsSum
()).
length
()
+
1
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
);
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
();
...
...
@@ -478,22 +472,9 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
String
badgeValue
=
String
.
format
(
"%.02f"
,
WarplyManagerHelper
.
getLoyaltyBadge
().
getValue
());
mTvGiftsValue
.
setText
(
String
.
format
(
getString
(
R
.
string
.
cos_value
),
badgeValue
));
SpannableStringBuilder
sBuilderSecond
=
new
SpannableStringBuilder
();
sBuilderSecond
.
append
(
getString
(
R
.
string
.
cos_wallet_text3
))
.
append
(
String
.
format
(
getString
(
R
.
string
.
cos_value
),
badgeValue
))
.
append
(
getString
(
R
.
string
.
cos_wallet_text4
))
.
append
(
String
.
format
(
getString
(
R
.
string
.
cos_value2
),
String
.
valueOf
(
WarplyManagerHelper
.
getLoyaltyBadge
().
getCouponCount
())))
.
append
(
getString
(
R
.
string
.
cos_wallet_text5
));
CalligraphyTypefaceSpan
typefaceRegularSpanSecond
=
new
CalligraphyTypefaceSpan
(
TypefaceUtils
.
load
(
getAssets
(),
"fonts/PeridotPE-Regular.ttf"
));
CalligraphyTypefaceSpan
typefaceRegularSpan2
=
new
CalligraphyTypefaceSpan
(
TypefaceUtils
.
load
(
getAssets
(),
"fonts/PeridotPE-Regular.ttf"
));
CalligraphyTypefaceSpan
typefaceRegularSpan3
=
new
CalligraphyTypefaceSpan
(
TypefaceUtils
.
load
(
getAssets
(),
"fonts/PeridotPE-Regular.ttf"
));
sBuilderSecond
.
append
(
String
.
format
(
getString
(
R
.
string
.
cos_deals_win_title
),
badgeValue
));
CalligraphyTypefaceSpan
typefaceBoldSpanSecond
=
new
CalligraphyTypefaceSpan
(
TypefaceUtils
.
load
(
getAssets
(),
"fonts/PeridotPE-Bold.ttf"
));
CalligraphyTypefaceSpan
typefaceBoldSpan2
=
new
CalligraphyTypefaceSpan
(
TypefaceUtils
.
load
(
getAssets
(),
"fonts/PeridotPE-Bold.ttf"
));
sBuilderSecond
.
setSpan
(
typefaceRegularSpanSecond
,
0
,
getString
(
R
.
string
.
cos_wallet_text3
).
length
(),
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
);
sBuilderSecond
.
setSpan
(
typefaceBoldSpanSecond
,
getString
(
R
.
string
.
cos_wallet_text3
).
length
(),
getString
(
R
.
string
.
cos_wallet_text3
).
length
()
+
badgeValue
.
length
()
+
1
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
);
sBuilderSecond
.
setSpan
(
typefaceRegularSpan2
,
getString
(
R
.
string
.
cos_wallet_text3
).
length
()
+
badgeValue
.
length
()
+
1
,
getString
(
R
.
string
.
cos_wallet_text3
).
length
()
+
badgeValue
.
length
()
+
1
+
getString
(
R
.
string
.
cos_wallet_text4
).
length
(),
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
);
sBuilderSecond
.
setSpan
(
typefaceBoldSpan2
,
getString
(
R
.
string
.
cos_wallet_text3
).
length
()
+
badgeValue
.
length
()
+
1
+
getString
(
R
.
string
.
cos_wallet_text4
).
length
(),
getString
(
R
.
string
.
cos_wallet_text3
).
length
()
+
badgeValue
.
length
()
+
1
+
getString
(
R
.
string
.
cos_wallet_text4
).
length
()
+
String
.
valueOf
(
WarplyManagerHelper
.
getLoyaltyBadge
().
getCouponCount
()).
length
(),
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
);
sBuilderSecond
.
setSpan
(
typefaceRegularSpan3
,
getString
(
R
.
string
.
cos_wallet_text3
).
length
()
+
1
+
badgeValue
.
length
()
+
1
+
getString
(
R
.
string
.
cos_wallet_text4
).
length
()
+
String
.
valueOf
(
WarplyManagerHelper
.
getLoyaltyBadge
().
getCouponCount
()).
length
(),
getString
(
R
.
string
.
cos_wallet_text3
).
length
()
+
badgeValue
.
length
()
+
1
+
getString
(
R
.
string
.
cos_wallet_text4
).
length
()
+
String
.
valueOf
(
WarplyManagerHelper
.
getLoyaltyBadge
().
getCouponCount
()).
length
()
+
getString
(
R
.
string
.
cos_wallet_text5
).
length
(),
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
);
sBuilderSecond
.
setSpan
(
typefaceBoldSpanSecond
,
15
,
16
+
badgeValue
.
length
(),
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
);
mTvGiftsValueAll
.
setText
(
sBuilderSecond
,
TextView
.
BufferType
.
SPANNABLE
);
mFavValue
+=
WarplyManagerHelper
.
getLoyaltyBadge
().
getValue
();
}
...
...
@@ -511,13 +492,13 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
}
}
mFavValue
+=
countValue
;
if
(
countValue
>
0
)
{
String
badgeValue
=
String
.
format
(
"%.02f"
,
countValue
);
mTvMarketValue
.
setText
(
String
.
format
(
getString
(
R
.
string
.
cos_value
),
badgeValue
));
}
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
{
String
badgeValue
=
String
.
format
(
"%.02f"
,
0.0f
);
mTvMarketValue
.
setText
(
String
.
format
(
getString
(
R
.
string
.
cos_value
),
badgeValue
));
...
...
@@ -526,6 +507,12 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
// Sum Expandable Banner
String
allValue
=
String
.
format
(
"%.02f"
,
mFavValue
);
mTvFavValue
.
setText
(
String
.
format
(
getString
(
R
.
string
.
cos_value
),
allValue
));
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
);
if
(
WarplyManagerHelper
.
getActiveDFYCoupons
()
!=
null
&&
WarplyManagerHelper
.
getActiveDFYCoupons
().
size
()
>
0
)
{
String
codes
=
""
;
...
...
@@ -613,14 +600,14 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
if
(
mLlMarketView
.
getVisibility
()
==
View
.
GONE
&&
WarplyManagerHelper
.
getDealsCouponsSum
()
==
0
&&
(
WarplyManagerHelper
.
getLoyaltyBadge
()
!=
null
&&
WarplyManagerHelper
.
getLoyaltyBadge
().
getCouponCount
()
==
0
)
&&
mLlDeals
.
getVisibility
()
==
View
.
GONE
)
{
&&
countValue
==
0
)
{
mIvExpArrow
.
setVisibility
(
View
.
GONE
);
// mLlEmptyWallet.setVisibility(View.VISIBLE);
mIsStayCollapsed
=
true
;
}
else
{
mIvExpArrow
.
setVisibility
(
View
.
VISIBLE
);
mIsStayCollapsed
=
false
;
}
//TODO: change the case
}
mIvBack
.
setOnClickListener
(
this
);
mLlQuestionnaire
.
setOnClickListener
(
this
);
...
...
warply_android_sdk/src/main/res/drawable-xhdpi/unified_coupon_banner.jpg
0 → 100644
View file @
519311f
456 KB
warply_android_sdk/src/main/res/layout/activity_coupon_info.xml
View file @
519311f
...
...
@@ -3,13 +3,13 @@
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@
android:
color/white"
>
android:background=
"@color/white"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/cl_loyalty_wallet_header"
android:layout_width=
"match_parent"
android:layout_height=
"64dp"
android:background=
"@
android:
color/white"
>
android:background=
"@color/white"
>
<ImageView
android:id=
"@+id/iv_coupon_info_back"
...
...
@@ -119,7 +119,7 @@
android:gravity=
"center"
android:textColor=
"@color/cos_light_black"
android:textIsSelectable=
"true"
android:textSize=
"25
d
p"
android:textSize=
"25
s
p"
tools:text=
"1A2C378"
/>
<LinearLayout
...
...
@@ -208,6 +208,7 @@
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginTop=
"24dp"
android:textSize=
"16sp"
android:textColor=
"@color/cos_gray"
tools:text=
"@string/cos_coupon_date"
/>
...
...
@@ -289,7 +290,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginTop=
"
32
dp"
android:layout_marginTop=
"
24
dp"
android:gravity=
"center"
>
<LinearLayout
...
...
@@ -326,11 +327,11 @@
android:layout_below=
"@+id/ll_terms_inner"
android:layout_marginHorizontal=
"32dp"
android:layout_marginTop=
"16dp"
android:textSize=
"16sp"
android:textColor=
"@color/cos_gray"
android:textSize=
"16sp"
android:visibility=
"gone"
tools:text=
"@string/cos_coupon_date"
tools:visibility=
"visible"
/>
tools:visibility=
"visible"
/>
</RelativeLayout>
</LinearLayout>
</ScrollView>
...
...
warply_android_sdk/src/main/res/layout/activity_loyalty_wallet.xml
View file @
519311f
...
...
@@ -141,7 +141,9 @@
android:layout_marginTop=
"24dp"
android:background=
"@drawable/shape_cos_white_border"
android:paddingHorizontal=
"14dp"
android:paddingVertical=
"14dp"
>
android:paddingVertical=
"14dp"
android:visibility=
"gone"
tools:visibility=
"visible"
>
<androidx.constraintlayout.widget.Guideline
android:id=
"@+id/gl_horizontal_64_exp"
...
...
warply_android_sdk/src/main/res/layout/activity_unified_coupon_info.xml
View file @
519311f
This diff is collapsed. Click to expand it.
warply_android_sdk/src/main/res/layout/custom_coupon_layout.xml
View file @
519311f
...
...
@@ -4,7 +4,7 @@
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/cl_custom_layout"
android:layout_width=
"match_parent"
android:layout_height=
"1
3
0dp"
android:layout_height=
"1
5
0dp"
android:layout_marginHorizontal=
"4dp"
android:layout_marginVertical=
"4dp"
android:background=
"@drawable/ic_coupon_background"
>
...
...
warply_android_sdk/src/main/res/layout/market_coupon_layout.xml
View file @
519311f
...
...
@@ -3,7 +3,7 @@
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"1
3
0dp"
android:layout_height=
"1
5
0dp"
android:layout_marginHorizontal=
"4dp"
android:layout_marginVertical=
"4dp"
android:background=
"@drawable/ic_coupon_background_new2"
>
...
...
Please
register
or
login
to post a comment