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-11-28 12:58:42 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
52cbbc8a197be41debd205517d64c0d734a8b85a
52cbbc8a
1 parent
58e30650
vouchers fixes
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
180 additions
and
105 deletions
.idea/deploymentTargetDropDown.xml
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
warply_android_sdk/src/main/res/layout/activity_loyalty_wallet.xml
warply_android_sdk/src/main/res/values/strings.xml
.idea/deploymentTargetDropDown.xml
0 → 100644
View file @
52cbbc8
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"deploymentTargetDropDown"
>
<targetSelectedWithDropDown>
<Target>
<type
value=
"QUICK_BOOT_TARGET"
/>
<deviceKey>
<Key>
<type
value=
"VIRTUAL_DEVICE_PATH"
/>
<value
value=
"$USER_HOME$/.android/avd/Pixel_6a_API_29.avd"
/>
</Key>
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown
value=
"2023-11-28T10:41:57.588318Z"
/>
</component>
</project>
\ No newline at end of file
warply_android_sdk/build.gradle
View file @
52cbbc8
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.5.4r
3
'
PUBLISH_VERSION
=
'4.5.5.4r
4
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
View file @
52cbbc8
...
...
@@ -180,6 +180,38 @@ public class WarplyManagerHelper {
return
url
;
}
private
static
String
constructCampaignUrl
(
Campaign
item
,
String
dlParam
)
{
WarplyManager
.
getSingleCampaign
(
item
.
getSessionUUID
());
String
url
=
item
.
getIndexUrl
();
// + "?web_id=" + WarpUtils.getWebId(Warply.getWarplyContext())
// + "&app_uuid=" + WarplyProperty.getAppUuid(Warply.getWarplyContext())
// + "&api_key=" + WarpUtils.getApiKey(Warply.getWarplyContext())
// + "&session_uuid=" + item.getSessionUUID()
// + "&access_token=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("access_token")
// + "&refresh_token=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("refresh_token")
// + "&client_id=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_id")
// + "&client_secret=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_secret");
JSONObject
params
=
new
JSONObject
();
try
{
params
.
putOpt
(
"web_id"
,
WarpUtils
.
getWebId
(
Warply
.
getWarplyContext
()));
params
.
putOpt
(
"app_uuid"
,
WarplyProperty
.
getAppUuid
(
Warply
.
getWarplyContext
()));
params
.
putOpt
(
"api_key"
,
WarpUtils
.
getApiKey
(
Warply
.
getWarplyContext
()));
params
.
putOpt
(
"session_uuid"
,
item
.
getSessionUUID
());
params
.
putOpt
(
"access_token"
,
WarplyDBHelper
.
getInstance
(
Warply
.
getWarplyContext
()).
getAuthValue
(
"access_token"
));
params
.
putOpt
(
"refresh_token"
,
WarplyDBHelper
.
getInstance
(
Warply
.
getWarplyContext
()).
getAuthValue
(
"refresh_token"
));
params
.
putOpt
(
"client_id"
,
WarplyDBHelper
.
getInstance
(
Warply
.
getWarplyContext
()).
getClientValue
(
"client_id"
));
params
.
putOpt
(
"client_secret"
,
WarplyDBHelper
.
getInstance
(
Warply
.
getWarplyContext
()).
getClientValue
(
"client_secret"
));
params
.
putOpt
(
"dl_param"
,
dlParam
);
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
}
WarpUtils
.
setWebviewParams
(
Warply
.
getWarplyContext
(),
params
);
return
url
;
}
public
static
String
constructCampaignUrl
(
Campaign
item
,
boolean
fromWidget
)
{
item
.
setNew
(
false
);
String
url
=
item
.
getIndexUrl
();
...
...
@@ -984,6 +1016,25 @@ public class WarplyManagerHelper {
}
/**
* Open DL for SM Deals campaign
*/
public
static
void
handleSMDealsCampaign
(
Context
context
,
String
dlParam
)
{
if
(!
noInternetDialog
(
context
,
true
))
{
noInternetDialog
((
Activity
)
context
);
return
;
}
if
(
mCampaignListAll
!=
null
&&
mCampaignListAll
.
size
()
>
0
)
{
for
(
Campaign
camp
:
mCampaignListAll
)
{
if
(
camp
.
getSessionUUID
().
equals
(
"39e70f0548884020809dda5f78d06c85"
)
||
camp
.
getSessionUUID
().
equals
(
"8314046c83a44576a03ccc3cd9e825db"
))
{
context
.
startActivity
(
WarpViewActivity
.
createIntentFromURL
(
context
,
WarplyManagerHelper
.
constructCampaignUrl
(
camp
,
dlParam
)));
break
;
}
}
}
}
/**
* Open Pacing
*/
public
static
String
openPacing
()
{
...
...
warply_android_sdk/src/main/res/layout/activity_loyalty_wallet.xml
View file @
52cbbc8
...
...
@@ -49,119 +49,126 @@
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/ll_first_view"
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/ic_background_line"
android:orientation=
"horizontal"
android:paddingHorizontal=
"16dp"
android:paddingVertical=
"24dp"
>
<com.google.android.material.imageview.ShapeableImageView
android:id=
"@+id/iv_profile_photo"
android:layout_width=
"74dp"
android:layout_height=
"74dp"
android:padding=
"1dp"
android:src=
"@drawable/ic_default_photo"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:shapeAppearanceOverlay=
"@style/ShapeAppearanceProfileImage"
app:strokeColor=
"@color/cos_grey2"
app:strokeWidth=
"1dp"
/>
android:background=
"@android:color/white"
android:orientation=
"vertical"
>
<
Linear
Layout
android:
layout_width=
"0dp
"
android:layout_
height=
"0dp
"
android:layout_
marginStart=
"8dp
"
android:
orientation=
"vertical
"
a
pp:layout_constraintBottom_toBottomOf=
"@+id/iv_profile_photo
"
a
pp:layout_constraintEnd_toEndOf=
"parent
"
a
pp:layout_constraintStart_toEndOf=
"@+id/iv_profile_photo"
app:layout_constraintTop_toTopOf=
"@+id/iv_profile_photo"
>
<TextView
android:
id=
"@+id/tv_profile_name
"
fontPath=
"fonts/PeridotPE-SemiBold.ttf
"
android:
layout_width=
"wrap_content
"
android:
layout_height=
"wrap_content
"
a
ndroid:layout_marginBottom=
"4dp
"
a
ndroid:includeFontPadding=
"false
"
a
ndroid:maxLines=
"1
"
a
ndroid:textColor=
"@color/cos_light_black
"
a
ndroid:textSize=
"22sp
"
tools:text=
"Test Name
"
/>
<
androidx.constraintlayout.widget.Constraint
Layout
android:
id=
"@+id/ll_first_view
"
android:layout_
width=
"match_parent
"
android:layout_
height=
"wrap_content
"
android:
layout_marginVertical=
"24dp
"
a
ndroid:background=
"@drawable/ic_background_line
"
a
ndroid:orientation=
"horizontal
"
a
ndroid:paddingHorizontal=
"16dp"
>
<com.google.android.material.imageview.ShapeableImageView
android:id=
"@+id/iv_profile_photo"
android:
layout_width=
"74dp
"
android:layout_height=
"74dp
"
android:
padding=
"1dp
"
android:
src=
"@drawable/ic_default_photo
"
a
pp:layout_constraintBottom_toBottomOf=
"parent
"
a
pp:layout_constraintStart_toStartOf=
"parent
"
a
pp:layout_constraintTop_toTopOf=
"parent
"
a
pp:shapeAppearanceOverlay=
"@style/ShapeAppearanceProfileImage
"
a
pp:strokeColor=
"@color/cos_grey2
"
app:strokeWidth=
"1dp
"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
android:layout_width=
"0dp"
android:layout_height=
"0dp"
android:layout_marginStart=
"8dp"
android:orientation=
"vertical"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@+id/iv_profile_photo"
app:layout_constraintTop_toTopOf=
"parent"
>
<LinearLayout
android:id=
"@+id/ll_user_badge"
<TextView
android:id=
"@+id/tv_profile_name"
fontPath=
"fonts/PeridotPE-SemiBold.ttf"
android:layout_width=
"wrap_content"
android:layout_height=
"42dp"
android:background=
"@drawable/selector_button_green_border"
android:gravity=
"center"
android:visibility=
"gone"
tools:visibility=
"gone"
>
<TextView
android:id=
"@+id/tv_type"
fontPath=
"fonts/PeridotPE-SemiBold.ttf"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"20dp"
android:includeFontPadding=
"false"
android:textColor=
"@color/cos_green12"
android:textSize=
"16sp"
tools:text=
"@string/cos_profile_preferences_placeholder"
/>
</LinearLayout>
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"4dp"
android:includeFontPadding=
"false"
android:maxLines=
"1"
android:textColor=
"@color/cos_light_black"
android:textSize=
"22sp"
tools:text=
"Test Name"
/>
<LinearLayout
android:id=
"@+id/ll_user_questionnaire"
android:layout_width=
"160dp"
android:layout_height=
"42dp"
android:background=
"@drawable/selector_button_green_border"
android:gravity=
"center"
android:visibility=
"gone"
tools:visibility=
"visible"
>
<ImageView
android:layout_width=
"16dp"
android:layout_height=
"16dp"
android:layout_marginEnd=
"4dp"
android:src=
"@drawable/sv_plus_sign_green"
/>
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_questionnaire"
fontPath=
"fonts/PeridotPE-Bold.ttf"
<LinearLayout
android:id=
"@+id/ll_user_badge"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:includeFontPadding=
"false"
android:text=
"@string/cos_profile_preferences"
android:textColor=
"@color/cos_green12"
android:textSize=
"16sp"
/>
</LinearLayout>
android:layout_height=
"42dp"
android:background=
"@drawable/selector_button_green_border"
android:gravity=
"center"
android:visibility=
"gone"
tools:visibility=
"gone"
>
<LinearLayout
android:id=
"@+id/ll_loyalty_history"
android:layout_width=
"52dp"
android:layout_height=
"42dp"
android:layout_marginStart=
"4dp"
android:background=
"@drawable/selector_button_green_border"
android:gravity=
"center"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/tv_type"
fontPath=
"fonts/PeridotPE-SemiBold.ttf"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"20dp"
android:includeFontPadding=
"false"
android:textColor=
"@color/cos_green12"
android:textSize=
"16sp"
tools:text=
"@string/cos_profile_preferences_placeholder"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_user_questionnaire"
android:layout_width=
"160dp"
android:layout_height=
"42dp"
android:background=
"@drawable/selector_button_green_border"
android:gravity=
"center"
android:visibility=
"gone"
tools:visibility=
"visible"
>
<ImageView
android:layout_width=
"16dp"
android:layout_height=
"16dp"
android:src=
"@drawable/sv_history"
/>
<ImageView
android:layout_width=
"16dp"
android:layout_height=
"16dp"
android:layout_marginEnd=
"4dp"
android:src=
"@drawable/sv_plus_sign_green"
/>
<TextView
android:id=
"@+id/tv_questionnaire"
fontPath=
"fonts/PeridotPE-Bold.ttf"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:includeFontPadding=
"false"
android:text=
"@string/cos_profile_preferences"
android:textColor=
"@color/cos_green12"
android:textSize=
"16sp"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_loyalty_history"
android:layout_width=
"52dp"
android:layout_height=
"42dp"
android:layout_marginStart=
"4dp"
android:background=
"@drawable/selector_button_green_border"
android:gravity=
"center"
android:orientation=
"vertical"
>
<ImageView
android:layout_width=
"16dp"
android:layout_height=
"16dp"
android:src=
"@drawable/sv_history"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</
Linear
Layout>
</
androidx.constraintlayout.widget.Constraint
Layout>
</
androidx.constraintlayout.widget.Constraint
Layout>
</
Linear
Layout>
<RelativeLayout
android:layout_width=
"match_parent"
...
...
@@ -651,13 +658,13 @@
<LinearLayout
android:layout_width=
"16dp"
android:layout_height=
"16dp"
android:layout_marginStart=
"2dp"
android:background=
"@drawable/shape_cos_counter_orange"
android:gravity=
"center"
android:orientation=
"vertical"
android:layout_marginStart=
"2dp"
app:layout_constraintTop_toTopOf=
"@+id/tv_vouchers_info_title_disabled"
app:layout_constraintBottom_toTopOf=
"@+id/tv_vouchers_info_title_disabled"
app:layout_constraintStart_toEndOf=
"@+id/tv_vouchers_info_title_disabled"
>
app:layout_constraintStart_toEndOf=
"@+id/tv_vouchers_info_title_disabled"
app:layout_constraintTop_toTopOf=
"@+id/tv_vouchers_info_title_disabled"
>
<TextView
android:id=
"@+id/tv_vouchers_count_disabled"
...
...
@@ -666,9 +673,9 @@
android:layout_height=
"16dp"
android:includeFontPadding=
"false"
android:maxLines=
"1"
android:text=
"0"
android:textColor=
"@color/cos_light_black"
android:textSize=
"12sp"
android:text=
"0"
/>
android:textSize=
"12sp"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
...
...
warply_android_sdk/src/main/res/values/strings.xml
View file @
52cbbc8
...
...
@@ -201,7 +201,7 @@
<string
name=
"cos_dlg_negative_button4"
>
Όχι
</string>
<string
name=
"cos_dlg_positive_button3"
>
Ναι
</string>
<string
name=
"cos_vouchers_title"
>
Υπόλοιπο επιδότησης
</string>
<string
name=
"cos_vouchers_info_title"
>
Ενημερώσου για το υπόλοιπο επιδότησης
</string>
<string
name=
"cos_vouchers_info_title"
>
Δες το διαθέσιμο υπόλοιπο
</string>
<string
name=
"cos_loyalty_history"
>
Ιστορικό
</string>
<string
name=
"cos_redeemed_coupons_loyalty_title"
>
Εξαργυρωμένα κουπόνια
</string>
<string
name=
"cos_history_info_text"
>
Δες αναλυτικά το συνολικό όφελός σου έως τώρα από κουπόνια
</string>
...
...
Please
register
or
login
to post a comment