Panagiotis Triantafyllou

redesign supermarket part1

Showing 23 changed files with 847 additions and 2 deletions
......@@ -104,6 +104,9 @@ dependencies {
//------------------------------ Retrofit -----------------------------//
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
//------------------------------ Expandable Layout -----------------------------//
api 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
}
// In every export please update the version number
......
......@@ -48,6 +48,18 @@
android:theme="@style/SDKAppTheme" />
<activity
android:name="ly.warp.sdk.activities.LoyaltyMarketAnalysisActivity"
android:exported="false"
android:screenOrientation="portrait"
android:theme="@style/SDKAppTheme" />
<activity
android:name="ly.warp.sdk.activities.UnifiedCouponInfoActivity"
android:exported="false"
android:screenOrientation="portrait"
android:theme="@style/SDKAppTheme" />
<activity
android:name="ly.warp.sdk.activities.ActiveCouponsActivity"
android:exported="false"
android:screenOrientation="portrait"
......
/*
* Copyright 2010-2013 Warply Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package ly.warp.sdk.io.models;
import android.os.Parcel;
import android.os.Parcelable;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import ly.warp.sdk.utils.WarpUtils;
import ly.warp.sdk.utils.constants.WarpConstants;
/**
* Created by Panagiotis Triantafyllou on 04-Apr-23.
*/
public class UnifiedCoupon implements Parcelable, Serializable {
private static final long serialVersionUID = -4754964462459705285L;
/* Constants used to export the campaign in JSON formal and vice versa */
private static final String BARCODE = "barcode";
private static final String CODE = "code";
private static final String CREATED = "created";
private static final String COUPONS = "coupons";
private static final String STATUS = "status";
private static final String DESCRIPTION = "description";
/* Member variables of the Campaign object */
private String barcode = "";
private String description = "";
private String status = "";
private int code = 0;
private String created = "";
private ArrayList<Coupon> coupons = new ArrayList();
private Date expirationDate = new Date();
public UnifiedCoupon() {
this.barcode = "";
this.description = "";
this.status = "";
this.code = 0;
this.created = "";
this.coupons = new ArrayList();
this.expirationDate = new Date();
}
/**
* Basic constructor used to create an object from a String, representing a
* JSON Object
*
* @param json The String, representing the JSON Object
* @throws JSONException Thrown if the String cannot be converted to JSON
*/
public UnifiedCoupon(String json) throws JSONException {
this(new JSONObject(json));
}
/**
* Constructor used to create an Object from a given JSON Object
*
* @param json JSON Object used to create the Coupon
*/
public UnifiedCoupon(JSONObject json) {
if (json != null) {
this.barcode = json.optString(BARCODE);
this.description = json.optString(DESCRIPTION);
this.status = json.optString(STATUS);
this.code = json.optInt(CODE);
this.created = json.optString(CREATED);
JSONArray jArray = null;
jArray = json.optJSONArray(COUPONS);
if (jArray != null && jArray.length() > 0) {
for (int i = 0; i < jArray.length(); i++) {
JSONObject jObj = jArray.optJSONObject(i);
this.coupons.add(new Coupon(jObj));
}
}
}
}
public UnifiedCoupon(Parcel source) {
this.barcode = source.readString();
this.description = source.readString();
this.status = source.readString();
this.code = source.readInt();
this.created = source.readString();
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(this.barcode);
dest.writeString(this.description);
dest.writeString(this.status);
dest.writeInt(this.code);
dest.writeString(this.created);
}
/**
* Converts the Unified Coupon into a JSON Object
*
* @return The JSON Object created from this Unified Coupon
*/
public JSONObject toJSONObject() {
JSONObject jObj = new JSONObject();
try {
jObj.putOpt(BARCODE, this.barcode);
jObj.putOpt(DESCRIPTION, this.description);
jObj.putOpt(STATUS, this.status);
jObj.putOpt(CODE, this.code);
jObj.putOpt(CREATED, this.created);
jObj.putOpt(COUPONS, this.coupons);
} catch (JSONException e) {
if (WarpConstants.DEBUG) {
e.printStackTrace();
}
}
return jObj;
}
/**
* String representation of the Unified Coupon, as a JSON object
*
* @return A String representation of JSON object
*/
public String toString() {
if (toJSONObject() != null)
return toJSONObject().toString();
return null;
}
/**
* String representation of the Coupon, as a human readable JSON object
*
* @return A human readable String representation of JSON object
*/
public String toHumanReadableString() {
String humanReadableString = null;
try {
humanReadableString = toJSONObject().toString(2);
} catch (JSONException e) {
WarpUtils.warn("Failed converting Unified Coupon JSON object to String", e);
}
return humanReadableString;
}
// ================================================================================
// Getters
// ================================================================================
public String getBarcode() {
return barcode;
}
public void setBarcode(String barcode) {
this.barcode = barcode;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getCreated() {
return created;
}
public void setCreated(String created) {
this.created = created;
}
public ArrayList<Coupon> getCoupons() {
return coupons;
}
public void setCoupons(ArrayList<Coupon> coupons) {
this.coupons = coupons;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Date getExpirationDate() {
return expirationDate;
}
public void setExpirationDate(Date expirationDate) {
this.expirationDate = expirationDate;
}
@Override
public int describeContents() {
return 0;
}
public static final Creator<UnifiedCoupon> CREATOR = new Creator<UnifiedCoupon>() {
public UnifiedCoupon createFromParcel(Parcel source) {
return new UnifiedCoupon(source);
}
public UnifiedCoupon[] newArray(int size) {
return new UnifiedCoupon[size];
}
};
}
......@@ -54,6 +54,18 @@ public interface ApiService {
@Header(WarpConstants.HEADER_AUTHORIZATION) String bearer);
@Headers("Content-Type: application/json")
@POST("/oauth/{appUuid}/context")
Call<ResponseBody> getUnifiedCoupons(@Path("appUuid") String appUuid,
@Body RequestBody request,
@Header(WarpConstants.HEADER_DATE) String timeStamp,
@Header(WarpConstants.HEADER_LOYALTY_BUNDLE_ID) String bundleId,
@Header(WarpConstants.HEADER_UNIQUE_DEVICE_ID) String deviceId,
@Header(WarpConstants.HEADER_CHANNEL) String channel,
@Header(WarpConstants.HEADER_WEB_ID) String webId,
@Header(WarpConstants.HEADER_SIGNATURE) String signature,
@Header(WarpConstants.HEADER_AUTHORIZATION) String bearer);
@Headers("Content-Type: application/json")
@POST("/api/mobile/v2/{appUuid}/context/")
Call<ResponseBody> getMerchants(@Path("appUuid") String appUuid,
@Body RequestBody request,
......
......@@ -74,6 +74,7 @@ import ly.warp.sdk.io.models.LoyaltyGiftsForYouPackage;
import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel;
import ly.warp.sdk.io.models.MerchantList;
import ly.warp.sdk.io.models.PushCampaign;
import ly.warp.sdk.io.models.UnifiedCoupon;
import ly.warp.sdk.io.models.WarplyCouponsChangedEventModel;
import ly.warp.sdk.io.request.CosmoteRetrieveSharingRequest;
import ly.warp.sdk.io.request.CosmoteSharingRequest;
......@@ -123,6 +124,7 @@ public class WarplyManagerHelper {
public static double mMetersWebview = 0.0d;
public static int mStepsWebview = 0;
public static int mSteps = 0;
private static ArrayList<UnifiedCoupon> mMarketCoupons = new ArrayList<>();
// ===========================================================
// Methods for/from SuperClass/Interfaces
......@@ -1247,6 +1249,13 @@ public class WarplyManagerHelper {
mDealsSum = sum;
}
public static ArrayList<UnifiedCoupon> getMarketCoupons() {
return mMarketCoupons;
}
public static void setMarketCoupons( ArrayList<UnifiedCoupon> marketCoupons) {
mMarketCoupons = marketCoupons;
}
public static boolean checkForLoyaltySDKNotification(Context context, Map<String, String> pushPayload) {
Bundle data = convertToBundle(pushPayload);
if (data == null || !data.containsKey("loyalty-action"))
......
......@@ -97,6 +97,7 @@ import ly.warp.sdk.io.models.SharingList;
import ly.warp.sdk.io.models.TagsCategoriesList;
import ly.warp.sdk.io.models.TagsList;
import ly.warp.sdk.io.models.TransactionsList;
import ly.warp.sdk.io.models.UnifiedCoupon;
import ly.warp.sdk.io.models.WarplyPacingEventModel;
import ly.warp.sdk.io.request.CosmoteCouponSharingRequest;
import ly.warp.sdk.io.request.CosmotePostEventRequest;
......@@ -1892,6 +1893,71 @@ public class WarplyManager {
});
}
public static void getUnifiedCoupons(final CallbackReceiver<ArrayList<UnifiedCoupon>> receiver) {
WarpUtils.log("************* WARPLY User Coupons Request ********************");
WarpUtils.log("[WARP Trace] WARPLY User Coupons Request is active");
WarpUtils.log("**************************************************");
ApiService service = ApiClient.getRetrofitInstance().create(ApiService.class);
getUnifiedCouponsRetro(service, new Callback<ResponseBody>() {
@Override
public void onResponse(@NonNull Call<ResponseBody> call, @NonNull Response<ResponseBody> responseCoupons) {
if (responseCoupons.code() == 200 && responseCoupons.body() != null) {
JSONObject jobjCouponsResponse = null;
try {
jobjCouponsResponse = new JSONObject(responseCoupons.body().string());
} catch (Exception e) {
e.printStackTrace();
}
if (jobjCouponsResponse != null && jobjCouponsResponse.has("status") && jobjCouponsResponse.optInt("status", 2) == 1) {
ArrayList<UnifiedCoupon> couponList = new ArrayList<UnifiedCoupon>();
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_success_unified_coupons_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
JSONObject finalJobjCouponsResponse = jobjCouponsResponse;
final ExecutorService executor = Executors.newFixedThreadPool(1);
executor.submit(() -> {
JSONObject jCouponsBody = null;
try {
jCouponsBody = finalJobjCouponsResponse.optJSONObject("result");
if (jCouponsBody != null && jCouponsBody.length() > 0) {
JSONArray jCouponsInnerBody = null;
jCouponsInnerBody = jCouponsBody.optJSONArray("coupons");
if (jCouponsInnerBody != null && jCouponsInnerBody.length() > 0) {
for (int i = 0; i < jCouponsInnerBody.length(); i++) {
couponList.add(new UnifiedCoupon(jCouponsInnerBody.optJSONObject(i)));
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
new Handler(Looper.getMainLooper()).post(() -> receiver.onSuccess(couponList));
executor.shutdownNow();
});
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_unified_coupons_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(2);
}
} else {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_unified_coupons_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(responseCoupons.code());
}
}
@Override
public void onFailure(@NonNull Call<ResponseBody> call, @NonNull Throwable t) {
LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
dynatraceEvent.setEventName("custom_error_user_coupons_loyalty");
EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
receiver.onFailure(2);
}
});
}
public static void getUserCouponsWithCouponsets(WarplyUserCouponsRequest request, final CallbackReceiver<CouponList> receiver) {
WarpUtils.log("************* WARPLY User Coupons Request ********************");
WarpUtils.log("[WARP Trace] WARPLY User Coupons Request is active");
......@@ -2248,6 +2314,58 @@ public class WarplyManager {
});
}
private static void getUnifiedCouponsRetro(ApiService service, Callback<ResponseBody> callback) {
String timeStamp = DateFormat.format("yyyy-MM-dd hh:mm:ss", System.currentTimeMillis()).toString();
String apiKey = WarpUtils.getApiKey(Warply.getWarplyContext());
String webId = WarpUtils.getWebId(Warply.getWarplyContext());
Map<String, Object> jsonParamsCouponsets = new ArrayMap<>();
Map<String, Object> jsonParams = new ArrayMap<>();
jsonParams.put("action", "retrieve_unified_coupons");
jsonParams.put("language", WarplyProperty.getLanguage(Warply.getWarplyContext()));
jsonParamsCouponsets.put("coupon", jsonParams);
RequestBody unifiedCouponsRequest = RequestBody.create(MediaType.get("application/json; charset=utf-8"), (new JSONObject(jsonParamsCouponsets)).toString());
Call<ResponseBody> unifiedCouponsCall = service.getUnifiedCoupons(
WarplyProperty.getAppUuid(Warply.getWarplyContext()),
unifiedCouponsRequest,
timeStamp,
"android:" + Warply.getWarplyContext().getPackageName(),
new WarplyDeviceInfoCollector(Warply.getWarplyContext()).getUniqueDeviceId(),
"mobile",
webId,
WarpUtils.produceSignature(apiKey + timeStamp),
"Bearer " + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("access_token")
);
unifiedCouponsCall.enqueue(new Callback<ResponseBody>() {
@Override
public void onResponse(@NonNull Call<ResponseBody> call, @NonNull Response<ResponseBody> response) {
if (response.code() == 401) {
refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() {
@Override
public void onSuccess(JSONObject result) {
int status = result.optInt("status", 2);
if (status == 1)
getUnifiedCouponsRetro(service, callback);
else
callback.onFailure(call, new Throwable());
}
@Override
public void onFailure(int errorCode) {
callback.onFailure(call, new Throwable());
}
});
} else {
callback.onResponse(call, response);
}
}
@Override
public void onFailure(@NonNull Call<ResponseBody> call, @NonNull Throwable t) {
callback.onFailure(call, t);
}
});
}
private static void getMerchantsRetro(ApiService service, Callback<ResponseBody> callback) {
String timeStamp = DateFormat.format("yyyy-MM-dd hh:mm:ss", System.currentTimeMillis()).toString();
String apiKey = WarpUtils.getApiKey(Warply.getWarplyContext());
......
package ly.warp.sdk.views.adapters;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.concurrent.TimeUnit;
import io.reactivex.Observable;
import io.reactivex.subjects.PublishSubject;
import ly.warp.sdk.R;
import ly.warp.sdk.io.models.Coupon;
import ly.warp.sdk.io.models.UnifiedCoupon;
public class MarketCouponAdapter extends RecyclerView.Adapter<MarketCouponAdapter.ActiveCouponViewHolder> {
private Context mContext;
private ArrayList<UnifiedCoupon> mCoupons;
private final PublishSubject<UnifiedCoupon> onClickSubject = PublishSubject.create();
private boolean mIsPast = false;
public MarketCouponAdapter(Context mContext, ArrayList<UnifiedCoupon> campaignList) {
this.mContext = mContext;
this.mCoupons = campaignList;
this.mIsPast = false;
}
public MarketCouponAdapter(Context mContext, ArrayList<UnifiedCoupon> campaignList, boolean past) {
this.mContext = mContext;
this.mCoupons = campaignList;
this.mIsPast = past;
}
public class ActiveCouponViewHolder extends RecyclerView.ViewHolder {
private ImageView ivCouponBackground;
private TextView tvCouponTitle, tvCouponDate, tvCouponCount;
public ActiveCouponViewHolder(View view) {
super(view);
ivCouponBackground = view.findViewById(R.id.iv_past_coupon_background);
tvCouponTitle = view.findViewById(R.id.tv_market_coupons_title);
tvCouponDate = view.findViewById(R.id.tv_market_coupons_date);
tvCouponCount = view.findViewById(R.id.tv_market_coupons_count);
}
}
@Override
public int getItemCount() {
if (mCoupons == null)
return 0;
else
return mCoupons.size();
}
public UnifiedCoupon getItem(int id) {
return mCoupons.get(id);
}
public void updateData(ArrayList<UnifiedCoupon> couponList) {
mCoupons.clear();
mCoupons.addAll(couponList);
notifyDataSetChanged();
}
@Override
public ActiveCouponViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView;
if (mIsPast)
itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.past_coupon_layout, parent, false);
else
itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.market_coupon_layout, parent, false);
return new ActiveCouponViewHolder(itemView);
}
@Override
public void onBindViewHolder(final ActiveCouponViewHolder holder, int position) {
UnifiedCoupon couponItem = mCoupons.get(position);
if (couponItem != null) {
int count = 0;
if (couponItem.getCoupons() != null && couponItem.getCoupons().size() > 0) {
ArrayList<Coupon> couponList = new ArrayList<Coupon>();
for (Coupon item : couponItem.getCoupons()) {
if (item.getStatus() == 1) {
count++;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
Date newDate = new Date();
try {
newDate = simpleDateFormat.parse(item.getExpiration());
} catch (ParseException e) {
e.printStackTrace();
}
item.setExpirationDate(newDate);
couponList.add(item);
}
}
Collections.sort(couponList, (coupon1, coupon2) -> coupon1.getExpirationDate().compareTo(coupon2.getExpirationDate()));
if (couponList != null && couponList.size() > 0) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
Date newDate = new Date();
try {
newDate = simpleDateFormat.parse(couponList.get(0).getExpiration());
} catch (ParseException e) {
e.printStackTrace();
}
simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy");
holder.tvCouponDate.setText(String.format(mContext.getString(R.string.cos_coupon_date), simpleDateFormat.format(newDate != null ? newDate : "")));
}
}
if (count > 1) {
holder.tvCouponCount.setText(String.format(mContext.getString(R.string.cos_market_active_coupons), String.valueOf(count)));
} else if (count == 1) {
holder.tvCouponCount.setText(String.format(mContext.getString(R.string.cos_market_active_coupons_single), String.valueOf(count)));
}
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
// Date newDate = new Date();
// try {
// newDate = simpleDateFormat.parse(couponItem.getExpiration());
// } catch (ParseException e) {
// e.printStackTrace();
// }
// simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy");
// if (mIsPast)
// holder.tvCouponDate.setText(String.format(mContext.getString(R.string.cos_coupon_expired_date), simpleDateFormat.format(newDate != null ? newDate : "")));
// else
// holder.tvCouponDate.setText(String.format(mContext.getString(R.string.cos_coupon_date), simpleDateFormat.format(newDate != null ? newDate : "")));
// if (TextUtils.isEmpty(couponItem.getDiscount_type())) {
// holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.euro));
// } else {
// if (couponItem.getDiscount_type().equals("value")) {
// holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.euro));
// } else if (couponItem.getDiscount_type().equals("percentage")) {
// holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.percentage));
// } else if (couponItem.getDiscount_type().equals("plus_one")) {
// holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.plus_one));
// } else {
// holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.euro));
// }
// }
holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem));
}
}
public Observable<UnifiedCoupon> getPositionClicks() {
return onClickSubject.cache();
}
private long getDifferenceDays(Date d1, Date d2) {
long diff = d2.getTime() - d1.getTime();
return TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS);
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#F0E6E6"/>
<corners android:radius="10dp"/>
<padding android:left="4dp" android:top="2dp" android:right="4dp" android:bottom="2dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cl_custom_layout"
android:layout_width="match_parent"
android:layout_height="130dp"
android:layout_marginHorizontal="4dp"
android:layout_marginVertical="4dp"
android:background="@drawable/ic_coupon_background">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_vertical_72_percent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.72" />
<ImageView
android:id="@+id/iv_active_coupon"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginStart="24dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_gifts_for_you" />
<View
android:id="@+id/v_separator"
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginVertical="16dp"
android:layout_marginStart="8dp"
android:background="@drawable/shape_dashed_vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/iv_active_coupon"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/ll_coupon_info"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_72_percent"
app:layout_constraintStart_toEndOf="@+id/v_separator"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_active_coupons_title"
fontPath="fonts/pf_square_sans_pro_medium.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textColor="#3A5266"
android:textSize="16sp"
tools:text="Εκπτωτικο κουπονι 10$ για αγορες στα ΙΚΕΑ" />
<TextView
android:id="@+id/tv_active_coupons_value"
fontPath="fonts/pf_square_sans_pro_bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#3A5266"
android:textSize="42sp"
tools:text="10$" />
<TextView
android:id="@+id/tv_active_coupons_date"
fontPath="fonts/pf_square_sans_pro_medium.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#617181"
android:textSize="12sp"
android:visibility="gone"
tools:text="@string/cos_active_coupon_date" />
<TextView
android:id="@+id/tv_active_coupons_date_expired"
fontPath="fonts/pf_square_sans_pro_bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#617181"
android:textSize="12sp"
android:visibility="gone"
tools:text="@string/cos_market_coupon_expired" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_date_limit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_market_limit"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="gone"
android:layout_marginBottom="36dp"
android:layout_marginStart="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ll_coupon_info"
app:layout_constraintStart_toEndOf="@+id/v_separator"
tools:visibility="visible">
<!-- <ImageView-->
<!-- android:layout_width="14dp"-->
<!-- android:layout_height="14dp"-->
<!-- android:layout_marginEnd="4dp"-->
<!-- android:src="@drawable/timer_red" />-->
<TextView
fontPath="fonts/pf_square_sans_pro_medium.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cos_coupon_date_limit"
android:textColor="#617181"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_active_coupons_date_limit"
fontPath="fonts/pf_square_sans_pro_medium.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cos_coupon_date_limit"
android:textColor="#FF6B6B"
android:textSize="12sp"
tools:text="@string/cos_coupon_date_limit2" />
</LinearLayout>
<TextView
android:id="@+id/tv_active_coupons_description"
fontPath="fonts/pf_square_sans_pro_medium.ttf"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="32dp"
android:maxLines="4"
android:textColor="#617181"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/gl_vertical_72_percent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Εκπτωση με ελάχιστες αγορές 100€" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="130dp"
android:layout_marginHorizontal="4dp"
android:layout_marginVertical="4dp"
android:background="@drawable/ic_coupon_background_new2">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_vertical_72_percent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.72" />
<ImageView
android:id="@+id/iv_market_coupon"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginStart="24dp"
android:padding="18dp"
android:src="@drawable/ic_market_trolley"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/v_separator"
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginVertical="16dp"
android:layout_marginStart="8dp"
android:background="@drawable/shape_dashed_vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/iv_market_coupon"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/ll_coupon_info"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_72_percent"
app:layout_constraintStart_toEndOf="@+id/v_separator"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_market_coupons_title"
fontPath="fonts/BTCosmo-Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="3"
android:textColor="@color/cos_light_black"
android:textSize="16sp"
android:text="@string/cos_market_item_title" />
<TextView
fontPath="fonts/pf_square_sans_pro_bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#3A5266"
android:textSize="22sp"
android:text="" />
<TextView
android:id="@+id/tv_market_coupons_date"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/cos_light_black"
android:textSize="12sp"
tools:text="@string/cos_active_coupon_date" />
</LinearLayout>
<TextView
android:id="@+id/tv_market_coupons_count"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="32dp"
android:maxLines="4"
android:textColor="@color/cos_light_black"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/gl_vertical_72_percent"
app:layout_constraintTop_toTopOf="parent"
tools:text="@string/cos_market_active_coupons" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -71,4 +71,5 @@
<color name="cos_gray">#9D9D9C</color>
<color name="cos_gray2">#848484</color>
<color name="cos_light_blue">#00A5E3</color>
<color name="cos_grey_dark2">#32485A</color>
</resources>
\ No newline at end of file
......
......@@ -73,8 +73,8 @@
<string name="cos_gift_it">Δώρισέ το</string>
<string name="cos_popup_more_title">COSMOTE MORE FOR YOU</string>
<string name="cos_popup_more_subtitle">Σε αυτή την ενότητα βρες έρευνες, παιχνίδια, διαγωνισμούς και επιβραβεύσεις για τις αθλητικές σου δραστηριότητες!</string>
<string name="cos_deals_win_title">Μέχρι τώρα έχεις κερδίσει %1$s€ σε προσφορές από %2$s κουπόνια!</string>
<string name="cos_deals_win_title_cos">Μέχρι τώρα έχεις κερδίσει %1$s€ με το DEALS for YOU!</string>
<string name="cos_deals_win_title">Έχεις κερδίσει&#160;%1$s€&#160;με το\nGIFTS for YOU!</string>
<string name="cos_deals_win_title_cos">Έχεις κερδίσει&#160;%1$s€&#160;με το\nDEALS for YOU!</string>
<string name="cos_mygifts">Τα δώρα μου</string>
<string name="cos_gifts_banner_title">Δώρα:</string>
<string name="cos_see_more">Δες περισσότερα</string>
......@@ -150,6 +150,25 @@
<string name="cos_dlg_no_shops_title">Καταστήματα συνεργάτη</string>
<string name="cos_dlg_no_shops_positive">Δες το eshop</string>
<string name="cos_profile_preferences_placeholder">Οι προτιμήσεις μου</string>
<string name="cos_market_title">SuperMarket Deals</string>
<string name="cos_rewards_title2">COSMOTE Επιβράβευση</string>
<string name="cos_market_item_title">COSMOTE\nSuperMarket\nDeals</string>
<string name="cos_market_active_coupons">έχεις %1$s ενεργά κουπόνια</string>
<string name="cos_market_active_coupons_single">έχεις %1$s ενεργό κουπόνι</string>
<string name="cos_unified_title">Εκπτωτικό κουπόνι COSMOTE SuperMarket Deals!</string>
<string name="cos_unified_subtitle">Χρησιμοποίησε τον παρακάτω κωδικό και πάρε έκπτωση στα ενεργά κουπόνια προσφορών.</string>
<string name="cos_markets">Δες τα supermarket</string>
<string name="cos_show_market_coupons">Εμφάνιση κουπονιών</string>
<string name="cos_hide_market_coupons">Απόκρυψη κουπονιών</string>
<string name="cos_market_terms">1. Το εκπτωτικό κουπόνι ισχύει έως την ημερομηνία που αναφέρεται παραπάνω\n
2. To εκπτωτικό κουπόνι αφορά στα ενεργά κουπόνια προσφορών όπως αναφέρονται παραπάνω.\n
3. Το εκπτωτικό κουπόνι μπορεί να χρησιμοποιηθεί σε μια μόνο συναλλαγή.\n
4. Εάν δεν γίνει χρήση ενός επιμέρους κουπονιού προσφοράς από το εκπτωτικό κουπόνι, το κουπόνι προσφοράς επιστρέφει στο καλάθι στην ενότητα COSMOTE SuperMarket Deals</string>
<string name="cos_market_coupon_expired">Το κουπόνι έληξε</string>
<string name="cos_coupon_date_limit">Ισχύει έως&#160;</string>
<string name="cos_coupon_date_limit2">%1$s</string>
<string name="cos_for_you_all">Μέχρι τώρα έχεις κερδίσει&#160;%1$s€&#160;στο For You!</string>
<string name="cos_supermarket_win">Έχεις κερδίσει&#160;%1$s€&#160;με τα\nSuperMarket Deals!</string>
<string-array name="coupons_array">
<item>Κουπόνια</item>
......