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-30 17:12:55 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
bedd1de0d6487c5aeea1aa794683afcc17fb8007
bedd1de0
1 parent
5d57ef38
feedback fixes
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
6 deletions
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/activities/UnifiedCouponInfoActivity.java
warply_android_sdk/src/main/res/layout/item_sheet_merchant.xml
warply_android_sdk/src/main/res/layout/item_sheet_merchant_category.xml
warply_android_sdk/src/main/java/ly/warp/sdk/activities/ActiveUnifiedCouponsActivity.java
View file @
bedd1de
...
...
@@ -18,7 +18,6 @@ import androidx.recyclerview.widget.RecyclerView;
import
org.greenrobot.eventbus.EventBus
;
import
org.greenrobot.eventbus.Subscribe
;
import
org.greenrobot.eventbus.ThreadMode
;
import
org.json.JSONArray
;
import
org.json.JSONObject
;
...
...
@@ -140,7 +139,7 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli
EventBus
.
getDefault
().
unregister
(
this
);
}
@Subscribe
(
threadMode
=
ThreadMode
.
ASYNC
)
@Subscribe
()
public
void
onMessageEvent
(
WarplyEventBusManager
event
)
{
if
(
event
.
getRefreshUnifiedCouponsAdded
()
!=
null
||
event
.
getRefreshVouchersEventModel
()
!=
null
)
{
Handler
mUIHandler
=
new
Handler
(
Looper
.
getMainLooper
());
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponInfoActivity.java
View file @
bedd1de
...
...
@@ -563,6 +563,17 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
String
tempCoupon
=
""
;
int
result
=
0
;
if
(
mCoupon
.
getCoupon
().
length
()
==
13
)
{
tempCoupon
=
mCoupon
.
getCoupon
();
try
{
for
(
int
i
=
mCoupon
.
getCoupon
().
length
()
-
1
;
i
>=
0
;
i
--)
{
result
=
result
+
Integer
.
parseInt
(
String
.
valueOf
((
mCoupon
.
getCoupon
()).
charAt
(
i
)))
*
(
1
+
(
2
*
(
i
%
2
)));
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
else
{
try
{
tempCoupon
=
mCoupon
.
getCoupon
();
for
(
int
i
=
0
;
i
<
(
12
-
mCoupon
.
getCoupon
().
length
());
i
++)
{
...
...
@@ -576,11 +587,13 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
for
(
int
i
=
mCoupon
.
getCoupon
().
length
()
-
1
;
i
>=
0
;
i
--)
{
result
=
result
+
Integer
.
parseInt
(
String
.
valueOf
((
mCoupon
.
getCoupon
()).
charAt
(
i
)))
*
(
1
+
(
2
*
(
i
%
2
)));
}
tempCoupon
=
tempCoupon
+
(
10
-
(
result
%
10
))
%
10
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
tempCoupon
=
tempCoupon
+
(
10
-
(
result
%
10
))
%
10
;
createBarcodeBitmap
(
tempCoupon
);
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/UnifiedCouponInfoActivity.java
View file @
bedd1de
...
...
@@ -272,7 +272,7 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL
String
finalMerchantUrl
=
merchantUrl
;
LayoutInflater
vi
=
(
LayoutInflater
)
getApplicationContext
().
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
LinearLayout
v
=
(
LinearLayout
)
vi
.
inflate
(
R
.
layout
.
item_sheet_merchant
,
null
);
LinearLayout
v
=
(
LinearLayout
)
vi
.
inflate
(
R
.
layout
.
item_sheet_merchant
_category
,
null
);
TextView
textView
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
button_sm_buy_it
);
textView
.
setText
(
R
.
string
.
cos_markets_eshop_item
);
...
...
warply_android_sdk/src/main/res/layout/item_sheet_merchant.xml
View file @
bedd1de
...
...
@@ -24,7 +24,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/cl_button_sm_buy_it"
android:layout_width=
"
150dp
"
android:layout_width=
"
wrap_content
"
android:layout_height=
"36dp"
android:layout_marginEnd=
"8dp"
android:background=
"@drawable/selector_button_green2"
...
...
@@ -40,8 +40,10 @@
android:text=
"@string/cos_sm_buy_it"
android:textColor=
"@color/white"
android:textSize=
"14sp"
android:layout_marginStart=
"24dp"
android:layout_marginEnd=
"12dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_to
EndOf=
"paren
t"
app:layout_constraintEnd_to
StartOf=
"@+id/iv_sheet_car
t"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
...
...
warply_android_sdk/src/main/res/layout/item_sheet_merchant_category.xml
0 → 100644
View file @
bedd1de
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
xmlns:tools=
"http://schemas.android.com/tools"
android:background=
"@android:color/white"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"56dp"
android:layout_marginBottom=
"32dp"
android:background=
"@drawable/shape_cos_sheet_item"
>
<ImageView
android:id=
"@+id/iv_merchant_sheet_logo"
android:layout_width=
"140dp"
android:layout_height=
"36dp"
android:layout_marginStart=
"24dp"
tools:src=
"@drawable/cosmote_insurance_logo"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/cl_button_sm_buy_it"
android:layout_width=
"wrap_content"
android:layout_height=
"36dp"
android:layout_marginEnd=
"8dp"
android:background=
"@drawable/selector_button_green2"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
>
<TextView
android:id=
"@+id/button_sm_buy_it"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:includeFontPadding=
"false"
android:text=
"@string/cos_sm_buy_it"
android:textColor=
"@color/white"
android:textSize=
"14sp"
android:layout_marginHorizontal=
"24dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
\ No newline at end of file
Please
register
or
login
to post a comment