Panagiotis Triantafyllou

new mfy ui

......@@ -31,17 +31,17 @@ package ly.warp.sdk.io.models;
*/
public class HealthEventModel {
private double steps;
private double meters;
public HealthEventModel() {
this.steps = 0.0d;
this.meters = 0.0d;
}
public double getSteps() {
return steps;
public double getMeters() {
return meters;
}
public void setSteps(double steps) {
this.steps = steps;
public void setMeters(double meters) {
this.meters = meters;
}
}
......
......@@ -211,7 +211,7 @@ public class WarplyHealthService extends Service implements SensorEventListener
mSteps++;
mStepsAll++;
HealthEventModel healthSteps = new HealthEventModel();
healthSteps.setSteps((mStepsAll * 0.762));
healthSteps.setMeters((mStepsAll * 0.762));
EventBus.getDefault().post(new WarplyEventBusManager(healthSteps));
WarpUtils.setStepsMetersCounter(this, (mStepsAll * 0.762));
WarpUtils.setStepsCounter(this, mSteps);
......
......@@ -745,7 +745,7 @@ public class WarplyManagerHelper {
*/
public static void setSeasonalList(ArrayList<LoyaltyGiftsForYouPackage> seasonalCoupons) {
mSeasonalList.clear();
mSeasonalList.addAll(seasonalCoupons);
mSeasonalList = seasonalCoupons;
}
/**
......
......@@ -22,8 +22,7 @@ import io.reactivex.subjects.PublishSubject;
import ly.warp.sdk.R;
import ly.warp.sdk.io.models.Campaign;
public class MoreCampaignAdapter extends RecyclerView.Adapter<MoreCampaignAdapter.ProfileCampaignViewHolder> {
public class MoreCampaignAdapter extends RecyclerView.Adapter<MoreCampaignAdapter.MoreCampaignViewHolder> {
private Context mContext;
private ArrayList<Campaign> mCampaigns;
......@@ -34,27 +33,19 @@ public class MoreCampaignAdapter extends RecyclerView.Adapter<MoreCampaignAdapte
this.mCampaigns = campaignList;
}
public class ProfileCampaignViewHolder extends RecyclerView.ViewHolder {
public class MoreCampaignViewHolder extends RecyclerView.ViewHolder {
private ImageView ivCampaignTitle, ivIsNew;
private TextView tvCampaignTitle, tvCampaignSubtitle, tvCampaignMessage;
public ProfileCampaignViewHolder(View view) {
super(view);
ivCampaignTitle = view.findViewById(R.id.iv_campaign_logo);
tvCampaignTitle = view.findViewById(R.id.tv_campaign_title);
}
public ProfileCampaignViewHolder(View view, boolean vertical) {
public MoreCampaignViewHolder(View view) {
super(view);
ivCampaignTitle = view.findViewById(R.id.iv_campaign_logo);
tvCampaignTitle = view.findViewById(R.id.tv_campaign_title);
ivIsNew = view.findViewById(R.id.iv_campaign_new);
if (vertical) {
tvCampaignSubtitle = view.findViewById(R.id.tv_campaign_subtitle);
tvCampaignMessage = view.findViewById(R.id.tv_campaign_message);
}
}
}
@Override
public int getItemCount() {
......@@ -76,15 +67,15 @@ public class MoreCampaignAdapter extends RecyclerView.Adapter<MoreCampaignAdapte
}
@Override
public ProfileCampaignViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
public MoreCampaignViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView;
itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_profile_recycler_vertical, parent, false);
return new ProfileCampaignViewHolder(itemView, true);
return new MoreCampaignViewHolder(itemView);
}
@Override
public void onBindViewHolder(final ProfileCampaignViewHolder holder, int position) {
public void onBindViewHolder(final MoreCampaignViewHolder holder, int position) {
Campaign campaignItem = mCampaigns.get(position);
if (campaignItem != null) {
......
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 com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import java.util.ArrayList;
import io.reactivex.Observable;
import io.reactivex.subjects.PublishSubject;
import ly.warp.sdk.R;
import ly.warp.sdk.io.models.Campaign;
import ly.warp.sdk.io.models.LoyaltyContextualOfferModel;
public class MoreContextualAdapter extends RecyclerView.Adapter<MoreContextualAdapter.MoreContextualViewHolder> {
private Context mContext;
private ArrayList<LoyaltyContextualOfferModel> mCampaigns;
private final PublishSubject<LoyaltyContextualOfferModel> onClickSubject = PublishSubject.create();
public MoreContextualAdapter(Context mContext, ArrayList<LoyaltyContextualOfferModel> campaignList) {
this.mContext = mContext;
this.mCampaigns = campaignList;
}
public class MoreContextualViewHolder extends RecyclerView.ViewHolder {
private ImageView ivCampaignTitle, ivIsNew;
private TextView tvCampaignTitle, tvCampaignSubtitle, tvCampaignMessage;
public MoreContextualViewHolder(View view) {
super(view);
ivCampaignTitle = view.findViewById(R.id.iv_campaign_logo);
tvCampaignTitle = view.findViewById(R.id.tv_campaign_title);
ivIsNew = view.findViewById(R.id.iv_campaign_new);
tvCampaignSubtitle = view.findViewById(R.id.tv_campaign_subtitle);
tvCampaignMessage = view.findViewById(R.id.tv_campaign_message);
}
}
@Override
public int getItemCount() {
if (mCampaigns == null)
return 0;
else
return mCampaigns.size();
}
public LoyaltyContextualOfferModel getItem(int id) {
return mCampaigns.get(id);
}
public void updateData(ArrayList<LoyaltyContextualOfferModel> campaignList) {
mCampaigns.clear();
mCampaigns.addAll(campaignList);
notifyDataSetChanged();
}
@Override
public MoreContextualViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView;
itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_profile_recycler_vertical, parent, false);
return new MoreContextualViewHolder(itemView);
}
@Override
public void onBindViewHolder(final MoreContextualViewHolder holder, int position) {
LoyaltyContextualOfferModel campaignItem = mCampaigns.get(position);
if (campaignItem != null) {
if (!TextUtils.isEmpty(campaignItem.getImageUrl())) {
Glide.with(mContext)
.load(campaignItem.getImageUrl())
.transform(new CenterCrop(), new RoundedCorners(4))
.diskCacheStrategy(DiskCacheStrategy.DATA)
.into(holder.ivCampaignTitle);
} else {
Glide.with(mContext)
.load(R.drawable.ic_cosmote_logo_horizontal_grey)
.into(holder.ivCampaignTitle);
}
holder.tvCampaignTitle.setText(campaignItem.getTitle());
holder.tvCampaignSubtitle.setText(campaignItem.getSubtitle());
holder.tvCampaignMessage.setText(campaignItem.getMessage());
holder.ivIsNew.setVisibility(View.GONE);
holder.itemView.setOnClickListener(v -> onClickSubject.onNext(campaignItem));
}
}
public Observable<LoyaltyContextualOfferModel> getPositionClicks() {
return onClickSubject.cache();
}
}
......@@ -25,13 +25,13 @@
<TextView
android:id="@+id/textView3"
fontPath="fonts/pf_square_sans_pro_bold.ttf"
android:layout_width="206dp"
android:layout_height="32dp"
android:gravity="center"
android:text="@string/cos_more_title"
android:textColor="@color/grey"
android:textSize="17sp"
fontPath="fonts/pf_square_sans_pro_bold.ttf"
android:text="@string/cos_more_title"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.356"
......@@ -46,6 +46,16 @@
android:background="@drawable/shape_cos_loyalty"
android:orientation="vertical">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_more_popup"
android:layout_width="match_parent"
......@@ -55,7 +65,7 @@
android:orientation="vertical"
android:paddingVertical="16dp"
android:visibility="gone"
tools:visibility="visible">
tools:visibility="gone">
<ImageView
android:id="@+id/iv_popup_more_close"
......@@ -102,6 +112,122 @@
android:clipToPadding="false"
android:orientation="vertical"
android:paddingTop="44dp"
android:paddingBottom="24dp" />
android:paddingBottom="24dp"
android:visibility="gone" />
<LinearLayout
android:id="@+id/ll_research_items"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_more_popup"
android:orientation="vertical"
android:paddingTop="44dp"
android:visibility="gone">
<TextView
android:id="@+id/tv_research_section"
fontPath="fonts/pf_square_sans_pro_bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:textColor="@android:color/white"
android:textSize="16sp"
tools:text="ΕΡΕΥΝΑ" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_research_items"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:clipToPadding="false"
android:orientation="vertical"
android:paddingBottom="4dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_exclusive_items"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_research_items"
android:orientation="vertical"
android:visibility="gone">
<TextView
android:id="@+id/tv_exclusive_section"
fontPath="fonts/pf_square_sans_pro_bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:textColor="@android:color/white"
android:textSize="16sp"
tools:text="ΕΡΕΥΝΑ" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_exclusive_items"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:clipToPadding="false"
android:orientation="vertical"
android:paddingBottom="4dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_contest_items"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_exclusive_items"
android:orientation="vertical"
android:visibility="gone">
<TextView
android:id="@+id/tv_contest_section"
fontPath="fonts/pf_square_sans_pro_bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:textColor="@android:color/white"
android:textSize="16sp"
tools:text="ΕΡΕΥΝΑ" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_contest_items"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:clipToPadding="false"
android:orientation="vertical"
android:paddingBottom="4dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_contextual_items"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_contest_items"
android:orientation="vertical"
android:visibility="gone">
<TextView
android:id="@+id/tv_contextual_section"
fontPath="fonts/pf_square_sans_pro_bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:textColor="@android:color/white"
android:textSize="16sp"
tools:text="ΕΡΕΥΝΑ" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_contextual_items"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:clipToPadding="false"
android:orientation="vertical"
android:paddingBottom="4dp" />
</LinearLayout>
</RelativeLayout>
</ScrollView>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
......
......@@ -132,6 +132,7 @@
<string name="cos_empty_shared_coupons">Δεν έχεις μοιραστεί ακόμη κουπόνια</string>
<string name="cos_empty_expired_coupons">Δεν έχεις εξαργυρώσει ακόμη κουπόνια</string>
<string name="cos_dlg_pacing_goal">Πέτυχες το στόχο του μήνα! Διάλεξε το δώρο που επιθυμείς να ενεργοποιήσεις!</string>
<string name="cos_mfy_other">ΆΛΛΕΣ</string>
<string-array name="coupons_array">
<item>Κουπόνια</item>
......