Panagiotis Triantafyllou

many fixes and additions

Showing 25 changed files with 868 additions and 47 deletions
......@@ -52,6 +52,16 @@
android:screenOrientation="portrait" />
<activity
android:name="ly.warp.sdk.activities.ActiveRewardsActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name="ly.warp.sdk.activities.PastCouponsActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name="ly.warp.sdk.activities.GiftsForYouActivity"
android:exported="false"
android:screenOrientation="portrait" />
......
......@@ -13,8 +13,9 @@ import androidx.recyclerview.widget.RecyclerView;
import java.io.Serializable;
import ly.warp.sdk.R;
import ly.warp.sdk.io.models.Coupon;
import ly.warp.sdk.io.models.CouponList;
import ly.warp.sdk.views.adapters.mix.ActiveCouponAdapter;
import ly.warp.sdk.views.adapters.ActiveCouponAdapter;
public class ActiveCouponsActivity extends Activity implements View.OnClickListener {
......@@ -44,6 +45,13 @@ public class ActiveCouponsActivity extends Activity implements View.OnClickListe
if (getIntent().getExtras() != null && getIntent().getSerializableExtra("couponlist") != null) {
mCouponList = new CouponList(getIntent().getSerializableExtra("couponlist").toString(), true);
CouponList cpnlist = new CouponList();
for (Coupon cpn : mCouponList) {
if (cpn.getStatus() == 1)
cpnlist.add(cpn);
}
mCouponList.clear();
mCouponList.addAll(cpnlist);
}
mIvBack = findViewById(R.id.iv_coupons_close);
......
package ly.warp.sdk.activities;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.io.Serializable;
import ly.warp.sdk.R;
import ly.warp.sdk.io.models.Coupon;
import ly.warp.sdk.io.models.CouponList;
import ly.warp.sdk.views.adapters.ActiveRewardAdapter;
public class ActiveRewardsActivity extends Activity implements View.OnClickListener {
// ===========================================================
// Constants
// ===========================================================
// ===========================================================
// Fields
// ===========================================================
private ImageView mIvBack;
private RecyclerView mRecyclerRewards;
private ActiveRewardAdapter mAdapterRewards;
private CouponList mRewardList = new CouponList();
private TextView mTvEmptyRewards;
// ===========================================================
// Methods for/from SuperClass/Interfaces
// ===========================================================
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_active_rewards);
if (getIntent().getExtras() != null && getIntent().getSerializableExtra("couponlist") != null) {
mRewardList = new CouponList(getIntent().getSerializableExtra("couponlist").toString(), true);
CouponList cpnlist = new CouponList();
for (Coupon cpn : mRewardList) {
if (cpn.getStatus() == 1)
cpnlist.add(cpn);
}
mRewardList.clear();
mRewardList.addAll(cpnlist);
}
mIvBack = findViewById(R.id.iv_coupons_close);
mTvEmptyRewards = findViewById(R.id.tv_no_rewards);
if (mRewardList != null) {
mRecyclerRewards = findViewById(R.id.rv_active_rewards);
mRecyclerRewards.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
mAdapterRewards = new ActiveRewardAdapter(this, mRewardList);
mRecyclerRewards.setAdapter(mAdapterRewards);
mAdapterRewards.getPositionClicks()
.doOnNext(coupon -> {
Intent intent = new Intent(ActiveRewardsActivity.this, CouponInfoActivity.class);
intent.putExtra("coupon", (Serializable) coupon);
startActivity(intent);
})
.doOnError(error -> {
})
.subscribe();
} else {
mTvEmptyRewards.setVisibility(View.VISIBLE);
}
initViews();
}
@Override
public void onResume() {
super.onResume();
}
@Override
public void onClick(View view) {
if (view.getId() == R.id.iv_coupons_close) {
onBackPressed();
}
}
// ===========================================================
// Methods
// ===========================================================
private void initViews() {
mIvBack.setOnClickListener(this);
}
// ===========================================================
// Inner and Anonymous Classes
// ===========================================================
}
......@@ -25,7 +25,7 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
// ===========================================================
private ImageView mIvBack;
private Spinner mCouponSpinner, mRedemptionSpinner;
private Spinner mCouponSpinner, mRedemptionSpinner, mCollectionSpinner;
private TextView mTvAnalysisButton;
// ===========================================================
......@@ -40,6 +40,7 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
mIvBack = findViewById(R.id.iv_back);
mCouponSpinner = findViewById(R.id.sp_coupons);
mRedemptionSpinner = findViewById(R.id.sp_redemption);
mCollectionSpinner = findViewById(R.id.sp_collection);
mTvAnalysisButton = findViewById(R.id.rl_analysis_row).findViewById(R.id.cl_chart_info).findViewById(R.id.tv_analysis_details);
initViews();
......@@ -69,20 +70,26 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
if (parent.getId() == mCouponSpinner.getId()) {
if (pos == 1) {
mRedemptionSpinner.setVisibility(View.GONE);
mCollectionSpinner.setVisibility(View.VISIBLE);
findViewById(R.id.cl_tab_analysis).setVisibility(View.GONE);
findViewById(R.id.cl_chart).findViewById(R.id.cl_inner_chart).setVisibility(View.GONE);
findViewById(R.id.cl_chart).findViewById(R.id.cl_inner_chart2).setVisibility(View.VISIBLE);
ImageView piechart = findViewById(R.id.rl_analysis_row).findViewById(R.id.cl_chart).findViewById(R.id.cl_inner_chart).findViewById(R.id.iv_chart);
piechart.setImageResource(R.drawable.ic_chart_collection);
findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab).setVisibility(View.GONE);
findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab2).setVisibility(View.GONE);
findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab3).setVisibility(View.GONE);
findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab4).setVisibility(View.VISIBLE);
findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab5).setVisibility(View.VISIBLE);
} else {
mRedemptionSpinner.setVisibility(View.VISIBLE);
findViewById(R.id.cl_chart).findViewById(R.id.cl_inner_chart).setVisibility(View.VISIBLE);
findViewById(R.id.cl_chart).findViewById(R.id.cl_inner_chart2).setVisibility(View.GONE);
mCollectionSpinner.setVisibility(View.GONE);
ImageView piechart = findViewById(R.id.rl_analysis_row).findViewById(R.id.cl_chart).findViewById(R.id.cl_inner_chart).findViewById(R.id.iv_chart);
piechart.setImageResource(R.drawable.ic_chart);
findViewById(R.id.cl_tab_analysis).setVisibility(View.VISIBLE);
findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab).setVisibility(View.VISIBLE);
findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab2).setVisibility(View.VISIBLE);
findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab3).setVisibility(View.VISIBLE);
findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab4).setVisibility(View.GONE);
findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab5).setVisibility(View.GONE);
}
}
}
......@@ -111,6 +118,12 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
adapter2.setDropDownViewResource(R.layout.spinner_dropdown_item_sky_blue);
mRedemptionSpinner.setAdapter(adapter2);
mRedemptionSpinner.setOnItemSelectedListener(this);
ArrayAdapter<CharSequence> adapter3 = ArrayAdapter.createFromResource(this,
R.array.collection_array, R.layout.spinner_item);
adapter3.setDropDownViewResource(R.layout.spinner_dropdown_item_sky_blue);
mCollectionSpinner.setAdapter(adapter3);
mCollectionSpinner.setOnItemSelectedListener(this);
}
// ===========================================================
......
......@@ -30,7 +30,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
private TextView mTvUsername, mTvActiveCoupons,
mTvActiveRewards, mTvUserBadge;
private ConstraintLayout mClActiveCoupons, mClActiveRewards;
private LinearLayout mLlAnalysisButton, mLlQuestionnaire, mLlUserBadge;
private LinearLayout mLlAnalysisButton, mLlQuestionnaire, mLlUserBadge,
mLlPastCoupons;
// ===========================================================
// Methods for/from SuperClass/Interfaces
......@@ -52,6 +53,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
mTvActiveRewards = findViewById(R.id.tv_active_rewards);
mLlAnalysisButton = findViewById(R.id.ll_analysis);
mTvUserBadge = findViewById(R.id.tv_type);
mLlPastCoupons = findViewById(R.id.ll_old_coupons);
initViews();
}
......@@ -97,7 +99,15 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
return;
}
if (view.getId() == R.id.cl_loyalty_rewards) {
Intent intent = new Intent(LoyaltyWallet.this, ActiveRewardsActivity.class);
intent.putExtra("couponlist", WarplyManagerHelper.getCouponList());
startActivity(intent);
return;
}
if (view.getId() == R.id.ll_old_coupons) {
Intent intent = new Intent(LoyaltyWallet.this, PastCouponsActivity.class);
intent.putExtra("couponlist", WarplyManagerHelper.getCouponList());
startActivity(intent);
}
}
......@@ -131,6 +141,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
mTvActiveRewards.setText(String.format(getResources().getString(R.string.cos_active_rewards), String.valueOf(WarplyManagerHelper.getCouponList().size())));
mClActiveRewards.setOnClickListener(this);
mLlAnalysisButton.setOnClickListener(this);
mLlPastCoupons.setOnClickListener(this);
}
// ===========================================================
......
package ly.warp.sdk.activities;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.io.Serializable;
import ly.warp.sdk.R;
import ly.warp.sdk.io.models.Coupon;
import ly.warp.sdk.io.models.CouponList;
import ly.warp.sdk.views.adapters.ActiveCouponAdapter;
public class PastCouponsActivity extends Activity implements View.OnClickListener {
// ===========================================================
// Constants
// ===========================================================
// ===========================================================
// Fields
// ===========================================================
private ImageView mIvBack;
private RecyclerView mRecyclerCoupons;
private ActiveCouponAdapter mAdapterCoupons;
private CouponList mCouponList = new CouponList();
private TextView mTvEmptyCoupons;
// ===========================================================
// Methods for/from SuperClass/Interfaces
// ===========================================================
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_past_coupons);
if (getIntent().getExtras() != null && getIntent().getSerializableExtra("couponlist") != null) {
mCouponList = new CouponList(getIntent().getSerializableExtra("couponlist").toString(), true);
CouponList cpnlist = new CouponList();
for (Coupon cpn : mCouponList) {
if (cpn.getStatus() == 1)
cpnlist.add(cpn);
}
mCouponList.clear();
mCouponList.addAll(cpnlist);
}
mIvBack = findViewById(R.id.iv_coupons_close);
mTvEmptyCoupons = findViewById(R.id.tv_no_coupons);
if (mCouponList != null) {
mRecyclerCoupons = findViewById(R.id.rv_active_coupons);
mRecyclerCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
mAdapterCoupons = new ActiveCouponAdapter(this, mCouponList, true);
mRecyclerCoupons.setAdapter(mAdapterCoupons);
mAdapterCoupons.getPositionClicks()
.doOnNext(coupon -> {
// Intent intent = new Intent(PastCouponsActivity.this, CouponInfoActivity.class);
// intent.putExtra("coupon", (Serializable) coupon);
// startActivity(intent);
})
.doOnError(error -> {
})
.subscribe();
} else {
mTvEmptyCoupons.setVisibility(View.VISIBLE);
}
initViews();
}
@Override
public void onResume() {
super.onResume();
}
@Override
public void onClick(View view) {
if (view.getId() == R.id.iv_coupons_close) {
onBackPressed();
}
}
// ===========================================================
// Methods
// ===========================================================
private void initViews() {
mIvBack.setOnClickListener(this);
}
// ===========================================================
// Inner and Anonymous Classes
// ===========================================================
}
......@@ -41,7 +41,7 @@ public class WarplyHealthManager implements SensorEventListener {
private float oldVelocityEstimate = 0;
//TODO: if we want to send the steps back to an activity/fragment/service etc
// private WarplyHealthCallback healthCallback;
// private WarplyHealthCallback mHealthCallback;
// ===========================================================
// Methods for/from SuperClass/Interfaces
......@@ -118,7 +118,7 @@ public class WarplyHealthManager implements SensorEventListener {
&& (timeNs - lastStepTimeNs > STEP_DELAY_NS)) {
//TODO: if we want to send the steps back to an activity/fragment/service etc
mSteps++;
// healthCallback.onStepCount(mSteps);
// mHealthCallback.onStepCount(mSteps);
lastStepTimeNs = timeNs;
}
oldVelocityEstimate = velocityEstimate;
......
package ly.warp.sdk.views.adapters.mix;
package ly.warp.sdk.views.adapters;
import android.content.Context;
import android.text.TextUtils;
......@@ -22,7 +22,6 @@ import java.util.concurrent.TimeUnit;
import io.reactivex.Observable;
import io.reactivex.subjects.PublishSubject;
import ly.warp.sdk.R;
import ly.warp.sdk.activities.BaseFragmentActivity;
import ly.warp.sdk.io.models.Coupon;
import ly.warp.sdk.io.models.CouponList;
......@@ -31,18 +30,27 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
private Context mContext;
private CouponList mCoupons;
private final PublishSubject<Coupon> onClickSubject = PublishSubject.create();
private boolean mIsPast = false;
public ActiveCouponAdapter(Context mContext, CouponList campaignList) {
this.mContext = mContext;
this.mCoupons = campaignList;
this.mIsPast = false;
}
public ActiveCouponAdapter(Context mContext, CouponList campaignList, boolean past) {
this.mContext = mContext;
this.mCoupons = campaignList;
this.mIsPast = past;
}
public class ActiveCouponViewHolder extends RecyclerView.ViewHolder {
private ImageView ivCouponLogo;
private ImageView ivCouponLogo, ivCouponBackground;
private TextView tvCouponTitle, tvCouponValue, tvCouponDate, tvCouponDescription;
public ActiveCouponViewHolder(View view) {
super(view);
ivCouponBackground = view.findViewById(R.id.iv_past_coupon_background);
ivCouponLogo = view.findViewById(R.id.iv_active_coupon);
tvCouponTitle = view.findViewById(R.id.tv_active_coupons_title);
tvCouponValue = view.findViewById(R.id.tv_active_coupons_value);
......@@ -74,7 +82,10 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
@Override
public ActiveCouponViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView;
itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.active_coupon_layout, parent, false);
if (mIsPast)
itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.past_coupon_layout, parent, false);
else
itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.active_coupon_layout, parent, false);
return new ActiveCouponViewHolder(itemView);
}
......@@ -82,6 +93,9 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
public void onBindViewHolder(final ActiveCouponViewHolder holder, int position) {
Coupon couponItem = mCoupons.get(position);
if (mIsPast)
holder.ivCouponBackground.setColorFilter(ContextCompat.getColor(mContext, R.color.grey_light3), android.graphics.PorterDuff.Mode.MULTIPLY);
if (couponItem != null) {
if (!TextUtils.isEmpty(couponItem.getImage())) {
Glide.with(mContext)
......@@ -99,7 +113,8 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
}
holder.tvCouponTitle.setText(couponItem.getName());
holder.tvCouponDescription.setText(couponItem.getDescription());
if (!mIsPast)
holder.tvCouponDescription.setText(couponItem.getDescription());
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
Date newDate = new Date();
......@@ -109,7 +124,10 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
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 (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 : "")));
holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.euro));
holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem));
......
package ly.warp.sdk.views.adapters;
import android.content.Context;
import android.text.TextUtils;
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 com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
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.CouponList;
public class ActiveRewardAdapter extends RecyclerView.Adapter<ActiveRewardAdapter.ActiveRewardViewHolder> {
private Context mContext;
private CouponList mRewards;
private final PublishSubject<Coupon> onClickSubject = PublishSubject.create();
public ActiveRewardAdapter(Context mContext, CouponList campaignList) {
this.mContext = mContext;
this.mRewards = campaignList;
}
public class ActiveRewardViewHolder extends RecyclerView.ViewHolder {
private ImageView ivRewardLogo;
private TextView tvRewardTitle, tvRewardDescription;
public ActiveRewardViewHolder(View view) {
super(view);
ivRewardLogo = view.findViewById(R.id.iv_active_reward);
tvRewardTitle = view.findViewById(R.id.tv_active_reward_title);
tvRewardDescription = view.findViewById(R.id.tv_active_reward_description);
}
}
@Override
public int getItemCount() {
if (mRewards == null)
return 0;
else
return mRewards.size();
}
public Coupon getItem(int id) {
return mRewards.get(id);
}
public void updateData(CouponList couponList) {
mRewards.clear();
mRewards.addAll(couponList);
notifyDataSetChanged();
}
@Override
public ActiveRewardViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView;
itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.active_rewards_layout, parent, false);
return new ActiveRewardViewHolder(itemView);
}
@Override
public void onBindViewHolder(final ActiveRewardViewHolder holder, int position) {
Coupon couponItem = mRewards.get(position);
if (couponItem != null) {
if (!TextUtils.isEmpty(couponItem.getImage())) {
Glide.with(mContext)
// .setDefaultRequestOptions(
// RequestOptions
// .placeholderOf(R.drawable.ic_default_contact_photo)
// .error(R.drawable.ic_default_contact_photo))
.load(couponItem.getImage())
.diskCacheStrategy(DiskCacheStrategy.DATA)
.into(holder.ivRewardLogo);
} else {
Glide.with(mContext)
.load(R.drawable.ic_cosmote_logo_horizontal_grey)
.into(holder.ivRewardLogo);
}
holder.tvRewardTitle.setText(couponItem.getName());
holder.tvRewardDescription.setText(couponItem.getDescription());
holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem));
}
}
public Observable<Coupon> getPositionClicks() {
return onClickSubject.cache();
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:topLeftRadius="30dp" />
<?xml version="1.0" encoding="utf-8"?><!--<shape xmlns:android="http://schemas.android.com/apk/res/android"-->
<!-- android:shape="rectangle">-->
<!-- <corners android:topLeftRadius="30dp" />-->
<solid android:color="@color/grey_light" />
<!-- <solid android:color="@color/grey_light" />-->
<!-- <stroke-->
<!-- android:width="1dp"-->
<!-- android:color="@color/cos_green" />-->
</shape>
\ No newline at end of file
<!--&lt;!&ndash; <stroke&ndash;&gt;-->
<!--&lt;!&ndash; android:width="1dp"&ndash;&gt;-->
<!--&lt;!&ndash; android:color="@color/cos_green" />&ndash;&gt;-->
<!--</shape>-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:topLeftRadius="30dp" />
<gradient
android:angle="180"
android:endColor="@color/cos_cyan2"
android:startColor="@color/cos_green7" />
</shape>
</item>
<item android:top="4dp">
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:topLeftRadius="30dp" />
<solid android:color="@color/grey_light" />
<!-- <stroke-->
<!-- android:width="1dp"-->
<!-- android:color="@color/cos_green" />-->
</shape>
</item>
</layer-list>
\ No newline at end of file
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView 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="150dp"
android:layout_marginHorizontal="10dp"
android:layout_marginBottom="24dp"
app:cardCornerRadius="4dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/selector_cos_campaign">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_vertical_60_percent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.6" />
<ImageView
android:id="@+id/iv_active_reward"
android:layout_width="0dp"
android:layout_height="0dp"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/gl_vertical_60_percent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
tools:src="@drawable/ic_cosmote_logo_horizontal_grey" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@+id/gl_vertical_60_percent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_active_reward_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginBottom="2dp"
android:maxLines="2"
android:textColor="@color/grey"
android:textSize="16sp"
android:textStyle="bold"
tools:text="-5$ στο BOX" />
<TextView
android:id="@+id/tv_active_reward_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="2dp"
android:maxLines="4"
android:textColor="@color/grey"
android:textSize="16sp"
tools:text="-10% in all products from IKEA" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
\ No newline at end of file
......@@ -9,7 +9,8 @@
android:id="@+id/cl_bill_header"
android:layout_width="match_parent"
android:layout_height="80dp"
app:layout_constraintTop_toTopOf="parent">
app:layout_constraintTop_toTopOf="parent"
android:background="@android:color/white">
<ImageView
android:id="@+id/iv_coupons_close"
......@@ -19,21 +20,21 @@
android:layout_marginTop="4dp"
android:src="@drawable/ic_back"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/textView3" />
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<TextView
android:id="@+id/textView3"
android:layout_width="206dp"
android:layout_height="32dp"
android:gravity="center"
android:text="Όλα τα κουπόνια μου"
android:text="@string/cos_active_all_coupons"
android:textColor="@color/grey"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.356"
app:layout_constraintStart_toEndOf="@+id/iv_coupons_close"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
......@@ -61,7 +62,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="Δεν υπάρχουν κουπόνια"
android:text="@string/cos_no_active_coupons"
android:textColor="@color/grey"
android:textSize="18sp"
android:visibility="gone"
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/cl_bill_payment"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_bill_header"
android:layout_width="match_parent"
android:layout_height="80dp"
android:background="@android:color/white"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/iv_coupons_close"
android:layout_width="21dp"
android:layout_height="20dp"
android:layout_marginStart="24dp"
android:layout_marginTop="4dp"
android:src="@drawable/ic_back"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView3"
android:layout_width="206dp"
android:layout_height="32dp"
android:gravity="center"
android:text="@string/cos_active_all_rewards"
android:textColor="@color/grey"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/cl_bill_header"
android:layout_marginTop="1dp"
android:background="@drawable/shape_cos_loyalty"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_active_rewards"
android:layout_width="match_parent"
android:layout_height="0dp"
android:paddingTop="48dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/tv_no_rewards"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="@string/cos_no_active_rewards"
android:textColor="@color/grey"
android:textSize="18sp"
android:textStyle="bold"
android:visibility="gone" />
</RelativeLayout>
\ No newline at end of file
......@@ -40,7 +40,8 @@
android:layout_height="90dp"
android:layout_below="@+id/cl_loyalty_wallet_header"
android:layout_marginVertical="24dp"
android:paddingHorizontal="24dp">
android:paddingHorizontal="24dp"
android:background="@android:color/white">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/iv_profile_photo"
......@@ -125,10 +126,11 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_loyalty_deals"
android:layout_width="match_parent"
android:layout_height="160dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="6dp"
android:layout_marginTop="48dp"
android:background="@drawable/shape_cos_white2">
android:background="@drawable/shape_cos_white2"
android:paddingVertical="10dp">
<LinearLayout
android:layout_width="wrap_content"
......@@ -152,7 +154,6 @@
android:id="@+id/tv_active_deals_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:text="961544809"
android:textColor="@color/blue_dark"
android:textSize="18sp"
......@@ -161,7 +162,6 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="Λήγει σε 4 ημέρες"
android:textColor="@color/cos_grey3"
android:textFontWeight="600" />
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/cl_bill_payment"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_bill_header"
android:layout_width="match_parent"
android:layout_height="80dp"
android:background="@android:color/white"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/iv_coupons_close"
android:layout_width="21dp"
android:layout_height="20dp"
android:layout_marginStart="24dp"
android:layout_marginTop="4dp"
android:src="@drawable/ic_back"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView3"
android:layout_width="206dp"
android:layout_height="32dp"
android:gravity="center"
android:text="@string/cos_past_all_coupons"
android:textColor="@color/grey"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_loyalty_wallet"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="24dp"
android:src="@drawable/ic_rewards_wallet"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/cl_bill_header"
android:layout_marginTop="1dp"
android:background="@drawable/shape_cos_loyalty"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_active_coupons"
android:layout_width="match_parent"
android:layout_height="0dp"
android:paddingTop="48dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/tv_no_coupons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="@string/cos_no_active_coupons"
android:textColor="@color/grey"
android:textSize="18sp"
android:textStyle="bold"
android:visibility="gone" />
</RelativeLayout>
\ No newline at end of file
<RelativeLayout 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="wrap_content"
android:paddingBottom="24dp">
......@@ -43,6 +44,7 @@
android:layout_height="wrap_content"
android:text="60%"
android:textColor="#00CB09"
android:textFontWeight="600"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
......@@ -82,6 +84,7 @@
android:layout_height="wrap_content"
android:text="22%"
android:textColor="#9973F3"
android:textFontWeight="600"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
......@@ -120,6 +123,90 @@
android:layout_height="wrap_content"
android:text="18%"
android:textColor="#0072C9"
android:textFontWeight="600"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/analysis_tab4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/analysis_tab2"
android:layout_marginVertical="20dp"
android:visibility="gone"
tools:visibility="visible">
<ImageView
android:id="@+id/iv_chart_icon4"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_gift"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="Δώρο Γενεθλίων"
android:textColor="#4D4C58"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/iv_chart_icon4"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="50%"
android:textColor="#00CB09"
android:textFontWeight="600"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/analysis_tab5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/analysis_tab2"
android:visibility="gone"
tools:visibility="visible">
<ImageView
android:id="@+id/iv_chart_icon5"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_steering_wheel"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="Safe driving"
android:textColor="#4D4C58"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/iv_chart_icon5"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="50%"
android:textColor="#3D5265"
android:textFontWeight="600"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
......
......@@ -21,6 +21,7 @@
<include
android:id="@+id/piechart"
layout="@layout/cos_piechart2"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/iv_chart"
app:layout_constraintStart_toStartOf="parent"
......
......@@ -32,6 +32,7 @@
layout="@layout/cos_piechart2"
android:layout_width="200dp"
android:layout_height="200dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
......
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
......@@ -30,25 +31,45 @@
android:layout_centerHorizontal="true"
android:layout_marginTop="32dp" />
<Spinner
android:id="@+id/sp_redemption"
<LinearLayout
android:id="@+id/ll_spinners"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_height="wrap_content"
android:layout_below="@+id/cl_chart"
android:layout_centerHorizontal="true"
android:layout_marginTop="32dp"
android:background="@drawable/shape_cos_sky_blue"
android:dropDownVerticalOffset="62dp"
android:popupBackground="@drawable/shape_cos_sky_blue"
android:popupElevation="1dp"
android:spinnerMode="dropdown" />
android:gravity="center"
android:orientation="vertical">
<Spinner
android:id="@+id/sp_redemption"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_centerHorizontal="true"
android:background="@drawable/shape_cos_sky_blue"
android:dropDownVerticalOffset="62dp"
android:popupBackground="@drawable/shape_cos_sky_blue"
android:popupElevation="1dp"
android:spinnerMode="dropdown" />
<Spinner
android:id="@+id/sp_collection"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_centerHorizontal="true"
android:background="@drawable/shape_cos_sky_blue"
android:dropDownVerticalOffset="62dp"
android:popupBackground="@drawable/shape_cos_sky_blue"
android:popupElevation="1dp"
android:spinnerMode="dropdown"
android:visibility="gone" />
</LinearLayout>
<include
android:id="@+id/cl_chart_info"
layout="@layout/cos_analysis"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/sp_redemption"
android:layout_below="@+id/ll_spinners"
android:layout_marginTop="32dp" />
</RelativeLayout>
</RelativeLayout>
\ 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="140dp"
android:layout_marginBottom="16dp">
<ImageView
android:id="@+id/iv_past_coupon_background"
android:layout_width="match_parent"
android:layout_height="140dp"
android:src="@drawable/ic_coupon_background"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<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:layout_marginEnd="24dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/v_separator"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_active_coupons_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/blue_dark"
android:textFontWeight="600"
android:textSize="16sp"
tools:text="Εκπτωτικο κουπονι 10$ για αγορες στα ΙΚΕΑ" />
<TextView
android:id="@+id/tv_active_coupons_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/blue_dark"
android:textSize="28sp"
android:textStyle="bold"
tools:text="10$" />
<TextView
android:id="@+id/tv_active_coupons_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/cos_grey4"
android:textFontWeight="600"
android:textSize="12sp"
tools:text="@string/cos_active_coupon_date" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -38,4 +38,6 @@
<color name="grey4">#F3F3F3</color>
<color name="grey_tr3">#7DF2F2F2</color>
<color name="cos_dark_blue">#355168</color>
<color name="cos_grey4">#617181</color>
<color name="grey_light3">#E3E3E3</color>
</resources>
\ No newline at end of file
......
......@@ -55,13 +55,23 @@
<string name="cos_analysis2">Αναλυτικά</string>
<string name="euro"></string>
<string name="cos_profile_questionnaire">+ Ερωτηματολόγιο</string>
<string name="cos_active_all_coupons">Όλα τα κουπόνια μου</string>
<string name="cos_active_all_rewards">Όλα τα δώρα μου</string>
<string name="cos_no_active_coupons">Δεν υπάρχουν κουπόνια</string>
<string name="cos_no_active_rewards">Δεν υπάρχουν δώρα</string>
<string name="cos_past_all_coupons">Παλαιότερα κουπόνια</string>
<string name="cos_coupon_expired_date">Εξαργυρώθηκε την %1$s</string>
<string-array name="coupons_array">
<item>Κουπόνια</item>
<item>Deals for you</item>
<item>Δώρα</item>
</string-array>
<string-array name="redemption_array">
<item>Εξαργύρωση</item>
</string-array>
<string-array name="collection_array">
<item>Συλλογή</item>
</string-array>
</resources>
\ No newline at end of file
......