Panagiotis Triantafyllou

new keys

......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4.6rc4'
PUBLISH_VERSION = '4.5.4.6rc5'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......@@ -45,7 +45,8 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.cardview:cardview:1.0.0'
api "androidx.security:security-crypto:1.1.0-alpha03" // For minSDK 23 use 1.0.0, for minSDK 21 use 1.1.0 that is currently in alpha
api "androidx.security:security-crypto:1.1.0-alpha03"
// For minSDK 23 use 1.0.0, for minSDK 21 use 1.1.0 that is currently in alpha
api 'org.altbeacon:android-beacon-library:2.19.3'
api 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
implementation 'de.hdodenhof:circleimageview:3.1.0'
......@@ -59,12 +60,14 @@ dependencies {
//------------------------------ Firebase -----------------------------//
api platform('com.google.firebase:firebase-bom:29.0.3')
implementation 'com.google.firebase:firebase-messaging'
implementation('com.google.firebase:firebase-messaging') {
exclude group: 'com.google.android.gms', module: 'play-services-location'
}
//------------------------------ GMS -----------------------------//
api 'com.google.android.gms:play-services-base:18.1.0'
implementation 'com.google.android.gms:play-services-location:21.0.0'
implementation 'com.google.android.gms:play-services-maps:18.1.0'
implementation 'com.google.android.gms:play-services-location:19.0.1'
implementation 'com.google.android.gms:play-services-maps:18.0.2'
api 'com.google.maps.android:android-maps-utils:0.5'
//------------------------------ Work Manager -----------------------------//
......
......@@ -225,16 +225,18 @@ public class ContextualActivity extends Activity implements View.OnClickListener
}
private void askActivateDialog() {
mAlertDialogAskActivate = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_activate_telco_title)
.setMessage(R.string.cos_dlg_activate_telco_subtitle)
.setPositiveButton(R.string.cos_dlg_positive_button, (dialogPositive, whichPositive) -> {
activateGift();
})
.setNegativeButton(R.string.cos_dlg_negative_button2, (dialogNegative, whichNegative) -> {
dialogNegative.dismiss();
})
.show();
if (!isFinishing()) {
mAlertDialogAskActivate = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_activate_telco_title)
.setMessage(R.string.cos_dlg_activate_telco_subtitle)
.setPositiveButton(R.string.cos_dlg_positive_button, (dialogPositive, whichPositive) -> {
activateGift();
})
.setNegativeButton(R.string.cos_dlg_negative_button2, (dialogNegative, whichNegative) -> {
dialogNegative.dismiss();
})
.show();
}
}
private void errorActivatingDialog() {
......@@ -264,13 +266,15 @@ public class ContextualActivity extends Activity implements View.OnClickListener
analyticsEvent.setParameter("successful", "true");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
mAlertDialogSuccessActivating = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_activate_success_title)
.setMessage(R.string.cos_dlg_activate_success_subtitle)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
})
.show();
if (!isFinishing()) {
mAlertDialogSuccessActivating = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_activate_success_title)
.setMessage(R.string.cos_dlg_activate_success_subtitle)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
})
.show();
}
}
// ===========================================================
......
......@@ -216,84 +216,96 @@ public class CouponShareActivity extends Activity implements View.OnClickListene
}
private void acceptSharingDialog() {
mAlertDialogSuccessSharing = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_success_title)
.setMessage(R.string.cos_dlg_positive_coupon_text)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
if (mIsFromWallet) {
setResult(RESULT_OK, new Intent());
onBackPressed();
}
})
.show();
if (!isFinishing()) {
mAlertDialogSuccessSharing = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_success_title)
.setMessage(R.string.cos_dlg_positive_coupon_text)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
if (mIsFromWallet) {
setResult(RESULT_OK, new Intent());
onBackPressed();
}
})
.show();
}
}
private void errorSharingDialog() {
mAlertDialogErrorSharing = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_error_title)
.setMessage(R.string.cos_dlg_error_subtitle)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
})
.show();
if (!isFinishing()) {
mAlertDialogErrorSharing = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_error_title)
.setMessage(R.string.cos_dlg_error_subtitle)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
})
.show();
}
}
private void wrongNumberDialog(String message) {
mAlertDialogWrongNumberSharing = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_error_title)
.setMessage(message)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
})
.show();
if (!isFinishing()) {
mAlertDialogWrongNumberSharing = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_error_title)
.setMessage(message)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
})
.show();
}
}
private void errorSharingDialog2() {
mAlertDialogErrorSharing = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_error_title2)
.setMessage(R.string.cos_dlg_error_subtitle2)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
})
.show();
if (!isFinishing()) {
mAlertDialogErrorSharing = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_error_title2)
.setMessage(R.string.cos_dlg_error_subtitle2)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
})
.show();
}
}
private void showNoAssetsDialog() {
mAlertDialogNoAssets = new AlertDialog.Builder(this)
.setTitle(R.string.cos_coupon_gift)
.setMessage(R.string.cos_share_no_assets)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
onBackPressed();
})
.show();
if (!isFinishing()) {
mAlertDialogNoAssets = new AlertDialog.Builder(this)
.setTitle(R.string.cos_coupon_gift)
.setMessage(R.string.cos_share_no_assets)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
onBackPressed();
})
.show();
}
}
private void askSharingDialog() {
mAlertDialogCouponAskSharing = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_positive_coupon_title)
.setMessage(R.string.cos_dlg_positive_coupon_subtitle)
.setPositiveButton(R.string.cos_dlg_negative_button3, (dialogPositive, whichPositive) -> {
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("ShareCoupon")
.concat(":")
.concat(mCoupon.getName()));
new Thread(() -> {
if (!Thread.currentThread().isInterrupted()) {
WarplyManager.cosmoteCouponSharing(new CosmoteCouponSharingRequest()
.setCoupon(mCoupon.getCoupon())
.setSender(mSender)
.setReceiver(mEdtReceiver.getText().toString())
, mCouponSharingCallback);
}
Thread.currentThread().interrupt();
}).start();
})
.setNegativeButton(R.string.cos_dlg_negative_button2, (dialogNegative, whichNegative) -> {
dialogNegative.dismiss();
})
.show();
if (!isFinishing()) {
mAlertDialogCouponAskSharing = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_positive_coupon_title)
.setMessage(R.string.cos_dlg_positive_coupon_subtitle)
.setPositiveButton(R.string.cos_dlg_negative_button3, (dialogPositive, whichPositive) -> {
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("ShareCoupon")
.concat(":")
.concat(mCoupon.getName()));
new Thread(() -> {
if (!Thread.currentThread().isInterrupted()) {
WarplyManager.cosmoteCouponSharing(new CosmoteCouponSharingRequest()
.setCoupon(mCoupon.getCoupon())
.setSender(mSender)
.setReceiver(mEdtReceiver.getText().toString())
, mCouponSharingCallback);
}
Thread.currentThread().interrupt();
}).start();
})
.setNegativeButton(R.string.cos_dlg_negative_button2, (dialogNegative, whichNegative) -> {
dialogNegative.dismiss();
})
.show();
}
}
private final CallbackReceiver<Consumer> mConsumerCallback = new CallbackReceiver<Consumer>() {
......
......@@ -236,17 +236,19 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
analyticsEvent.setParameter("successful", "true");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
mAlertDialogCouponset = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_success_couponset_title)
.setMessage(R.string.cos_dlg_success_couponset_subtitle)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
if (success) {
if (!isFinishing()) {
mAlertDialogCouponset = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_success_couponset_title)
.setMessage(R.string.cos_dlg_success_couponset_subtitle)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
if (success) {
// setResult(RESULT_OK, new Intent());
onBackPressed();
}
})
.show();
onBackPressed();
}
})
.show();
}
} else {
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("loyalty_offer_activated");
......@@ -256,51 +258,61 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
if (status == 3) {
mAlertDialogCouponset = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_error_title)
.setMessage(R.string.cos_dlg_error_subtitle_non_buyable)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
})
.show();
if (!isFinishing()) {
mAlertDialogCouponset = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_error_title)
.setMessage(R.string.cos_dlg_error_subtitle_non_buyable)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
})
.show();
}
} else if (status == 5) {
mAlertDialogCouponset = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_error_title)
.setMessage(R.string.cos_dlg_error_subtitle_no_points)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
})
.show();
if (!isFinishing()) {
mAlertDialogCouponset = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_error_title)
.setMessage(R.string.cos_dlg_error_subtitle_no_points)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
})
.show();
}
} else if (status == 6) {
mAlertDialogCouponset = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_coupon_depleted_title)
.setMessage(R.string.cos_dlg_coupon_depleted_message)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
})
.show();
if (!isFinishing()) {
mAlertDialogCouponset = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_coupon_depleted_title)
.setMessage(R.string.cos_dlg_coupon_depleted_message)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
})
.show();
}
} else {
mAlertDialogCouponset = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_error_title)
.setMessage(R.string.cos_dlg_error_subtitle)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
})
.show();
if (!isFinishing()) {
mAlertDialogCouponset = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_error_title)
.setMessage(R.string.cos_dlg_error_subtitle)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
})
.show();
}
}
}
}
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();
if (!isFinishing()) {
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();
}
}
// ===========================================================
......
......@@ -514,15 +514,17 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
}
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();
if (!isFinishing()) {
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();
}
}
// ===========================================================
......
......@@ -265,20 +265,22 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
// ===========================================================
private void showNoShopsAvailableDialog() {
mAlertDialogNoShopsAvailable = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_no_shops_title)
.setMessage(R.string.cos_dlg_no_shops)
.setCancelable(false)
.setPositiveButton(R.string.cos_dlg_no_shops_positive, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
openWebsite();
})
.setNegativeButton(R.string.cos_dlg_negative_button2, (dialogNegative, whichNegative) -> {
dialogNegative.dismiss();
onBackPressed();
})
.show();
if (!isFinishing()) {
mAlertDialogNoShopsAvailable = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_no_shops_title)
.setMessage(R.string.cos_dlg_no_shops)
.setCancelable(false)
.setPositiveButton(R.string.cos_dlg_no_shops_positive, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
openWebsite();
})
.setNegativeButton(R.string.cos_dlg_negative_button2, (dialogNegative, whichNegative) -> {
dialogNegative.dismiss();
onBackPressed();
})
.show();
}
}
private void openWebsite() {
......
......@@ -259,16 +259,18 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
}
private void askActivateDialog() {
mAlertDialogAskActivate = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_activate_telco_title)
.setMessage(R.string.cos_dlg_activate_telco_subtitle)
.setPositiveButton(R.string.cos_dlg_positive_button, (dialogPositive, whichPositive) -> {
activateGift();
})
.setNegativeButton(R.string.cos_dlg_negative_button2, (dialogNegative, whichNegative) -> {
dialogNegative.dismiss();
})
.show();
if (!isFinishing()) {
mAlertDialogAskActivate = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_activate_telco_title)
.setMessage(R.string.cos_dlg_activate_telco_subtitle)
.setPositiveButton(R.string.cos_dlg_positive_button, (dialogPositive, whichPositive) -> {
activateGift();
})
.setNegativeButton(R.string.cos_dlg_negative_button2, (dialogNegative, whichNegative) -> {
dialogNegative.dismiss();
})
.show();
}
}
private void errorActivatingDialog() {
......@@ -279,13 +281,15 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
analyticsEvent.setParameter("successful", "false");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
mAlertDialogErrorActivating = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_error_title)
.setMessage(R.string.cos_dlg_error_subtitle)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
})
.show();
if (!isFinishing()) {
mAlertDialogErrorActivating = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_error_title)
.setMessage(R.string.cos_dlg_error_subtitle)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
})
.show();
}
}
private void successActivatingDialog() {
......@@ -296,13 +300,15 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
analyticsEvent.setParameter("successful", "true");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
mAlertDialogSuccessActivating = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_activate_success_title)
.setMessage(R.string.cos_dlg_activate_success_subtitle)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
})
.show();
if (!isFinishing()) {
mAlertDialogSuccessActivating = new AlertDialog.Builder(this)
.setTitle(R.string.cos_dlg_activate_success_title)
.setMessage(R.string.cos_dlg_activate_success_subtitle)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
})
.show();
}
}
// ===========================================================
......
<resources>
<dimen name="width_full">360dp</dimen>
<dimen name="height_carousel">240dp</dimen>
<dimen name="marginTop">52dp</dimen>
</resources>
......
<resources>
<dimen name="width_full">320dp</dimen>
<dimen name="height_carousel">220dp</dimen>
<dimen name="marginTop">140dp</dimen>
</resources>
......
<resources>
<dimen name="width_full">320dp</dimen>
<dimen name="height_carousel">220dp</dimen>
<dimen name="marginTop">240dp</dimen>
</resources>