Panagiotis Triantafyllou

new keys

......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4-cosbeta65'
PUBLISH_VERSION = '4.5.4-cosbeta66'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......@@ -56,6 +56,7 @@ dependencies {
api 'com.github.siyamed:android-shape-imageview:0.9.3'
implementation 'org.greenrobot:eventbus:3.3.1'
api 'com.google.android.flexbox:flexbox:3.0.0'
api 'org.apmem.tools:layouts:1.10'
//------------------------------ Firebase -----------------------------//
api platform('com.google.firebase:firebase-bom:29.0.3')
......
......@@ -261,11 +261,13 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
private void nonTelcoDialog() {
mAlertDialogNonTelco = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_non_telco_title)
.setMessage(R.string.cos_dlg_non_telco)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
onBackPressed();
})
.setCancelable(false)
.show();
}
......
......@@ -464,11 +464,13 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
private void nonTelcoDialog() {
mAlertDialogNonTelco = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_non_telco_title)
.setMessage(R.string.cos_dlg_non_telco)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
onBackPressed();
})
.setCancelable(false)
.show();
}
......
......@@ -51,6 +51,7 @@ public class PacingDetails {
private static final String MESSAGE = "msg";
private static final String TITLE = "title";
private static final String SHORTCUT_ENABLED = "shortcut_enabled";
private static final String BUTTON = "button";
/* Member variables of the Campaign object */
private PacingInner steps = new PacingInner();
......@@ -60,6 +61,7 @@ public class PacingDetails {
private String msg = "";
private String title = "";
private boolean shortcut_enabled = false;
private String buttonText = "";
/**
* Basic constructor used to create an object from a String, representing a
......@@ -93,6 +95,7 @@ public class PacingDetails {
this.msg = result.optString(MESSAGE);
this.shortcut_enabled = result.optBoolean(SHORTCUT_ENABLED);
this.title = result.optString(TITLE);
this.buttonText = result.optString(BUTTON);
}
}
}
......@@ -112,6 +115,7 @@ public class PacingDetails {
jObj.putOpt(MESSAGE, this.msg);
jObj.putOpt(SHORTCUT_ENABLED, this.shortcut_enabled);
jObj.putOpt(TITLE, this.title);
jObj.putOpt(BUTTON, this.buttonText);
} catch (JSONException e) {
if (WarpConstants.DEBUG) {
e.printStackTrace();
......@@ -372,4 +376,12 @@ public class PacingDetails {
public void setTitle(String title) {
this.title = title;
}
public String getButtonText() {
return buttonText;
}
public void setButtonText(String buttonText) {
this.buttonText = buttonText;
}
}
......
......@@ -152,6 +152,38 @@ public class WarplyManagerHelper {
return url;
}
public static String constructCampaignUrl(Campaign item, boolean fromWidget) {
item.setNew(false);
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("from_widget", fromWidget);
} catch (JSONException e) {
e.printStackTrace();
}
WarpUtils.setWebviewParams(Warply.getWarplyContext(), params);
return url;
}
/**
* Handle sharing flow
*/
......@@ -788,7 +820,7 @@ public class WarplyManagerHelper {
if (mCampaignListAll != null && mCampaignListAll.size() > 0) {
for (Campaign camp : mCampaignListAll) {
if (camp.getOfferCategory().equals("pacing")) {
String pacingUrl = constructCampaignUrl(camp);
String pacingUrl = constructCampaignUrl(camp, true);
WarpUtils.log("PACING_LOG: " + pacingUrl);
return pacingUrl;
}
......@@ -972,7 +1004,7 @@ public class WarplyManagerHelper {
public static void setCarouselList(CampaignList carouselList) {
mCarouselList.clear();
mCarouselList.addAll(carouselList);
mCarouselList = carouselList;
}
public static CampaignList getCarouselList() {
......
......@@ -1369,7 +1369,7 @@ public class WarplyManager {
public void onSuccess(CampaignList result) {
// receiver.onSuccess(result);
mNewCampaignList.clear();
mNewCampaignList.addAll(result);
mNewCampaignList = result;
getCampaignsPersonalized(request, new CallbackReceiver<CampaignList>() {
@Override
public void onSuccess(CampaignList resultPersonalized) {
......
......@@ -35,11 +35,17 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:id="@+id/ll_first_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/cl_loyalty_wallet_header"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_first_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ic_background_circle"
android:elevation="1dp"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingVertical="32dp">
......@@ -105,21 +111,16 @@
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/ll_first_view"
android:background="@color/cos_grey5">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cos_grey5"
android:layout_marginTop="-24dp"
android:fillViewport="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_marginTop="24dp">
<LinearLayout
android:id="@+id/ll_second_view"
......@@ -340,11 +341,18 @@
android:layout_height="wrap_content"
android:visibility="gone"
app:flexDirection="row"
app:justifyContent="flex_start"
app:flexWrap="wrap">
app:flexWrap="wrap"
app:justifyContent="flex_start">
</com.google.android.flexbox.FlexboxLayout>
<!-- <org.apmem.tools.layouts.FlowLayout-->
<!-- android:id="@+id/ll_active_deals_codes_view"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content">-->
<!-- </org.apmem.tools.layouts.FlowLayout>-->
<TextView
android:id="@+id/tv_active_deals_date_text"
android:layout_width="wrap_content"
......@@ -414,5 +422,5 @@
</LinearLayout>
</RelativeLayout>
</ScrollView>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
......
......@@ -7,7 +7,7 @@
<TextView
android:id="@+id/tv_code_copy"
fontPath="fonts/pf_square_sans_pro_medium.ttf"
fontPath="fonts/pf_square_sans_pro_bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
......@@ -17,7 +17,7 @@
<TextView
android:id="@+id/tv_code_comma"
fontPath="fonts/pf_square_sans_pro_medium.ttf"
fontPath="fonts/pf_square_sans_pro_bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
......
......@@ -136,6 +136,7 @@
<string name="cos_coupon_share_telco">Επιλογή σύνδεσης</string>
<string name="cos_steps_for_good_notification_subtitle">Περπάτησε κάθε μέρα περισσότερο για να ολοκληρώσεις το στόχο του μήνα και να ξεκλειδώσεις μοναδικές προσφορές!</string>
<string name="cos_comma">,</string>
<string name="cos_dlg_non_telco_title">Δεν έχεις προσθέσει τις συνδέσεις σου</string>
<string-array name="coupons_array">
<item>Κουπόνια</item>
......