Panagiotis Triantafyllou

ui fixes

...@@ -6,9 +6,7 @@ import android.content.Intent; ...@@ -6,9 +6,7 @@ import android.content.Intent;
6 import android.graphics.Bitmap; 6 import android.graphics.Bitmap;
7 import android.graphics.Color; 7 import android.graphics.Color;
8 import android.net.Uri; 8 import android.net.Uri;
9 -import android.os.Build;
10 import android.os.Bundle; 9 import android.os.Bundle;
11 -import android.text.Html;
12 import android.text.TextUtils; 10 import android.text.TextUtils;
13 import android.text.method.LinkMovementMethod; 11 import android.text.method.LinkMovementMethod;
14 import android.view.View; 12 import android.view.View;
...@@ -17,6 +15,7 @@ import android.widget.LinearLayout; ...@@ -17,6 +15,7 @@ import android.widget.LinearLayout;
17 import android.widget.TextView; 15 import android.widget.TextView;
18 16
19 import androidx.core.content.ContextCompat; 17 import androidx.core.content.ContextCompat;
18 +import androidx.core.text.HtmlCompat;
20 import androidx.work.OneTimeWorkRequest; 19 import androidx.work.OneTimeWorkRequest;
21 import androidx.work.WorkManager; 20 import androidx.work.WorkManager;
22 21
...@@ -39,7 +38,6 @@ import ly.warp.sdk.io.models.Coupon; ...@@ -39,7 +38,6 @@ import ly.warp.sdk.io.models.Coupon;
39 import ly.warp.sdk.io.models.Couponset; 38 import ly.warp.sdk.io.models.Couponset;
40 import ly.warp.sdk.io.models.Merchant; 39 import ly.warp.sdk.io.models.Merchant;
41 import ly.warp.sdk.services.EventCouponsService; 40 import ly.warp.sdk.services.EventCouponsService;
42 -import ly.warp.sdk.utils.WarplyDeviceInfoCollector;
43 import ly.warp.sdk.utils.WarplyManagerHelper; 41 import ly.warp.sdk.utils.WarplyManagerHelper;
44 import ly.warp.sdk.utils.managers.WarplyAnalyticsManager; 42 import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
45 43
...@@ -228,11 +226,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener ...@@ -228,11 +226,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
228 } 226 }
229 227
230 if (mMerchant != null && !TextUtils.isEmpty(mMerchant.getBody()) && !mMerchant.getBody().equals("null")) { 228 if (mMerchant != null && !TextUtils.isEmpty(mMerchant.getBody()) && !mMerchant.getBody().equals("null")) {
231 - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { 229 + mTvDescription.setText(HtmlCompat.fromHtml(mMerchant.getBody(), HtmlCompat.FROM_HTML_MODE_COMPACT));
232 - mTvDescription.setText(Html.fromHtml(mMerchant.getBody(), Html.FROM_HTML_MODE_COMPACT));
233 - } else {
234 - mTvDescription.setText(Html.fromHtml(mMerchant.getBody()));
235 - }
236 mTvDescription.setMovementMethod(LinkMovementMethod.getInstance()); 230 mTvDescription.setMovementMethod(LinkMovementMethod.getInstance());
237 } else { 231 } else {
238 mTvDescription.setVisibility(View.GONE); 232 mTvDescription.setVisibility(View.GONE);
...@@ -249,11 +243,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener ...@@ -249,11 +243,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
249 } 243 }
250 244
251 mTvCouponSubtitle.setText(mCouponset.getShortDescription()); 245 mTvCouponSubtitle.setText(mCouponset.getShortDescription());
252 - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { 246 + mTvTermsValue.setText(HtmlCompat.fromHtml(mCouponset.getTerms(), HtmlCompat.FROM_HTML_MODE_COMPACT));
253 - mTvTermsValue.setText(Html.fromHtml(mCouponset.getTerms(), Html.FROM_HTML_MODE_COMPACT));
254 - } else {
255 - mTvTermsValue.setText(Html.fromHtml(mCouponset.getTerms()));
256 - }
257 mTvTermsValue.setMovementMethod(LinkMovementMethod.getInstance()); 247 mTvTermsValue.setMovementMethod(LinkMovementMethod.getInstance());
258 } 248 }
259 249
......
...@@ -2,9 +2,7 @@ package ly.warp.sdk.activities; ...@@ -2,9 +2,7 @@ package ly.warp.sdk.activities;
2 2
3 import android.app.Activity; 3 import android.app.Activity;
4 import android.content.Context; 4 import android.content.Context;
5 -import android.content.Intent;
6 import android.os.Bundle; 5 import android.os.Bundle;
7 -import android.text.Html;
8 import android.text.TextUtils; 6 import android.text.TextUtils;
9 import android.text.method.LinkMovementMethod; 7 import android.text.method.LinkMovementMethod;
10 import android.view.View; 8 import android.view.View;
...@@ -14,6 +12,7 @@ import android.widget.ProgressBar; ...@@ -14,6 +12,7 @@ import android.widget.ProgressBar;
14 import android.widget.TextView; 12 import android.widget.TextView;
15 13
16 import androidx.appcompat.app.AlertDialog; 14 import androidx.appcompat.app.AlertDialog;
15 +import androidx.core.text.HtmlCompat;
17 import androidx.work.OneTimeWorkRequest; 16 import androidx.work.OneTimeWorkRequest;
18 import androidx.work.WorkManager; 17 import androidx.work.WorkManager;
19 18
...@@ -29,7 +28,6 @@ import io.github.inflationx.viewpump.ViewPumpContextWrapper; ...@@ -29,7 +28,6 @@ import io.github.inflationx.viewpump.ViewPumpContextWrapper;
29 import ly.warp.sdk.R; 28 import ly.warp.sdk.R;
30 import ly.warp.sdk.io.callbacks.CallbackReceiver; 29 import ly.warp.sdk.io.callbacks.CallbackReceiver;
31 import ly.warp.sdk.io.models.Campaign; 30 import ly.warp.sdk.io.models.Campaign;
32 -import ly.warp.sdk.io.models.CampaignList;
33 import ly.warp.sdk.io.models.Coupon; 31 import ly.warp.sdk.io.models.Coupon;
34 import ly.warp.sdk.io.models.CouponList; 32 import ly.warp.sdk.io.models.CouponList;
35 import ly.warp.sdk.io.models.Couponset; 33 import ly.warp.sdk.io.models.Couponset;
...@@ -39,7 +37,6 @@ import ly.warp.sdk.io.models.WarplyCCMSEnabledModel; ...@@ -39,7 +37,6 @@ import ly.warp.sdk.io.models.WarplyCCMSEnabledModel;
39 import ly.warp.sdk.io.models.WarplyCouponsChangedEventModel; 37 import ly.warp.sdk.io.models.WarplyCouponsChangedEventModel;
40 import ly.warp.sdk.io.request.WarplyGetCampaignsRequest; 38 import ly.warp.sdk.io.request.WarplyGetCampaignsRequest;
41 import ly.warp.sdk.io.request.WarplyRedeemCouponRequest; 39 import ly.warp.sdk.io.request.WarplyRedeemCouponRequest;
42 -import ly.warp.sdk.io.request.WarplyUserCouponsRequest;
43 import ly.warp.sdk.services.EventCampaignService; 40 import ly.warp.sdk.services.EventCampaignService;
44 import ly.warp.sdk.utils.WarpUtils; 41 import ly.warp.sdk.utils.WarpUtils;
45 import ly.warp.sdk.utils.WarplyManagerHelper; 42 import ly.warp.sdk.utils.WarplyManagerHelper;
...@@ -177,10 +174,10 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe ...@@ -177,10 +174,10 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
177 } 174 }
178 175
179 mTvCouponsetTitle.setText(mCouponset.getName()); 176 mTvCouponsetTitle.setText(mCouponset.getName());
180 - mTvCouponsetSubtitle.setText(Html.fromHtml(mCouponset.getDescription())); 177 + mTvCouponsetSubtitle.setText(HtmlCompat.fromHtml(mCouponset.getDescription(), HtmlCompat.FROM_HTML_MODE_COMPACT));
181 mTvCouponsetSubtitle.setMovementMethod(LinkMovementMethod.getInstance()); 178 mTvCouponsetSubtitle.setMovementMethod(LinkMovementMethod.getInstance());
182 mLlTerms.setOnClickListener(this); 179 mLlTerms.setOnClickListener(this);
183 - mTvTermsValue.setText(Html.fromHtml(mCouponset.getTerms())); 180 + mTvTermsValue.setText(HtmlCompat.fromHtml(mCouponset.getTerms(), HtmlCompat.FROM_HTML_MODE_COMPACT));
184 mTvTermsValue.setMovementMethod(LinkMovementMethod.getInstance()); 181 mTvTermsValue.setMovementMethod(LinkMovementMethod.getInstance());
185 182
186 if (!TextUtils.isEmpty(mCouponset.getImgPreview())) { 183 if (!TextUtils.isEmpty(mCouponset.getImgPreview())) {
......
1 package ly.warp.sdk.views.adapters; 1 package ly.warp.sdk.views.adapters;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 -import android.os.Build;
5 -import android.text.Html;
6 import android.text.TextUtils; 4 import android.text.TextUtils;
7 import android.view.LayoutInflater; 5 import android.view.LayoutInflater;
8 import android.view.View; 6 import android.view.View;
...@@ -11,6 +9,7 @@ import android.widget.ImageView; ...@@ -11,6 +9,7 @@ import android.widget.ImageView;
11 import android.widget.TextView; 9 import android.widget.TextView;
12 10
13 import androidx.core.content.ContextCompat; 11 import androidx.core.content.ContextCompat;
12 +import androidx.core.text.HtmlCompat;
14 import androidx.recyclerview.widget.RecyclerView; 13 import androidx.recyclerview.widget.RecyclerView;
15 14
16 import com.bumptech.glide.Glide; 15 import com.bumptech.glide.Glide;
...@@ -129,11 +128,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte ...@@ -129,11 +128,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
129 128
130 holder.tvCouponTitle.setText(couponItem.getName()); 129 holder.tvCouponTitle.setText(couponItem.getName());
131 if (!mIsPast) { 130 if (!mIsPast) {
132 - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { 131 + holder.tvCouponDescription.setText(HtmlCompat.fromHtml(couponItem.getInnerText(), HtmlCompat.FROM_HTML_MODE_COMPACT));
133 - holder.tvCouponDescription.setText(Html.fromHtml(couponItem.getInnerText(), Html.FROM_HTML_MODE_COMPACT));
134 - } else {
135 - holder.tvCouponDescription.setText(Html.fromHtml(couponItem.getInnerText()));
136 - }
137 } 132 }
138 } else { 133 } else {
139 if (!TextUtils.isEmpty(merchant.getImgPreview())) { 134 if (!TextUtils.isEmpty(merchant.getImgPreview())) {
...@@ -153,11 +148,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte ...@@ -153,11 +148,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
153 148
154 holder.tvCouponTitle.setText(merchant.getAdminName()); 149 holder.tvCouponTitle.setText(merchant.getAdminName());
155 if (!mIsPast) { 150 if (!mIsPast) {
156 - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { 151 + holder.tvCouponDescription.setText(HtmlCompat.fromHtml(couponItem.getInnerText(), HtmlCompat.FROM_HTML_MODE_COMPACT));
157 - holder.tvCouponDescription.setText(Html.fromHtml(couponItem.getInnerText(), Html.FROM_HTML_MODE_COMPACT));
158 - } else {
159 - holder.tvCouponDescription.setText(Html.fromHtml(couponItem.getInnerText()));
160 - }
161 } 152 }
162 } 153 }
163 154
......
1 package ly.warp.sdk.views.adapters; 1 package ly.warp.sdk.views.adapters;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 -import android.text.Html;
5 import android.text.TextUtils; 4 import android.text.TextUtils;
6 import android.view.LayoutInflater; 5 import android.view.LayoutInflater;
7 import android.view.View; 6 import android.view.View;
...@@ -9,6 +8,7 @@ import android.view.ViewGroup; ...@@ -9,6 +8,7 @@ import android.view.ViewGroup;
9 import android.widget.ImageView; 8 import android.widget.ImageView;
10 import android.widget.TextView; 9 import android.widget.TextView;
11 10
11 +import androidx.core.text.HtmlCompat;
12 import androidx.recyclerview.widget.RecyclerView; 12 import androidx.recyclerview.widget.RecyclerView;
13 13
14 import com.bumptech.glide.Glide; 14 import com.bumptech.glide.Glide;
...@@ -98,7 +98,7 @@ public class CouponsetsAdapter extends RecyclerView.Adapter<CouponsetsAdapter.Co ...@@ -98,7 +98,7 @@ public class CouponsetsAdapter extends RecyclerView.Adapter<CouponsetsAdapter.Co
98 } 98 }
99 99
100 holder.tvCouponTitle.setText(couponsetItem.getName()); 100 holder.tvCouponTitle.setText(couponsetItem.getName());
101 - holder.tvCouponDescription.setText(Html.fromHtml(couponsetItem.getDescription())); 101 + holder.tvCouponDescription.setText(HtmlCompat.fromHtml(couponsetItem.getDescription(), HtmlCompat.FROM_HTML_MODE_COMPACT));
102 102
103 SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm"); 103 SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
104 Date newDate = new Date(); 104 Date newDate = new Date();
......
...@@ -187,7 +187,7 @@ public class MergedGiftsAdapter extends RecyclerView.Adapter<MergedGiftsAdapter. ...@@ -187,7 +187,7 @@ public class MergedGiftsAdapter extends RecyclerView.Adapter<MergedGiftsAdapter.
187 } 187 }
188 188
189 holder.tvMergedGiftsTitle.setText(mergedgiftsItem.getSeasonalList().getTitle()); 189 holder.tvMergedGiftsTitle.setText(mergedgiftsItem.getSeasonalList().getTitle());
190 -// holder.tvMergedGiftsTitle.setText(Html.fromHtml(mergedgiftsItem.getCouponset().getDescription())); 190 +// holder.tvMergedGiftsTitle.setText(HtmlCompat.fromHtml(mergedgiftsItem.getCouponset().getDescription(), HtmlCompat.FROM_HTML_MODE_COMPACT));
191 191
192 // SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm"); 192 // SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
193 // Date newDate = new Date(); 193 // Date newDate = new Date();
......
...@@ -42,14 +42,15 @@ ...@@ -42,14 +42,15 @@
42 custom:dashThickness="1dp" 42 custom:dashThickness="1dp"
43 custom:orientation="vertical" /> 43 custom:orientation="vertical" />
44 44
45 +<!-- app:layout_constraintEnd_toStartOf="@+id/gl_vertical_72_percent"-->
45 <LinearLayout 46 <LinearLayout
46 android:id="@+id/ll_coupon_info" 47 android:id="@+id/ll_coupon_info"
47 android:layout_width="0dp" 48 android:layout_width="0dp"
48 android:layout_height="wrap_content" 49 android:layout_height="wrap_content"
49 - android:layout_marginStart="16dp" 50 + android:layout_marginHorizontal="16dp"
50 android:orientation="vertical" 51 android:orientation="vertical"
51 app:layout_constraintBottom_toBottomOf="parent" 52 app:layout_constraintBottom_toBottomOf="parent"
52 - app:layout_constraintEnd_toStartOf="@+id/gl_vertical_72_percent" 53 + app:layout_constraintEnd_toEndOf="parent"
53 app:layout_constraintStart_toEndOf="@+id/v_separator" 54 app:layout_constraintStart_toEndOf="@+id/v_separator"
54 app:layout_constraintTop_toTopOf="parent"> 55 app:layout_constraintTop_toTopOf="parent">
55 56
...@@ -90,7 +91,7 @@ ...@@ -90,7 +91,7 @@
90 android:layout_height="wrap_content" 91 android:layout_height="wrap_content"
91 android:layout_marginStart="8dp" 92 android:layout_marginStart="8dp"
92 android:layout_marginEnd="32dp" 93 android:layout_marginEnd="32dp"
93 - android:maxLines="4" 94 + android:maxLines="3"
94 android:textColor="@color/cos_gray" 95 android:textColor="@color/cos_gray"
95 android:textSize="12sp" 96 android:textSize="12sp"
96 app:layout_constraintBottom_toBottomOf="parent" 97 app:layout_constraintBottom_toBottomOf="parent"
......
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
103 android:layout_width="wrap_content" 103 android:layout_width="wrap_content"
104 android:layout_height="wrap_content" 104 android:layout_height="wrap_content"
105 android:layout_gravity="center" 105 android:layout_gravity="center"
106 - android:layout_marginTop="48dp" 106 + android:layout_marginTop="24dp"
107 android:text="Κωδικός Κουπονιού" 107 android:text="Κωδικός Κουπονιού"
108 android:textColor="@color/cos_light_black" 108 android:textColor="@color/cos_light_black"
109 android:textSize="18sp" /> 109 android:textSize="18sp" />
...@@ -207,7 +207,7 @@ ...@@ -207,7 +207,7 @@
207 android:layout_width="wrap_content" 207 android:layout_width="wrap_content"
208 android:layout_height="wrap_content" 208 android:layout_height="wrap_content"
209 android:layout_gravity="center" 209 android:layout_gravity="center"
210 - android:layout_marginTop="40dp" 210 + android:layout_marginTop="24dp"
211 android:textColor="@color/cos_gray" 211 android:textColor="@color/cos_gray"
212 tools:text="@string/cos_coupon_date" /> 212 tools:text="@string/cos_coupon_date" />
213 213
...@@ -217,7 +217,7 @@ ...@@ -217,7 +217,7 @@
217 android:layout_height="55dp" 217 android:layout_height="55dp"
218 android:layout_gravity="center" 218 android:layout_gravity="center"
219 android:layout_marginHorizontal="32dp" 219 android:layout_marginHorizontal="32dp"
220 - android:layout_marginTop="64dp" 220 + android:layout_marginTop="32dp"
221 android:background="@drawable/selector_button_green" 221 android:background="@drawable/selector_button_green"
222 android:gravity="center" 222 android:gravity="center"
223 android:orientation="horizontal" 223 android:orientation="horizontal"
......
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
100 android:layout_width="match_parent" 100 android:layout_width="match_parent"
101 android:layout_height="wrap_content" 101 android:layout_height="wrap_content"
102 android:layout_marginHorizontal="24dp" 102 android:layout_marginHorizontal="24dp"
103 - android:layout_marginTop="64dp" 103 + android:layout_marginTop="32dp"
104 app:layout_constraintEnd_toEndOf="parent" 104 app:layout_constraintEnd_toEndOf="parent"
105 app:layout_constraintStart_toStartOf="parent" 105 app:layout_constraintStart_toStartOf="parent"
106 app:layout_constraintTop_toBottomOf="@+id/textView14"> 106 app:layout_constraintTop_toBottomOf="@+id/textView14">
......
...@@ -154,7 +154,7 @@ ...@@ -154,7 +154,7 @@
154 android:layout_height="55dp" 154 android:layout_height="55dp"
155 android:layout_below="@+id/textView13" 155 android:layout_below="@+id/textView13"
156 android:layout_centerHorizontal="true" 156 android:layout_centerHorizontal="true"
157 - android:layout_marginTop="44dp" 157 + android:layout_marginTop="32dp"
158 android:background="@drawable/selector_button_green" 158 android:background="@drawable/selector_button_green"
159 android:gravity="center" 159 android:gravity="center"
160 android:orientation="horizontal"> 160 android:orientation="horizontal">
......