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
thkouk00
2022-03-23 14:45:18 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8f510373bf3155e92bc123fd1e7a9733dbb92db0
8f510373
1 parent
e22b2346
home coupon recycler added v2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
34 deletions
warply_android_sdk/src/main/java/ly/warp/sdk/fragments/HomeFragment.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/HomeCouponAdapter.java
warply_android_sdk/src/main/res/layout/coupon_layout.xml
warply_android_sdk/src/main/res/layout/fragment_home.xml
warply_android_sdk/src/main/java/ly/warp/sdk/fragments/HomeFragment.java
View file @
8f51037
...
...
@@ -76,8 +76,8 @@ public class HomeFragment extends Fragment {
/********* TEST DATA **********/
CouponList
clist
=
new
CouponList
();
try
{
clist
.
add
(
new
Coupon
(
"{\"
session_uuid\": \"a724e911a71a42408b6ba50ae6c08dbb\", \"title\": \"\\u039a\\u03ac\\u03bd\\u03b5 strike\", \"subtitle\": \"\\u03ba\\u03b1\\u03b9 \\u03ba\\u03ad\\u03c1\\u03b4\\u03b9\\u03c3\\u03b5!\", \"offer_message\": null, \"message\": null, \"index_url\": \"https://warply.s3.amazonaws.com/artworks/034fba10ceac4e0f9338bd8e60086292/index.html\", \"logo_url\": \"https://warply.s3.amazonaws.com/temp/96322898cc824981aece923d8b5afc88/drggtdr.jpg\", \"starts\": 1644494400, \"expires\": 1881522000, \"delivered\": 1644607293, \"action\": 0, \"opened\": 1, \"offer_category\": \"standard-offer\", \"sorting\": 0, \"is_new\": true, \"session_metadata\": \"\\\"\\\"\", \"display_type\": null, \"delivery_method\": 2, \"extra_fields\": \"{}\", \"campaign_type\": null, \"campaign_type_settings\": null, \"actions\": null, \"show\": true, \"expired\": false, \"audience\": \"al
l\"}"
));
clist
.
add
(
new
Coupon
(
"{\"
session_uuid\": \"a724e911a71a42408b6ba50ae6c08dbb\", \"title\": \"\\u039a\\u03ac\\u03bd\\u03b5 strike\", \"subtitle\": \"\\u03ba\\u03b1\\u03b9 \\u03ba\\u03ad\\u03c1\\u03b4\\u03b9\\u03c3\\u03b5!\", \"offer_message\": null, \"message\": null, \"index_url\": \"https://warply.s3.amazonaws.com/artworks/034fba10ceac4e0f9338bd8e60086292/index.html\", \"logo_url\": \"https://warply.s3.amazonaws.com/temp/96322898cc824981aece923d8b5afc88/drggtdr.jpg\", \"starts\": 1644494400, \"expires\": 1881522000, \"delivered\": 1644607293, \"action\": 0, \"opened\": 1, \"offer_category\": \"standard-offer\", \"sorting\": 0, \"is_new\": true, \"session_metadata\": \"\\\"\\\"\", \"display_type\": null, \"delivery_method\": 2, \"extra_fields\": \"{}\", \"campaign_type\": null, \"campaign_type_settings\": null, \"actions\": null, \"show\": true, \"expired\": false, \"audience\": \"al
l\"}"
));
clist
.
add
(
new
Coupon
(
"{\"
barcode\": \"a724e911a71a42408b6ba50ae6c08dbb\", \"coupon\": \"123456789\", \"name\": \"\\u039a\\u03ac\\u03bd\\u03b5 strike\", \"description\": \"\\u03ba\\u03b1\\u03b9 \\u03ba\\u03ad\\u03c1\\u03b4\\u03b9\\u03c3\\u03b5!\", \"image\": \"https://warply.s3.amazonaws.com/artworks/034fba10ceac4e0f9338bd8e60086292/index.htm
l\"}"
));
clist
.
add
(
new
Coupon
(
"{\"
barcode\": \"a724e911a71a42408b6ba50ae6c08dbb\", \"coupon\": \"12345678910\", \"name\": \"\\u039a\\u03ac\\u03bd\\u03b5 strike\", \"description\": \"\\u03ba\\u03b1\\u03b9 \\u03ba\\u03ad\\u03c1\\u03b4\\u03b9\\u03c3\\u03b5!\", \"image\": \"https://warply.s3.amazonaws.com/artworks/034fba10ceac4e0f9338bd8e60086292/index.htm
l\"}"
));
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -91,7 +91,7 @@ public class HomeFragment extends Fragment {
.
doOnNext
(
coupon
->
{
getContext
().
startActivity
(
WarpViewActivity
.
createIntentFromSessionUUID
(
getContext
(),
coupon
.
get
SessionUUID
()));
coupon
.
get
Coupon
()));
})
.
doOnError
(
error
->
{
})
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/HomeCouponAdapter.java
View file @
8f51037
...
...
@@ -31,13 +31,13 @@ public class HomeCouponAdapter extends RecyclerView.Adapter<HomeCouponAdapter.Ho
}
public
class
HomeCouponViewHolder
extends
RecyclerView
.
ViewHolder
{
private
ImageView
ivC
ampaig
nTitle
;
private
TextView
tvC
ampaig
nTitle
;
private
ImageView
ivC
oupo
nTitle
;
private
TextView
tvC
oupo
nTitle
;
public
HomeCouponViewHolder
(
View
view
)
{
super
(
view
);
ivC
ampaignTitle
=
view
.
findViewById
(
R
.
id
.
iv_campaig
n_logo
);
tvC
ampaignTitle
=
view
.
findViewById
(
R
.
id
.
tv_campaign_
title
);
ivC
ouponTitle
=
view
.
findViewById
(
R
.
id
.
iv_coupo
n_logo
);
tvC
ouponTitle
=
view
.
findViewById
(
R
.
id
.
tv_coupon_sub
title
);
}
}
...
...
@@ -72,22 +72,22 @@ public class HomeCouponAdapter extends RecyclerView.Adapter<HomeCouponAdapter.Ho
Coupon
couponItem
=
mCoupons
.
get
(
position
);
if
(
couponItem
!=
null
)
{
if
(!
TextUtils
.
isEmpty
(
couponItem
.
getLogoUrl
()))
{
Glide
.
with
(
mContext
)
// .setDefaultRequestOptions(
// RequestOptions
// .placeholderOf(R.drawable.ic_default_contact_photo)
// .error(R.drawable.ic_default_contact_photo))
.
load
(
couponItem
.
getLogoUrl
())
.
diskCacheStrategy
(
DiskCacheStrategy
.
DATA
)
.
into
(
holder
.
ivCampaig
nTitle
);
}
else
{
Glide
.
with
(
mContext
)
.
load
(
R
.
drawable
.
ic_cosmote_logo_horizontal_grey
)
.
into
(
holder
.
ivCampaig
nTitle
);
}
holder
.
tvCampaignTitle
.
setText
(
couponItem
.
getTitl
e
());
// if (!TextUtils.isEmpty(couponItem.getImage
())) {
//
Glide.with(mContext)
//
//
.setDefaultRequestOptions(
//
//
RequestOptions
//
//
.placeholderOf(R.drawable.ic_default_contact_photo)
//
//
.error(R.drawable.ic_default_contact_photo))
// .load(couponItem.getImage
())
//
.diskCacheStrategy(DiskCacheStrategy.DATA)
// .into(holder.ivCoupo
nTitle);
//
} else {
//
Glide.with(mContext)
//
.load(R.drawable.ic_cosmote_logo_horizontal_grey)
// .into(holder.ivCoupo
nTitle);
//
}
// holder.tvCouponTitle.setText(couponItem.getNam
e());
holder
.
itemView
.
setOnClickListener
(
v
->
onClickSubject
.
onNext
(
couponItem
));
}
...
...
warply_android_sdk/src/main/res/layout/coupon_layout.xml
View file @
8f51037
...
...
@@ -66,6 +66,7 @@
app:layout_constraintVertical_bias=
"0.2"
/>
<ImageView
android:id=
"@+id/iv_coupon_logo"
android:layout_width=
"80dp"
android:layout_height=
"60dp"
android:src=
"@drawable/sklavenitis_logo"
...
...
warply_android_sdk/src/main/res/layout/fragment_home.xml
View file @
8f51037
...
...
@@ -103,18 +103,15 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/rl_home_campaigns"
android:layout_marginVertical=
"25dp"
android:paddingHorizontal=
"15dp"
>
<!-- <androidx.recyclerview.widget.RecyclerView-->
<!-- android:id="@+id/rv_home_coupons"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginBottom="8dp"-->
<!-- android:clipToPadding="false"-->
<!-- android:orientation="horizontal"-->
<!-- android:paddingEnd="10dp"-->
<!-- />-->
<include
layout=
"@layout/coupon_layout"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_home_coupons"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"8dp"
android:clipToPadding=
"false"
android:orientation=
"horizontal"
android:paddingEnd=
"10dp"
/>
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
...
...
Please
register
or
login
to post a comment