Panagiotis Triantafyllou

sm deals changes

......@@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity {
public void onWarplyReady() {
if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) {
WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest()
.setGuid("7000000831"), //6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990, prod 6005892749, live 3000184910,prod 7000070282
.setGuid("7000000833"), //6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990, prod 6005892749, live 3000184910,prod 7000070282
mLoginReceiver);
} else {
startNextActivity();
......
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.5.4r2'
PUBLISH_VERSION = '4.5.5.4r3'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -65,7 +65,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
private ConstraintLayout mClDealsBanner, mClDealsView,
mClGiftsBanner, mClToolbar, mClMarket;
private LinearLayout mLlQuestionnaire, mLlUserBadge, mLlEmptyWallet, mLlDeals, mLlGifts,
mLlMarketView, mLlHistory, mLlBannerInfo, mLlVouchers, mLlVouchersSpinner;
mLlMarketView, mLlHistory, mLlBannerInfo, mLlVouchers, mLlVouchersSpinner,
mLlVouchersDisabled;
private FlowLayout mLlActiveCodesView;
private float couponDfyValue = 0.0f, mFavValue = 0.0f;
private RecyclerView mRecyclerCoupons, mRvMarketCoupons;
......@@ -80,13 +81,13 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
private MarketCouponAdapter mAdapterMarketCoupons;
private ExpandableLayout mElGifts;
private boolean mIsStayCollapsed = true;
private CardView mClExp, mCvVouchers;
private CardView mClExp, mCvVouchers, mCvVouchersDisabled;
private boolean mDfyPressed = false, mDealsBannerPressed = false, mQuestionnairePressed = false,
mHistoryPressed = false, mHistoryMarketPressed = false, mUnifiedPressed = false,
mCouponPressed = false, mHistoryBadgePressed = false, mUnifiedCountPressed = false,
mGiftsCountPressed = false;
private RelativeLayout mRlDeals, mRlUnified, mRlGifts;
private View mSeparator;
private View mSeparator, mSeparatorDisabled;
// ===========================================================
// Methods for/from SuperClass/Interfaces
......@@ -145,9 +146,12 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
mRlGifts = findViewById(R.id.rv_gifts_count);
mRecyclerCoupons = findViewById(R.id.rv_active_coupons);
mCvVouchers = findViewById(R.id.cv_vouchers);
mCvVouchersDisabled = findViewById(R.id.cv_vouchers_disabled);
mLlVouchers = findViewById(R.id.ll_vouchers);
mLlVouchersDisabled = findViewById(R.id.ll_vouchers_disabled);
mLlVouchersSpinner = findViewById(R.id.ll_vouchers_spinner);
mSeparator = findViewById(R.id.v_separator_vouchers);
mSeparatorDisabled = findViewById(R.id.v_separator_vouchers_disabled);
/** Deals Badge */
// if (WarplyManagerHelper.getActiveDFYCoupons() != null) {
......@@ -370,7 +374,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
return;
}
/** Vouchers Client's Screen */
if (view.getId() == R.id.cv_vouchers) {
if (view.getId() == R.id.cv_vouchers || view.getId() == R.id.cv_vouchers_disabled) {
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyWalletScreen")
.concat(":")
.concat("VouchersBadge"));
......@@ -945,6 +949,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
mRlUnified.setOnClickListener(this);
mRlGifts.setOnClickListener(this);
mCvVouchers.setOnClickListener(this);
mCvVouchersDisabled.setOnClickListener(this);
}
private void nonTelcoDialog() {
......@@ -977,11 +982,12 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
}
private void checkForEmpty() {
if (TextUtils.isEmpty(WarplyManagerHelper.getShowVouchersBanner())) {
/** Show spinner */
if (TextUtils.isEmpty(WarplyManagerHelper.getShowVouchersBanner()) || (!TextUtils.isEmpty(WarplyManagerHelper.getShowVouchersBanner()) && WarplyManagerHelper.getShowVouchersBanner().equals("null"))) {
/** Show spinner only if empty */
mLlVouchers.setVisibility(View.GONE);
mSeparator.setVisibility(View.VISIBLE);
mLlVouchersSpinner.setVisibility(View.VISIBLE);
if (TextUtils.isEmpty(WarplyManagerHelper.getShowVouchersBanner()))
mLlVouchersSpinner.setVisibility(View.VISIBLE);
if ((WarplyManagerHelper.getActiveDFYCoupons() != null && WarplyManagerHelper.getActiveDFYCoupons().size() == 0)
&& (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() == 0)
&& (WarplyManagerHelper.getCouponList() != null && WarplyManagerHelper.getCouponList().size() == 0)) {
......@@ -991,16 +997,19 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
mSeparator.setVisibility(View.VISIBLE);
mLlEmptyWallet.setVisibility(View.VISIBLE);
} else {
/** Show loyalty banners and show spinner and hide empty view */
/** Show loyalty banners and hide empty view
* Show spinner only if empty */
mLlEmptyWallet.setVisibility(View.GONE);
mLlBannerInfo.setVisibility(View.VISIBLE);
}
} else {
if (WarplyManagerHelper.getShowVouchersBanner().equals("true")) {
/** Hide spinner and hide empty view and show vouchers */
/** Hide spinner and hide empty view and show vouchers and hide disabled vouchers */
mLlVouchersSpinner.setVisibility(View.GONE);
mLlEmptyWallet.setVisibility(View.GONE);
mLlVouchers.setVisibility(View.VISIBLE);
mLlVouchersDisabled.setVisibility(View.GONE);
mSeparatorDisabled.setVisibility(View.VISIBLE);
if ((WarplyManagerHelper.getActiveDFYCoupons() != null && WarplyManagerHelper.getActiveDFYCoupons().size() == 0)
&& (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() == 0)
&& (WarplyManagerHelper.getCouponList() != null && WarplyManagerHelper.getCouponList().size() == 0)) {
......@@ -1013,20 +1022,24 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
mLlBannerInfo.setVisibility(View.VISIBLE);
}
} else if (WarplyManagerHelper.getShowVouchersBanner().equals("false")) {
/** Hide spinner and hide vouchers */
/** Hide spinner and hide vouchers and hide empty view and show disabled vouchers and show disabled separator */
mLlVouchersSpinner.setVisibility(View.GONE);
mLlEmptyWallet.setVisibility(View.GONE);
mLlVouchers.setVisibility(View.GONE);
mSeparator.setVisibility(View.VISIBLE);
mLlVouchersDisabled.setVisibility(View.VISIBLE);
mSeparatorDisabled.setVisibility(View.VISIBLE);
if ((WarplyManagerHelper.getActiveDFYCoupons() != null && WarplyManagerHelper.getActiveDFYCoupons().size() == 0)
&& (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() == 0)
&& (WarplyManagerHelper.getCouponList() != null && WarplyManagerHelper.getCouponList().size() == 0)) {
/** Hide loyalty banners and show empty view */
/** Hide loyalty banners and hide empty view and hide disabled separator */
mLlBannerInfo.setVisibility(View.GONE);
mLlEmptyWallet.setVisibility(View.VISIBLE);
} else {
/** Show loyalty banners and hide empty view */
mLlEmptyWallet.setVisibility(View.GONE);
mSeparatorDisabled.setVisibility(View.GONE);
} else {
/** Show loyalty banners and show disabled separator */
mLlBannerInfo.setVisibility(View.VISIBLE);
mSeparatorDisabled.setVisibility(View.VISIBLE);
}
}
}
......
......@@ -1413,16 +1413,18 @@ public class WarplyManagerHelper {
showVouchersBanner = "";
}
public static void setShowVouchersBanner(boolean show) {
showVouchersBanner = String.valueOf(show);
public static void setShowVouchersBanner(String show) {
showVouchersBanner = show;
}
public static String getShowVouchersBanner() {
return showVouchersBanner;
}
public static void setVouchersFetched(boolean success) {
setShowVouchersBanner(success);
public static void setVouchersFetched(String success) {
if (success.equals("true") || success.equals("false") || success.equals("null")) {
setShowVouchersBanner(success);
}
OneTimeWorkRequest mywork = new OneTimeWorkRequest.Builder(VouchersFetchedService.class).build();
WorkManager.getInstance(Warply.getWarplyContext()).enqueue(mywork);
......
<vector android:height="29.866667dp" android:viewportHeight="28"
android:viewportWidth="30" android:width="32dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#848484" android:fillType="evenOdd" android:pathData="M27.494,0.5C28.87,0.506 29.985,1.663 29.99,3.093C29.99,3.894 29.997,4.528 30,5.041L30,5.602C29.991,6.789 29.907,7.174 29.481,7.762C30.1,8.612 29.99,8.913 29.99,12.43C29.985,12.992 29.806,13.537 29.481,13.986C29.806,14.435 29.985,14.98 29.99,15.542C29.99,16.342 29.997,16.976 30,17.489L30,18.05C29.991,19.237 29.907,19.622 29.481,20.21C30.1,21.061 29.99,21.362 29.99,24.878C29.99,26.311 28.872,27.472 27.494,27.472C27.273,27.472 27.056,27.472 26.843,27.472L25.615,27.474C23.059,27.479 21.166,27.495 19.748,27.499L18.569,27.5C16.284,27.492 15.67,27.417 15.227,27.11L15.127,27.035C15.094,27.008 15.062,26.98 15.029,26.951L14.929,26.858L14.822,26.756C10.353,28.487 5.32,27.025 2.364,23.136C-0.592,19.248 -0.795,13.822 1.862,9.707C4.519,5.592 9.429,3.729 14.013,5.096V3.093C14.013,1.661 15.131,0.5 16.51,0.5H27.494ZM11.018,6.724C6.054,6.724 2.031,10.904 2.031,16.061C2.031,18.537 2.978,20.912 4.663,22.663C6.348,24.413 8.634,25.397 11.018,25.397C15.981,25.397 20.005,21.217 20.005,16.061C20.005,10.904 15.981,6.724 11.018,6.724ZM27.494,21.248H20.793C19.971,22.903 18.775,24.326 17.309,25.397H27.494C27.767,25.392 27.988,25.163 27.993,24.878V21.766C27.988,21.482 27.767,21.253 27.494,21.248ZM27.494,15.023H22.002C22.118,16.422 21.972,17.831 21.572,19.173H27.494C27.767,19.167 27.988,18.938 27.993,18.654V15.542C27.988,15.258 27.767,15.029 27.494,15.023ZM27.474,8.799H19.485C20.45,10.017 21.16,11.43 21.572,12.948H27.494C27.767,12.943 27.988,12.714 27.993,12.43V9.318C27.99,9.177 27.934,9.044 27.837,8.947C27.739,8.849 27.609,8.796 27.474,8.799ZM27.494,2.575H16.51C16.236,2.58 16.016,2.809 16.01,3.093V5.905C17.938,6.936 15.528,6.749 25.651,6.726L26.852,6.725L27.494,6.724C27.767,6.719 27.988,6.49 27.993,6.206C27.993,3.125 28.153,2.575 27.494,2.575Z"/>
<path android:fillColor="#848484" android:pathData="M11.9,21.5C10.474,21.5 9.258,21.15 8.251,20.451C7.244,19.751 6.537,18.828 6.129,17.68H4.5V16.041H5.773C5.762,15.921 5.756,15.74 5.756,15.5C5.756,15.271 5.762,15.101 5.773,14.992H4.5V13.352H6.112C6.52,12.194 7.227,11.265 8.234,10.566C9.241,9.855 10.458,9.5 11.883,9.5C12.902,9.5 13.801,9.664 14.582,9.992C15.363,10.309 15.997,10.762 16.483,11.352L14.837,13.057C14.474,12.587 14.022,12.238 13.479,12.008C12.947,11.779 12.381,11.664 11.781,11.664C11.125,11.664 10.537,11.817 10.016,12.123C9.507,12.418 9.105,12.828 8.811,13.352H12.919V14.992H8.302C8.291,15.101 8.285,15.271 8.285,15.5C8.285,15.62 8.296,15.8 8.319,16.041H12.919V17.68H8.828C9.134,18.205 9.541,18.615 10.05,18.91C10.559,19.194 11.142,19.336 11.798,19.336C12.398,19.336 12.964,19.221 13.496,18.992C14.039,18.762 14.491,18.413 14.854,17.943L16.5,19.647C16.013,20.238 15.38,20.697 14.599,21.025C13.818,21.341 12.919,21.5 11.9,21.5Z"/>
</vector>
......@@ -493,7 +493,7 @@
android:layout_marginTop="32dp"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible">
tools:visibility="gone">
<View
android:id="@+id/v_separator_vouchers"
......@@ -569,6 +569,112 @@
</LinearLayout>
<LinearLayout
android:id="@+id/ll_vouchers_disabled"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="14dp"
android:layout_marginTop="32dp"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible">
<View
android:id="@+id/v_separator_vouchers_disabled"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/cos_gray" />
<TextView
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:includeFontPadding="false"
android:maxLines="1"
android:text="@string/cos_vouchers_title"
android:textColor="@color/cos_light_black"
android:textSize="22sp" />
<androidx.cardview.widget.CardView
android:id="@+id/cv_vouchers_disabled"
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_marginHorizontal="2dp"
android:layout_marginTop="24dp"
android:layout_marginBottom="4dp"
app:cardCornerRadius="16dp"
app:cardElevation="2dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<ImageView
android:id="@+id/iv_vouchers_logo_disabled"
android:layout_width="32dp"
android:layout_height="30dp"
android:layout_marginStart="16dp"
android:src="@drawable/sv_vouchers_disabled"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_vouchers_info_title_disabled"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:includeFontPadding="false"
android:lineHeight="24dp"
android:text="@string/cos_vouchers_info_title_disabled"
android:textColor="@color/cos_gray2"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="@+id/iv_vouchers_logo_disabled"
app:layout_constraintEnd_toStartOf="@+id/iv_vouchers_arrow_disabled"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@+id/iv_vouchers_logo_disabled"
app:layout_constraintTop_toTopOf="@+id/iv_vouchers_logo_disabled" />
<ImageView
android:id="@+id/iv_vouchers_arrow_disabled"
android:layout_width="16dp"
android:layout_height="10dp"
android:layout_marginEnd="16dp"
android:rotation="270"
android:src="@drawable/sv_arrow_down"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:layout_width="16dp"
android:layout_height="16dp"
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">
<TextView
android:id="@+id/tv_vouchers_count_disabled"
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="wrap_content"
android:layout_height="16dp"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="@color/cos_light_black"
android:textSize="12sp"
android:text="0" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_empty_wallet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
......
......@@ -208,6 +208,7 @@
<string name="cos_dlg_try_again">Προσπάθησε ξανά αργότερα</string>
<string name="cos_dlg_service_unavailable">Προσωρινά μη διαθέσιμη πληροφορία.\nΠαρακαλούμε δοκίμασε ξανά σε λίγο.</string>
<string name="cos_dlg_return">Επιστροφή</string>
<string name="cos_vouchers_info_title_disabled">Διαθέσιμο υπόλοιπο</string>
<string-array name="coupons_array">
<item>Κουπόνια</item>
......