Panagiotis Triantafyllou

new keys

......@@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity {
public void onWarplyReady() {
if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) {
WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest()
.setGuid("6012049321"), //6012049321, 6012049322, 6012049323
.setGuid("7000000826"), //6012049321, 6012049322, 6012049323, 7000000831 history
mLoginReceiver);
} else {
startNextActivity();
......
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4-cosbeta62'
PUBLISH_VERSION = '4.5.4-cosbeta63'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -124,6 +124,8 @@ public class ContextualActivity extends Activity implements View.OnClickListener
private void showActivationDialog() {
final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this);
bottomSheetDialog.setContentView(R.layout.dl_share);
TextView tvHeader = bottomSheetDialog.findViewById(R.id.tv_sender_value);
tvHeader.setText(R.string.cos_coupon_share_telco);
LinearLayout parent = bottomSheetDialog.findViewById(R.id.ll_share_dialog_view_inner);
ImageView dialogClose = (ImageView) bottomSheetDialog.findViewById(R.id.iv_sender_list_close);
......@@ -169,6 +171,7 @@ public class ContextualActivity extends Activity implements View.OnClickListener
.setUserMsisdn(mSender)
.setSessionId(mCCMS.getSessionId())
.setBusinessService(mCCMS.getBusinessService())
.setNotificationMessage(mCCMS.getNotificationMessage())
.setOfferName(mCCMS.getOfferName())
.setProductType(mCCMS.getProductType())
.setProvDuration(mCCMS.getProvDuration())
......
......@@ -280,6 +280,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
seasonalCLick.setTitle(dataItem.getSeasonalList().getTitle());
seasonalCLick.setLoyaltyPackageId(dataItem.getSeasonalList().getLoyaltyPackageId());
seasonalCLick.setImageUrl(dataItem.getSeasonalList().getImageUrl());
seasonalCLick.setContext(GiftsForYouActivity.this);
EventBus.getDefault().post(new WarplyEventBusManager(seasonalCLick));
} else if (dataItem.getDataType() == 3) {
Intent intent = new Intent(GiftsForYouActivity.this, ContextualActivity.class);
......@@ -414,6 +415,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
seasonalCLick.setTitle(dataItem.getSeasonalList().getTitle());
seasonalCLick.setLoyaltyPackageId(dataItem.getSeasonalList().getLoyaltyPackageId());
seasonalCLick.setImageUrl(dataItem.getSeasonalList().getImageUrl());
seasonalCLick.setContext(GiftsForYouActivity.this);
EventBus.getDefault().post(new WarplyEventBusManager(seasonalCLick));
} else if (dataItem.getDataType() == 3) {
Intent intent = new Intent(GiftsForYouActivity.this, ContextualActivity.class);
......
......@@ -16,11 +16,15 @@ import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import io.github.inflationx.calligraphy3.CalligraphyTypefaceSpan;
import io.github.inflationx.calligraphy3.TypefaceUtils;
import io.github.inflationx.viewpump.ViewPumpContextWrapper;
import ly.warp.sdk.R;
import ly.warp.sdk.io.callbacks.CallbackReceiver;
import ly.warp.sdk.io.models.Coupon;
import ly.warp.sdk.io.models.CouponList;
import ly.warp.sdk.io.models.Couponset;
import ly.warp.sdk.io.models.SharingCoupon;
import ly.warp.sdk.io.models.SharingList;
......@@ -47,7 +51,7 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis
private RecyclerView mRvExpiredCoupons, mRvSharedCoupons;
private ExpiredCouponAdapter mAdapterExpiredCoupons;
private SharedCouponAdapter mAdapterSharedCoupons;
private LinearLayout mLlExpiredTab, mLlSharedTab;
private LinearLayout mLlExpiredTab, mLlSharedTab, mLlShowMoreExpired, mLlShowMoreShared;
private RelativeLayout mRlExpiredView, mRlSharedView;
private SharingList mSharedCoupons = new SharingList();
......@@ -70,6 +74,8 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis
mRvSharedCoupons = findViewById(R.id.rv_shared_coupons);
mTvSharedEmpty = findViewById(R.id.tv_shared_empty);
mTvExpiredEmpty = findViewById(R.id.tv_expired_empty);
mLlShowMoreExpired = findViewById(R.id.ll_show_more_expired);
mLlShowMoreShared = findViewById(R.id.ll_show_more_shared);
initViews();
}
......@@ -138,6 +144,20 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis
mRlExpiredView.setVisibility(View.GONE);
mRlSharedView.setVisibility(View.VISIBLE);
return;
}
if (view.getId() == R.id.ll_show_more_expired) {
mLlShowMoreExpired.setVisibility(View.GONE);
mAdapterExpiredCoupons = new ExpiredCouponAdapter(this, WarplyManagerHelper.getCouponExpiredList());
mRvExpiredCoupons.setAdapter(mAdapterExpiredCoupons);
mAdapterExpiredCoupons.notifyDataSetChanged();
return;
}
if (view.getId() == R.id.ll_show_more_shared) {
mLlShowMoreShared.setVisibility(View.GONE);
mAdapterSharedCoupons = new SharedCouponAdapter(LoyaltyAnalysisActivity.this, mSharedCoupons);
mRvSharedCoupons.setAdapter(mAdapterSharedCoupons);
mAdapterSharedCoupons.notifyDataSetChanged();
}
}
......@@ -154,6 +174,8 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis
mIvBack.setOnClickListener(this);
mLlExpiredTab.setOnClickListener(this);
mLlSharedTab.setOnClickListener(this);
mLlShowMoreExpired.setOnClickListener(this);
mLlShowMoreShared.setOnClickListener(this);
mLlExpiredTab.setBackgroundResource(R.drawable.bottom_border_gradient2);
TextView expiredTab = findViewById(R.id.tv_expired_tab);
......@@ -195,18 +217,19 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis
mTvCouponsValueAll.setText(sBuilder, TextView.BufferType.SPANNABLE);
if (WarplyManagerHelper.getCouponExpiredList() != null && WarplyManagerHelper.getCouponExpiredList().size() > 0) {
if (WarplyManagerHelper.getCouponExpiredList().size() >= 3) {
ArrayList<Coupon> tempList = new ArrayList<>(WarplyManagerHelper.getCouponExpiredList().subList(0, 3));
mRvExpiredCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
mAdapterExpiredCoupons = new ExpiredCouponAdapter(this, tempList);
mRvExpiredCoupons.setAdapter(mAdapterExpiredCoupons);
mLlShowMoreExpired.setVisibility(View.VISIBLE);
return;
}
mRvExpiredCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
mAdapterExpiredCoupons = new ExpiredCouponAdapter(this, WarplyManagerHelper.getCouponExpiredList());
mRvExpiredCoupons.setAdapter(mAdapterExpiredCoupons);
// mAdapterCoupons.getPositionClicks()
// .doOnNext(coupon -> {
// Intent intent = new Intent(ActiveCouponsActivity.this, CouponInfoActivity.class);
// intent.putExtra("coupon", (Serializable) coupon);
// startActivity(intent);
// })
// .doOnError(error -> {
// })
// .subscribe();
} else {
mTvExpiredEmpty.setVisibility(View.VISIBLE);
}
......@@ -237,6 +260,16 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis
runOnUiThread(() -> {
if (mSharedCoupons != null && mSharedCoupons.size() > 0) {
if (mSharedCoupons.size() >= 3) {
ArrayList<SharingCoupon> tempList = new ArrayList<>(mSharedCoupons.subList(0, 3));
mRvSharedCoupons.setLayoutManager(new LinearLayoutManager(LoyaltyAnalysisActivity.this, LinearLayoutManager.VERTICAL, false));
mAdapterSharedCoupons = new SharedCouponAdapter(LoyaltyAnalysisActivity.this, tempList);
mRvSharedCoupons.setAdapter(mAdapterSharedCoupons);
mLlShowMoreShared.setVisibility(View.VISIBLE);
return;
}
mRvSharedCoupons.setLayoutManager(new LinearLayoutManager(LoyaltyAnalysisActivity.this, LinearLayoutManager.VERTICAL, false));
mAdapterSharedCoupons = new SharedCouponAdapter(LoyaltyAnalysisActivity.this, mSharedCoupons);
mRvSharedCoupons.setAdapter(mAdapterSharedCoupons);
......
......@@ -227,6 +227,7 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
.setSessionId(mCCMS.getSessionId())
.setBusinessService(mCCMS.getBusinessService())
.setOfferName(mCCMS.getOfferName())
.setNotificationMessage(mCCMS.getNotificationMessage())
.setProductType(mCCMS.getProductType())
.setProvDuration(mCCMS.getProvDuration())
.setNoOfRecurrance(mCCMS.getNoOfRecurrance())
......
......@@ -25,6 +25,8 @@
package ly.warp.sdk.io.models;
import android.content.Context;
import java.util.HashMap;
/**
......@@ -35,6 +37,7 @@ public class LoyaltyGiftsForYouOfferClickEvent {
private String title;
private String imageUrl;
private String loyaltyPackageId;
private Context context;
public LoyaltyGiftsForYouOfferClickEvent() {
this.title = "";
......@@ -65,4 +68,12 @@ public class LoyaltyGiftsForYouOfferClickEvent {
public void setLoyaltyPackageId(String loyaltyPackageId) {
this.loyaltyPackageId = loyaltyPackageId;
}
public Context getContext() {
return context;
}
public void setContext(Context context) {
this.context = context;
}
}
......
......@@ -49,6 +49,7 @@ public class PacingDetails {
private static final String ENABLED = "enabled";
private static final String GOAL_REACHED = "goal_reached";
private static final String MESSAGE = "msg";
private static final String SHORTCUT_ENABLED = "shortcut_enabled";
/* Member variables of the Campaign object */
private PacingInner steps = new PacingInner();
......@@ -56,6 +57,7 @@ public class PacingDetails {
private boolean enabled = false;
private boolean goal_reached = false;
private String msg = "";
private boolean shortcut_enabled = false;
/**
* Basic constructor used to create an object from a String, representing a
......@@ -87,6 +89,7 @@ public class PacingDetails {
this.enabled = result.optBoolean(ENABLED);
this.goal_reached = result.optBoolean(GOAL_REACHED);
this.msg = result.optString(MESSAGE);
this.shortcut_enabled = result.optBoolean(SHORTCUT_ENABLED);
}
}
}
......@@ -102,8 +105,9 @@ public class PacingDetails {
jObj.putOpt(STEPS, this.steps);
jObj.putOpt(METERS, this.meters);
jObj.putOpt(ENABLED, this.enabled);
jObj.putOpt(ENABLED, this.goal_reached);
jObj.putOpt(ENABLED, this.msg);
jObj.putOpt(GOAL_REACHED, this.goal_reached);
jObj.putOpt(MESSAGE, this.msg);
jObj.putOpt(SHORTCUT_ENABLED, this.shortcut_enabled);
} catch (JSONException e) {
if (WarpConstants.DEBUG) {
e.printStackTrace();
......@@ -340,4 +344,20 @@ public class PacingDetails {
public String getMsg() {
return msg;
}
public void setGoal_reached(boolean goal_reached) {
this.goal_reached = goal_reached;
}
public void setMsg(String msg) {
this.msg = msg;
}
public boolean isShortcut_enabled() {
return shortcut_enabled;
}
public void setShortcut_enabled(boolean shortcut_enabled) {
this.shortcut_enabled = shortcut_enabled;
}
}
......
......@@ -74,6 +74,7 @@ public class CosmoteSubmitOrderRequest {
private String mValidity = "";
private String mTreatmentCode = "";
private String mSessionId = "";
private String mNotificationMessage = "";
// ===========================================================
// Constructor
......@@ -234,6 +235,11 @@ public class CosmoteSubmitOrderRequest {
return this;
}
public CosmoteSubmitOrderRequest setNotificationMessage(String notificationMessage) {
this.mNotificationMessage = notificationMessage;
return this;
}
/**
* Call this to get how often the cached data will be updated.
*
......@@ -319,6 +325,7 @@ public class CosmoteSubmitOrderRequest {
extraData.putOpt("OfferAudienceLevel", mOfferAudienceLevel);
extraData.putOpt("MSISDN", mOfferAudienceLevel.equals("msisdn") ? mUserMsisdn : "");
extraData.putOpt("GUID", "");
extraData.putOpt("notificationMessage", mNotificationMessage);
JSONArray parameters = new JSONArray();
JSONObject param1 = new JSONObject();
......
......@@ -15,6 +15,7 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.concurrent.TimeUnit;
......@@ -29,7 +30,7 @@ import ly.warp.sdk.utils.WarplyManagerHelper;
public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdapter.ExpiredCouponViewHolder> {
private Context mContext;
private CouponList mCoupons;
private /*CouponList*/ ArrayList<Coupon> mCoupons;
private final PublishSubject<Coupon> onClickSubject = PublishSubject.create();
public ExpiredCouponAdapter(Context mContext, CouponList campaignList) {
......@@ -37,6 +38,11 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap
this.mCoupons = campaignList;
}
public ExpiredCouponAdapter(Context mContext, ArrayList<Coupon> campaignList) {
this.mContext = mContext;
this.mCoupons = /*(CouponList)*/ campaignList;
}
public class ExpiredCouponViewHolder extends RecyclerView.ViewHolder {
private TextView tvCouponTitle, tvCouponValue, tvCouponDate;
private ImageView ivCouponLogo;
......
......@@ -17,6 +17,7 @@ import org.json.JSONObject;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.concurrent.TimeUnit;
......@@ -32,7 +33,7 @@ import ly.warp.sdk.utils.WarplyManagerHelper;
public class SharedCouponAdapter extends RecyclerView.Adapter<SharedCouponAdapter.SharedCouponViewHolder> {
private Context mContext;
private SharingList mCoupons;
private /*SharingList*/ ArrayList<SharingCoupon> mCoupons;
private final PublishSubject<SharingCoupon> onClickSubject = PublishSubject.create();
public SharedCouponAdapter(Context mContext, SharingList campaignList) {
......@@ -40,6 +41,11 @@ public class SharedCouponAdapter extends RecyclerView.Adapter<SharedCouponAdapte
this.mCoupons = campaignList;
}
public SharedCouponAdapter(Context mContext, ArrayList<SharingCoupon> campaignList) {
this.mContext = mContext;
this.mCoupons = campaignList;
}
public class SharedCouponViewHolder extends RecyclerView.ViewHolder {
private TextView tvCouponTitle, tvCouponValue, tvCouponDate, tvCouponLabel, tvCouponPhone;
private ImageView ivCouponLogo;
......
......@@ -95,24 +95,53 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_expired_coupons"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_expired_title"
android:layout_marginHorizontal="8dp"
android:layout_marginTop="24dp"
android:orientation="vertical" />
<LinearLayout
android:id="@+id/ll_show_more_expired"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/rv_expired_coupons"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:gravity="center"
android:orientation="horizontal"
android:visibility="gone"
tools:visibility="visible">
<TextView
android:id="@+id/tv_barcode"
fontPath="fonts/pf_square_sans_pro_medium.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cos_see_more"
android:textColor="@color/grey"
android:textSize="16sp" />
<ImageView
android:id="@+id/iv_barcode_arrow"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_marginStart="6dp"
android:src="@drawable/ic_down_dark" />
</LinearLayout>
<TextView
android:id="@+id/tv_expired_empty"
fontPath="fonts/pf_square_sans_pro_regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_expired_title"
android:layout_centerHorizontal="true"
android:layout_marginTop="56dp"
android:layout_below="@+id/tv_expired_title"
android:text="@string/cos_empty_expired_coupons"
android:textColor="@color/cos_light_grey2"
android:textSize="16sp"
android:visibility="gone"/>
android:visibility="gone" />
</RelativeLayout>
<RelativeLayout
......@@ -136,23 +165,52 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_shared_coupons"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_shared_title"
android:layout_marginHorizontal="8dp"
android:layout_marginTop="24dp"
android:orientation="vertical" />
<LinearLayout
android:id="@+id/ll_show_more_shared"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/rv_shared_coupons"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:gravity="center"
android:orientation="horizontal"
android:visibility="gone"
tools:visibility="visible">
<TextView
android:id="@+id/tv_barcode"
fontPath="fonts/pf_square_sans_pro_medium.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cos_see_more"
android:textColor="@color/grey"
android:textSize="16sp" />
<ImageView
android:id="@+id/iv_barcode_arrow"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_marginStart="6dp"
android:src="@drawable/ic_down_dark" />
</LinearLayout>
<TextView
android:id="@+id/tv_shared_empty"
fontPath="fonts/pf_square_sans_pro_regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_shared_title"
android:layout_centerHorizontal="true"
android:layout_marginTop="56dp"
android:layout_below="@+id/tv_shared_title"
android:text="@string/cos_empty_shared_coupons"
android:textColor="@color/cos_light_grey2"
android:textSize="16sp"
android:visibility="gone"/>
android:visibility="gone" />
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
......