Panagiotis Triantafyllou

ui fixes

......@@ -6,9 +6,7 @@ import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.text.Html;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.view.View;
......@@ -17,6 +15,7 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import androidx.core.text.HtmlCompat;
import androidx.work.OneTimeWorkRequest;
import androidx.work.WorkManager;
......@@ -39,7 +38,6 @@ import ly.warp.sdk.io.models.Coupon;
import ly.warp.sdk.io.models.Couponset;
import ly.warp.sdk.io.models.Merchant;
import ly.warp.sdk.services.EventCouponsService;
import ly.warp.sdk.utils.WarplyDeviceInfoCollector;
import ly.warp.sdk.utils.WarplyManagerHelper;
import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
......@@ -228,11 +226,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
}
if (mMerchant != null && !TextUtils.isEmpty(mMerchant.getBody()) && !mMerchant.getBody().equals("null")) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
mTvDescription.setText(Html.fromHtml(mMerchant.getBody(), Html.FROM_HTML_MODE_COMPACT));
} else {
mTvDescription.setText(Html.fromHtml(mMerchant.getBody()));
}
mTvDescription.setText(HtmlCompat.fromHtml(mMerchant.getBody(), HtmlCompat.FROM_HTML_MODE_COMPACT));
mTvDescription.setMovementMethod(LinkMovementMethod.getInstance());
} else {
mTvDescription.setVisibility(View.GONE);
......@@ -249,11 +243,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
}
mTvCouponSubtitle.setText(mCouponset.getShortDescription());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
mTvTermsValue.setText(Html.fromHtml(mCouponset.getTerms(), Html.FROM_HTML_MODE_COMPACT));
} else {
mTvTermsValue.setText(Html.fromHtml(mCouponset.getTerms()));
}
mTvTermsValue.setText(HtmlCompat.fromHtml(mCouponset.getTerms(), HtmlCompat.FROM_HTML_MODE_COMPACT));
mTvTermsValue.setMovementMethod(LinkMovementMethod.getInstance());
}
......
......@@ -2,9 +2,7 @@ package ly.warp.sdk.activities;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.Html;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.view.View;
......@@ -14,6 +12,7 @@ import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.appcompat.app.AlertDialog;
import androidx.core.text.HtmlCompat;
import androidx.work.OneTimeWorkRequest;
import androidx.work.WorkManager;
......@@ -29,7 +28,6 @@ import io.github.inflationx.viewpump.ViewPumpContextWrapper;
import ly.warp.sdk.R;
import ly.warp.sdk.io.callbacks.CallbackReceiver;
import ly.warp.sdk.io.models.Campaign;
import ly.warp.sdk.io.models.CampaignList;
import ly.warp.sdk.io.models.Coupon;
import ly.warp.sdk.io.models.CouponList;
import ly.warp.sdk.io.models.Couponset;
......@@ -39,7 +37,6 @@ import ly.warp.sdk.io.models.WarplyCCMSEnabledModel;
import ly.warp.sdk.io.models.WarplyCouponsChangedEventModel;
import ly.warp.sdk.io.request.WarplyGetCampaignsRequest;
import ly.warp.sdk.io.request.WarplyRedeemCouponRequest;
import ly.warp.sdk.io.request.WarplyUserCouponsRequest;
import ly.warp.sdk.services.EventCampaignService;
import ly.warp.sdk.utils.WarpUtils;
import ly.warp.sdk.utils.WarplyManagerHelper;
......@@ -177,10 +174,10 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
}
mTvCouponsetTitle.setText(mCouponset.getName());
mTvCouponsetSubtitle.setText(Html.fromHtml(mCouponset.getDescription()));
mTvCouponsetSubtitle.setText(HtmlCompat.fromHtml(mCouponset.getDescription(), HtmlCompat.FROM_HTML_MODE_COMPACT));
mTvCouponsetSubtitle.setMovementMethod(LinkMovementMethod.getInstance());
mLlTerms.setOnClickListener(this);
mTvTermsValue.setText(Html.fromHtml(mCouponset.getTerms()));
mTvTermsValue.setText(HtmlCompat.fromHtml(mCouponset.getTerms(), HtmlCompat.FROM_HTML_MODE_COMPACT));
mTvTermsValue.setMovementMethod(LinkMovementMethod.getInstance());
if (!TextUtils.isEmpty(mCouponset.getImgPreview())) {
......
package ly.warp.sdk.views.adapters;
import android.content.Context;
import android.os.Build;
import android.text.Html;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
......@@ -11,6 +9,7 @@ import android.widget.ImageView;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import androidx.core.text.HtmlCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
......@@ -129,11 +128,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
holder.tvCouponTitle.setText(couponItem.getName());
if (!mIsPast) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
holder.tvCouponDescription.setText(Html.fromHtml(couponItem.getInnerText(), Html.FROM_HTML_MODE_COMPACT));
} else {
holder.tvCouponDescription.setText(Html.fromHtml(couponItem.getInnerText()));
}
holder.tvCouponDescription.setText(HtmlCompat.fromHtml(couponItem.getInnerText(), HtmlCompat.FROM_HTML_MODE_COMPACT));
}
} else {
if (!TextUtils.isEmpty(merchant.getImgPreview())) {
......@@ -153,11 +148,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
holder.tvCouponTitle.setText(merchant.getAdminName());
if (!mIsPast) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
holder.tvCouponDescription.setText(Html.fromHtml(couponItem.getInnerText(), Html.FROM_HTML_MODE_COMPACT));
} else {
holder.tvCouponDescription.setText(Html.fromHtml(couponItem.getInnerText()));
}
holder.tvCouponDescription.setText(HtmlCompat.fromHtml(couponItem.getInnerText(), HtmlCompat.FROM_HTML_MODE_COMPACT));
}
}
......
package ly.warp.sdk.views.adapters;
import android.content.Context;
import android.text.Html;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
......@@ -9,6 +8,7 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.core.text.HtmlCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
......@@ -98,7 +98,7 @@ public class CouponsetsAdapter extends RecyclerView.Adapter<CouponsetsAdapter.Co
}
holder.tvCouponTitle.setText(couponsetItem.getName());
holder.tvCouponDescription.setText(Html.fromHtml(couponsetItem.getDescription()));
holder.tvCouponDescription.setText(HtmlCompat.fromHtml(couponsetItem.getDescription(), HtmlCompat.FROM_HTML_MODE_COMPACT));
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
Date newDate = new Date();
......
......@@ -187,7 +187,7 @@ public class MergedGiftsAdapter extends RecyclerView.Adapter<MergedGiftsAdapter.
}
holder.tvMergedGiftsTitle.setText(mergedgiftsItem.getSeasonalList().getTitle());
// holder.tvMergedGiftsTitle.setText(Html.fromHtml(mergedgiftsItem.getCouponset().getDescription()));
// holder.tvMergedGiftsTitle.setText(HtmlCompat.fromHtml(mergedgiftsItem.getCouponset().getDescription(), HtmlCompat.FROM_HTML_MODE_COMPACT));
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
// Date newDate = new Date();
......
......@@ -42,14 +42,15 @@
custom:dashThickness="1dp"
custom:orientation="vertical" />
<!-- app:layout_constraintEnd_toStartOf="@+id/gl_vertical_72_percent"-->
<LinearLayout
android:id="@+id/ll_coupon_info"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginHorizontal="16dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_72_percent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/v_separator"
app:layout_constraintTop_toTopOf="parent">
......@@ -90,7 +91,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="32dp"
android:maxLines="4"
android:maxLines="3"
android:textColor="@color/cos_gray"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
......
......@@ -103,7 +103,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="48dp"
android:layout_marginTop="24dp"
android:text="Κωδικός Κουπονιού"
android:textColor="@color/cos_light_black"
android:textSize="18sp" />
......@@ -207,7 +207,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="40dp"
android:layout_marginTop="24dp"
android:textColor="@color/cos_gray"
tools:text="@string/cos_coupon_date" />
......@@ -217,7 +217,7 @@
android:layout_height="55dp"
android:layout_gravity="center"
android:layout_marginHorizontal="32dp"
android:layout_marginTop="64dp"
android:layout_marginTop="32dp"
android:background="@drawable/selector_button_green"
android:gravity="center"
android:orientation="horizontal"
......
......@@ -100,7 +100,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:layout_marginTop="64dp"
android:layout_marginTop="32dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView14">
......
......@@ -154,7 +154,7 @@
android:layout_height="55dp"
android:layout_below="@+id/textView13"
android:layout_centerHorizontal="true"
android:layout_marginTop="44dp"
android:layout_marginTop="32dp"
android:background="@drawable/selector_button_green"
android:gravity="center"
android:orientation="horizontal">
......