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-30 15:35:37 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d630297b9e7046d243f8213ed7d6f81723d8fa94
d630297b
1 parent
4cbac894
minor addition
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
5 deletions
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyActivity.java
warply_android_sdk/src/main/res/layout/loyalty_banner.xml
warply_android_sdk/src/main/res/values/strings.xml
warply_android_sdk/build.gradle
View file @
d630297
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4-cos
1
'
PUBLISH_VERSION
=
'4.5.4-cos
2
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyActivity.java
View file @
d630297
...
...
@@ -17,6 +17,11 @@ import androidx.recyclerview.widget.RecyclerView;
import
java.io.Serializable
;
import
ly.warp.sdk.R
;
import
ly.warp.sdk.db.WarplyDBHelper
;
import
ly.warp.sdk.io.models.Campaign
;
import
ly.warp.sdk.io.models.CampaignList
;
import
ly.warp.sdk.utils.WarpUtils
;
import
ly.warp.sdk.utils.WarplyProperty
;
import
ly.warp.sdk.views.adapters.HomeCouponAdapter
;
...
...
@@ -35,7 +40,7 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
private
RecyclerView
mRecyclerCoupons
,
mRecyclerBurntCoupons
;
private
HomeCouponAdapter
mAdapterCoupons
,
mAdapterBurntCoupons
;
private
Spinner
mCouponSpinner
,
mRedemptionSpinner
;
private
TextView
mTvAnalysisButton
,
mTvUsername
;
private
TextView
mTvAnalysisButton
,
mTvUsername
,
mTvQuestionnaire
;
// ===========================================================
// Methods for/from SuperClass/Interfaces
...
...
@@ -54,6 +59,7 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
mRedemptionSpinner
=
findViewById
(
R
.
id
.
sp_redemption
);
mTvAnalysisButton
=
findViewById
(
R
.
id
.
rl_analysis_row
).
findViewById
(
R
.
id
.
cl_chart_info
).
findViewById
(
R
.
id
.
tv_analysis_details
);
mTvUsername
=
findViewById
(
R
.
id
.
cl_loyalty_info_banner
).
findViewById
(
R
.
id
.
tv_card_username
);
mTvQuestionnaire
=
findViewById
(
R
.
id
.
cl_loyalty_info_banner
).
findViewById
(
R
.
id
.
tv_questionnaire
);
initViews
();
}
...
...
@@ -72,6 +78,41 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
if
(
view
.
getId
()
==
R
.
id
.
tv_analysis_details
)
{
Intent
intent
=
new
Intent
(
this
,
CouponTransactionActivity
.
class
);
startActivity
(
intent
);
return
;
}
if
(
view
.
getId
()
==
R
.
id
.
tv_questionnaire
)
{
CampaignList
cl
=
BaseFragmentActivity
.
getUniqueCampaignList
().
get
(
"more"
);
Campaign
camp
=
null
;
if
(
cl
!=
null
)
{
for
(
Campaign
cn
:
cl
)
{
if
(
cn
.
getSessionUUID
().
equals
(
"4fc2865e32bd4d5495a3dfdf1472da7f"
))
{
camp
=
cn
;
break
;
}
}
}
if
(
camp
==
null
)
return
;
String
tempUrl
=
camp
.
getIndexUrl
();
tempUrl
=
tempUrl
+
"?web_id="
+
WarpUtils
.
getWebId
(
this
)
+
"&app_uuid="
+
WarplyProperty
.
getAppUuid
(
this
)
+
"&api_key="
+
WarpUtils
.
getApiKey
(
this
)
+
"&session_uuid="
+
camp
.
getSessionUUID
()
+
"&access_token="
+
WarplyDBHelper
.
getInstance
(
this
).
getAuthValue
(
"access_token"
)
+
"&refresh_token="
+
WarplyDBHelper
.
getInstance
(
this
).
getAuthValue
(
"refresh_token"
)
+
"&client_id="
+
WarplyDBHelper
.
getInstance
(
this
).
getClientValue
(
"client_id"
)
+
"&client_secret="
+
WarplyDBHelper
.
getInstance
(
this
).
getClientValue
(
"client_secret"
);
if
(
BaseFragmentActivity
.
getConsumer
()
!=
null
)
tempUrl
=
tempUrl
+
"&auth_token="
+
(
BaseFragmentActivity
.
getConsumer
().
getUuid
());
else
tempUrl
=
tempUrl
+
"&auth_token="
;
startActivity
(
WarpViewActivity
.
createIntentFromURL
(
LoyaltyActivity
.
this
,
tempUrl
));
}
}
...
...
@@ -101,8 +142,6 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
findViewById
(
R
.
id
.
cl_chart_info
).
findViewById
(
R
.
id
.
analysis_tab4
).
setVisibility
(
View
.
GONE
);
findViewById
(
R
.
id
.
cl_chart_info
).
findViewById
(
R
.
id
.
analysis_tab5
).
setVisibility
(
View
.
GONE
);
}
}
else
{
}
}
...
...
@@ -151,6 +190,8 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
adapter2
.
setDropDownViewResource
(
R
.
layout
.
spinner_dropdown_item_sky_blue
);
mRedemptionSpinner
.
setAdapter
(
adapter2
);
mRedemptionSpinner
.
setOnItemSelectedListener
(
this
);
mTvQuestionnaire
.
setOnClickListener
(
this
);
}
// ===========================================================
...
...
warply_android_sdk/src/main/res/layout/loyalty_banner.xml
View file @
d630297
...
...
@@ -63,6 +63,7 @@
</LinearLayout>
<TextView
android:id=
"@+id/tv_questionnaire"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"4dp"
...
...
warply_android_sdk/src/main/res/values/strings.xml
View file @
d630297
...
...
@@ -35,6 +35,5 @@
<string-array
name=
"redemption_array"
>
<item>
Εξαργύρωση
</item>
<item>
Επιστροφή
</item>
</string-array>
</resources>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment