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
2022-03-23 17:40:02 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
609438a6217505c7730bde4702c5e53a5e75d372
609438a6
1 parent
907bc7a9
fixed coupons
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
92 additions
and
43 deletions
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyActivity.java
warply_android_sdk/src/main/res/drawable-xhdpi/coupon_wrapper2.png
warply_android_sdk/src/main/res/drawable/shape_cos_gradient3.xml
warply_android_sdk/src/main/res/layout/activity_loyalty.xml
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/res/values/strings.xml
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyActivity.java
View file @
609438a
...
...
@@ -5,7 +5,15 @@ import android.os.Bundle;
import
android.view.View
;
import
android.widget.ImageView
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
org.json.JSONException
;
import
ly.warp.sdk.R
;
import
ly.warp.sdk.io.models.Coupon
;
import
ly.warp.sdk.io.models.CouponList
;
import
ly.warp.sdk.views.adapters.HomeCouponAdapter
;
public
class
LoyaltyActivity
extends
Activity
implements
View
.
OnClickListener
{
...
...
@@ -19,6 +27,8 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener {
// ===========================================================
private
ImageView
mIvBack
;
private
RecyclerView
mRecyclerCoupons
;
private
HomeCouponAdapter
mAdapterCoupons
;
// ===========================================================
// Methods for/from SuperClass/Interfaces
...
...
@@ -31,6 +41,28 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener {
mIvBack
=
findViewById
(
R
.
id
.
iv_back
);
/********* TEST COUPONS DATA **********/
CouponList
clist
=
new
CouponList
();
try
{
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.html\"}"
));
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.html\"}"
));
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
}
/********* TEST COUPONS DATA **********/
mRecyclerCoupons
=
findViewById
(
R
.
id
.
rv_loyalty_coupons
);
mRecyclerCoupons
.
setLayoutManager
(
new
LinearLayoutManager
(
this
,
LinearLayoutManager
.
HORIZONTAL
,
false
));
mAdapterCoupons
=
new
HomeCouponAdapter
(
this
,
clist
);
mRecyclerCoupons
.
setAdapter
(
mAdapterCoupons
);
mAdapterCoupons
.
getPositionClicks
()
.
doOnNext
(
coupon
->
{
// startActivity(WarpViewActivity.createIntentFromSessionUUID(this, coupon.getCoupon()));
})
.
doOnError
(
error
->
{
})
.
subscribe
();
initViews
();
}
...
...
warply_android_sdk/src/main/res/drawable-xhdpi/coupon_wrapper2.png
0 → 100644
View file @
609438a
3.78 KB
warply_android_sdk/src/main/res/drawable/shape_cos_gradient3.xml
0 → 100644
View file @
609438a
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<gradient
android:startColor=
"@color/cos_green2"
android:centerColor=
"@color/green_dark"
android:endColor=
"@color/cos_blue2"
android:type=
"linear"
/>
<corners
android:radius=
"1000dp"
/>
</shape>
\ No newline at end of file
warply_android_sdk/src/main/res/layout/activity_loyalty.xml
View file @
609438a
This diff is collapsed. Click to expand it.
warply_android_sdk/src/main/res/layout/coupon_layout.xml
View file @
609438a
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
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_par
ent"
android:layout_
height=
"25
0dp"
>
android:layout_width=
"360dp
"
android:layout_
height=
"wrap_cont
ent"
android:layout_
marginStart=
"1
0dp"
>
<androidx.constraintlayout.widget.Guideline
android:id=
"@+id/horizontal_guideline"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
app:layout_constraintGuide_percent=
"0.1
8
"
/>
app:layout_constraintGuide_percent=
"0.1
2
"
/>
<androidx.constraintlayout.widget.Guideline
android:id=
"@+id/horizontal_guideline2"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
app:layout_constraintGuide_percent=
"0.
75
"
/>
app:layout_constraintGuide_percent=
"0.
88
"
/>
<androidx.constraintlayout.widget.Guideline
android:id=
"@+id/vertical_guideline"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
app:layout_constraintGuide_percent=
"0.
85
"
/>
app:layout_constraintGuide_percent=
"0.
94
"
/>
<androidx.constraintlayout.widget.Guideline
android:id=
"@+id/vertical_guideline2"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
app:layout_constraintGuide_percent=
"0.
14
"
/>
app:layout_constraintGuide_percent=
"0.
06
"
/>
<ImageView
android:id=
"@+id/imageView2"
android:layout_width=
"403dp"
android:layout_height=
"238dp"
android:scaleType=
"fitXY"
android:src=
"@drawable/coupon_wrapper"
android:layout_width=
"match_parent"
android:layout_height=
"250dp"
android:src=
"@drawable/coupon_wrapper2"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"300dp"
android:layout_height=
"150dp"
android:paddingHorizontal=
"5dp"
android:layout_width=
"0dp"
android:layout_height=
"0dp"
app:layout_constraintBottom_toTopOf=
"@+id/horizontal_guideline2"
app:layout_constraintEnd_toStartOf=
"@+id/vertical_guideline"
app:layout_constraintStart_toStartOf=
"@+id/vertical_guideline2"
...
...
@@ -55,50 +53,56 @@
<TextView
android:id=
"@+id/tv_coupon_title"
android:layout_width=
"
wrap_content
"
android:layout_width=
"
0dp
"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"16dp"
android:maxLines=
"1"
android:text=
"Αποκλειστικά για σένα"
app:layout_constraintBottom_toTopOf=
"@+id/tv_coupon_subtitle"
android:textColor=
"@color/grey"
android:textSize=
"18sp"
android:textStyle=
"bold"
android:layout_marginTop=
"16dp"
app:layout_constraintEnd_toStartOf=
"@+id/iv_coupon_logo"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
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"
app:layout_constraintBottom_toTopOf=
"@+id/tv_coupon_subtitle"
app:layout_constraintEnd_toEndOf=
"@+id/tv_coupon_subtitle"
app:layout_constraintHorizontal_bias=
"1.0"
app:layout_constraintStart_toEndOf=
"@+id/tv_coupon_title"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"1.0"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_coupon_subtitle"
android:layout_width=
"
wrap_content
"
android:layout_width=
"
0dp
"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"24dp"
android:maxLines=
"2"
android:layout_marginTop=
"8dp"
android:text=
"10€ έκπτωση στα ψώνια σου στα supermarket Σκλαβενίτης!"
app:layout_constraintBottom_toTopOf=
"@+id/button"
android:textColor=
"@color/grey"
android:textFontWeight=
"600"
android:textSize=
"16sp"
app:layout_constraintEnd_toStartOf=
"@+id/iv_coupon_logo"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/tv_coupon_title"
/>
<ImageView
android:id=
"@+id/iv_coupon_logo"
android:layout_width=
"80dp"
android:layout_height=
"60dp"
android:layout_marginTop=
"16dp"
android:src=
"@drawable/sklavenitis_logo"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraint
Start_toStart
Of=
"parent"
/>
app:layout_constraint
Top_toTop
Of=
"parent"
/>
<
Button
<
TextView
android:id=
"@+id/button"
android:layout_width=
"150dp"
android:layout_height=
"40dp"
android:background=
"@drawable/round_border"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/shape_cos_gradient3"
android:paddingHorizontal=
"16dp"
android:paddingVertical=
"4dp"
android:text=
"Εξαργύρωση"
android:textAlignment=
"center"
android:textSize=
"11dp"
android:textColor=
"@android:color/white"
android:textFontWeight=
"600"
android:textSize=
"15dp"
android:layout_marginBottom=
"16dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"1.0"
app:layout_constraintStart_toStartOf=
"parent"
/>
app:layout_constraintEnd_toEndOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...
...
warply_android_sdk/src/main/res/layout/fragment_home.xml
View file @
609438a
...
...
@@ -93,6 +93,7 @@
android:layout_height=
"wrap_content"
android:layout_below=
"@id/rl_header"
android:layout_marginTop=
"16dp"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_home_campaigns"
android:layout_width=
"match_parent"
...
...
@@ -100,7 +101,7 @@
android:layout_marginBottom=
"8dp"
android:clipToPadding=
"false"
android:orientation=
"horizontal"
android:paddingEnd=
"10dp"
/>
android:paddingEnd=
"10dp"
/>
</RelativeLayout>
<LinearLayout
...
...
warply_android_sdk/src/main/res/values/strings.xml
View file @
609438a
...
...
@@ -23,4 +23,5 @@
<string
name=
"cos_profile_loyalty_name"
>
Γιώργος Γεωργίου
</string>
<string
name=
"cos_questionnaire"
>
Ερωτηματολόγιο
</string>
<string
name=
"cos_gifts_loyalty_title"
>
Τα δώρα μου
</string>
<string
name=
"cos_coupons_loyalty_title"
>
Ενεργά κουπόνια
</string>
</resources>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment