Panagiotis Triantafyllou

new implementation for custom fonts

Showing 22 changed files with 48 additions and 28 deletions
...@@ -3,7 +3,20 @@ ...@@ -3,7 +3,20 @@
3 <component name="deploymentTargetDropDown"> 3 <component name="deploymentTargetDropDown">
4 <value> 4 <value>
5 <entry key="app"> 5 <entry key="app">
6 - <State /> 6 + <State>
7 + <targetSelectedWithDropDown>
8 + <Target>
9 + <type value="QUICK_BOOT_TARGET" />
10 + <deviceKey>
11 + <Key>
12 + <type value="VIRTUAL_DEVICE_PATH" />
13 + <value value="$USER_HOME$/.android/avd/Pixel_7_v13.avd" />
14 + </Key>
15 + </deviceKey>
16 + </Target>
17 + </targetSelectedWithDropDown>
18 + <timeTargetWasSelectedWithDropDown value="2024-07-09T11:41:15.263632Z" />
19 + </State>
7 </entry> 20 </entry>
8 </value> 21 </value>
9 </component> 22 </component>
......
...@@ -2,7 +2,7 @@ apply plugin: 'com.android.library' ...@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
2 2
3 ext { 3 ext {
4 PUBLISH_GROUP_ID = 'ly.warp' 4 PUBLISH_GROUP_ID = 'ly.warp'
5 - PUBLISH_VERSION = '4.5.5.4r30' 5 + PUBLISH_VERSION = '4.5.5.4r31'
6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk' 6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
7 } 7 }
8 8
......
...@@ -291,8 +291,8 @@ ...@@ -291,8 +291,8 @@
291 android:name="ly.warp.sdk.receivers.WarplyInAppNotificationReceiver" 291 android:name="ly.warp.sdk.receivers.WarplyInAppNotificationReceiver"
292 android:exported="false" /> 292 android:exported="false" />
293 293
294 - <provider 294 +<!-- <provider-->
295 - android:name=".utils.WarplyProvider" 295 +<!-- android:name=".utils.WarplyProvider"-->
296 - android:authorities="ly.warp.sdk.utils.WarplyProvider" /> 296 +<!-- android:authorities="ly.warp.sdk.utils.WarplyProvider" />-->
297 </application> 297 </application>
298 </manifest> 298 </manifest>
...\ No newline at end of file ...\ No newline at end of file
......
1 package ly.warp.sdk.activities; 1 package ly.warp.sdk.activities;
2 2
3 import android.app.Activity; 3 import android.app.Activity;
4 -import android.content.Context;
5 import android.content.Intent; 4 import android.content.Intent;
6 import android.os.Bundle; 5 import android.os.Bundle;
7 import android.os.Handler; 6 import android.os.Handler;
...@@ -16,16 +15,15 @@ import androidx.recyclerview.widget.RecyclerView; ...@@ -16,16 +15,15 @@ import androidx.recyclerview.widget.RecyclerView;
16 import org.greenrobot.eventbus.EventBus; 15 import org.greenrobot.eventbus.EventBus;
17 import org.greenrobot.eventbus.Subscribe; 16 import org.greenrobot.eventbus.Subscribe;
18 17
19 -import java.io.Serializable;
20 import java.text.ParseException; 18 import java.text.ParseException;
21 import java.text.SimpleDateFormat; 19 import java.text.SimpleDateFormat;
22 import java.util.Collections; 20 import java.util.Collections;
23 import java.util.Date; 21 import java.util.Date;
24 22
25 -import io.github.inflationx.viewpump.ViewPumpContextWrapper;
26 import ly.warp.sdk.R; 23 import ly.warp.sdk.R;
27 import ly.warp.sdk.io.models.Coupon; 24 import ly.warp.sdk.io.models.Coupon;
28 import ly.warp.sdk.io.models.CouponList; 25 import ly.warp.sdk.io.models.CouponList;
26 +import ly.warp.sdk.utils.WarpUtils;
29 import ly.warp.sdk.utils.WarplyManagerHelper; 27 import ly.warp.sdk.utils.WarplyManagerHelper;
30 import ly.warp.sdk.utils.managers.WarplyAnalyticsManager; 28 import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
31 import ly.warp.sdk.utils.managers.WarplyEventBusManager; 29 import ly.warp.sdk.utils.managers.WarplyEventBusManager;
...@@ -46,7 +44,7 @@ public class ActiveCouponsActivity extends Activity implements View.OnClickListe ...@@ -46,7 +44,7 @@ public class ActiveCouponsActivity extends Activity implements View.OnClickListe
46 private RecyclerView mRecyclerCoupons; 44 private RecyclerView mRecyclerCoupons;
47 private ActiveCouponAdapter mAdapterCoupons; 45 private ActiveCouponAdapter mAdapterCoupons;
48 private CouponList mCouponList = new CouponList(); 46 private CouponList mCouponList = new CouponList();
49 - private TextView mTvEmptyCoupons; 47 + private TextView mTvEmptyCoupons, mFontHeader;
50 private boolean mCouponsPressed = false; 48 private boolean mCouponsPressed = false;
51 49
52 // =========================================================== 50 // ===========================================================
...@@ -61,6 +59,9 @@ public class ActiveCouponsActivity extends Activity implements View.OnClickListe ...@@ -61,6 +59,9 @@ public class ActiveCouponsActivity extends Activity implements View.OnClickListe
61 mIvBack = findViewById(R.id.iv_coupons_close); 59 mIvBack = findViewById(R.id.iv_coupons_close);
62 mTvEmptyCoupons = findViewById(R.id.tv_no_coupons); 60 mTvEmptyCoupons = findViewById(R.id.tv_no_coupons);
63 mRecyclerCoupons = findViewById(R.id.rv_active_coupons); 61 mRecyclerCoupons = findViewById(R.id.rv_active_coupons);
62 + mFontHeader = findViewById(R.id.textView3);
63 + WarpUtils.renderCustomFont(this, R.font.bt_cosmo_bold, mFontHeader);
64 + WarpUtils.renderCustomFont(this, R.font.peridot_regular, mTvEmptyCoupons);
64 65
65 initViews(); 66 initViews();
66 } 67 }
...@@ -101,11 +102,6 @@ public class ActiveCouponsActivity extends Activity implements View.OnClickListe ...@@ -101,11 +102,6 @@ public class ActiveCouponsActivity extends Activity implements View.OnClickListe
101 } 102 }
102 } 103 }
103 104
104 - @Override
105 - protected void attachBaseContext(Context newBase) {
106 - super.attachBaseContext(ViewPumpContextWrapper.wrap(newBase));
107 - }
108 -
109 // =========================================================== 105 // ===========================================================
110 // Methods 106 // Methods
111 // =========================================================== 107 // ===========================================================
......
...@@ -36,6 +36,7 @@ import android.graphics.Bitmap; ...@@ -36,6 +36,7 @@ import android.graphics.Bitmap;
36 import android.graphics.BitmapFactory; 36 import android.graphics.BitmapFactory;
37 import android.graphics.Color; 37 import android.graphics.Color;
38 import android.graphics.Paint; 38 import android.graphics.Paint;
39 +import android.graphics.Typeface;
39 import android.graphics.drawable.ClipDrawable; 40 import android.graphics.drawable.ClipDrawable;
40 import android.graphics.drawable.Drawable; 41 import android.graphics.drawable.Drawable;
41 import android.graphics.drawable.LayerDrawable; 42 import android.graphics.drawable.LayerDrawable;
...@@ -48,7 +49,11 @@ import android.view.Gravity; ...@@ -48,7 +49,11 @@ import android.view.Gravity;
48 import android.view.View; 49 import android.view.View;
49 import android.view.animation.Animation; 50 import android.view.animation.Animation;
50 import android.view.animation.ScaleAnimation; 51 import android.view.animation.ScaleAnimation;
52 +import android.widget.TextView;
51 53
54 +import androidx.annotation.FontRes;
55 +import androidx.annotation.NonNull;
56 +import androidx.core.content.res.ResourcesCompat;
52 import androidx.security.crypto.EncryptedSharedPreferences; 57 import androidx.security.crypto.EncryptedSharedPreferences;
53 import androidx.security.crypto.MasterKey; 58 import androidx.security.crypto.MasterKey;
54 import androidx.work.OneTimeWorkRequest; 59 import androidx.work.OneTimeWorkRequest;
...@@ -70,6 +75,7 @@ import java.security.NoSuchAlgorithmException; ...@@ -70,6 +75,7 @@ import java.security.NoSuchAlgorithmException;
70 import java.util.concurrent.TimeUnit; 75 import java.util.concurrent.TimeUnit;
71 import java.util.zip.GZIPInputStream; 76 import java.util.zip.GZIPInputStream;
72 77
78 +import ly.warp.sdk.R;
73 import ly.warp.sdk.services.EventRefreshDeviceTokenService; 79 import ly.warp.sdk.services.EventRefreshDeviceTokenService;
74 import ly.warp.sdk.utils.constants.WarpConstants; 80 import ly.warp.sdk.utils.constants.WarpConstants;
75 81
...@@ -994,4 +1000,11 @@ public class WarpUtils { ...@@ -994,4 +1000,11 @@ public class WarpUtils {
994 1000
995 } 1001 }
996 1002
1003 + public static void renderCustomFont(@NonNull Context context, @FontRes int id, @NonNull TextView... textViews) {
1004 + Typeface customFont = ResourcesCompat.getFont(context, id);
1005 + for (TextView textView : textViews) {
1006 + textView.setTypeface(customFont);
1007 + }
1008 + }
1009 +
997 } 1010 }
......
...@@ -29,6 +29,7 @@ import ly.warp.sdk.R; ...@@ -29,6 +29,7 @@ import ly.warp.sdk.R;
29 import ly.warp.sdk.io.models.Coupon; 29 import ly.warp.sdk.io.models.Coupon;
30 import ly.warp.sdk.io.models.CouponList; 30 import ly.warp.sdk.io.models.CouponList;
31 import ly.warp.sdk.io.models.Merchant; 31 import ly.warp.sdk.io.models.Merchant;
32 +import ly.warp.sdk.utils.WarpUtils;
32 import ly.warp.sdk.utils.WarplyManagerHelper; 33 import ly.warp.sdk.utils.WarplyManagerHelper;
33 34
34 public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapter.ActiveCouponViewHolder> { 35 public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapter.ActiveCouponViewHolder> {
...@@ -59,7 +60,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte ...@@ -59,7 +60,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
59 public class ActiveCouponViewHolder extends RecyclerView.ViewHolder { 60 public class ActiveCouponViewHolder extends RecyclerView.ViewHolder {
60 private ImageView ivCouponLogo, ivCouponBackground; 61 private ImageView ivCouponLogo, ivCouponBackground;
61 private TextView tvCouponTitle, tvCouponValue, tvCouponDate, tvDateLimit, 62 private TextView tvCouponTitle, tvCouponValue, tvCouponDate, tvDateLimit,
62 - tvCouponDescription, tvCouponDateExpired; 63 + tvCouponDescription, tvCouponDateExpired, tvDateLimitTitle;
63 private ConstraintLayout clCustomLayout; 64 private ConstraintLayout clCustomLayout;
64 private LinearLayout lLDateLimit; 65 private LinearLayout lLDateLimit;
65 66
...@@ -74,7 +75,14 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte ...@@ -74,7 +75,14 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
74 clCustomLayout = view.findViewById(R.id.cl_custom_layout); 75 clCustomLayout = view.findViewById(R.id.cl_custom_layout);
75 tvCouponDateExpired = view.findViewById(R.id.tv_active_coupons_date_expired); 76 tvCouponDateExpired = view.findViewById(R.id.tv_active_coupons_date_expired);
76 tvDateLimit = view.findViewById(R.id.tv_active_coupons_date_limit); 77 tvDateLimit = view.findViewById(R.id.tv_active_coupons_date_limit);
78 + tvDateLimitTitle = view.findViewById(R.id.tv_active_coupons_date_limit_title);
77 lLDateLimit = view.findViewById(R.id.ll_date_limit); 79 lLDateLimit = view.findViewById(R.id.ll_date_limit);
80 +
81 + WarpUtils.renderCustomFont(mContext, R.font.bt_cosmo_bold, tvCouponTitle, tvCouponValue);
82 + WarpUtils.renderCustomFont(mContext, R.font.peridot_regular, tvCouponDescription, tvCouponDate);
83 +
84 + if (mIsCustom)
85 + WarpUtils.renderCustomFont(mContext, R.font.peridot_semi_bold, tvCouponDateExpired, tvDateLimit, tvDateLimitTitle);
78 } 86 }
79 } 87 }
80 88
......
...@@ -55,7 +55,6 @@ ...@@ -55,7 +55,6 @@
55 55
56 <TextView 56 <TextView
57 android:id="@+id/tv_active_coupons_title" 57 android:id="@+id/tv_active_coupons_title"
58 - fontPath="fonts/BTCosmo-Bold.ttf"
59 android:layout_width="wrap_content" 58 android:layout_width="wrap_content"
60 android:layout_height="wrap_content" 59 android:layout_height="wrap_content"
61 android:ellipsize="end" 60 android:ellipsize="end"
...@@ -77,7 +76,6 @@ ...@@ -77,7 +76,6 @@
77 76
78 <TextView 77 <TextView
79 android:id="@+id/tv_active_coupons_value" 78 android:id="@+id/tv_active_coupons_value"
80 - fontPath="fonts/BTCosmo-Bold.ttf"
81 android:layout_width="wrap_content" 79 android:layout_width="wrap_content"
82 android:layout_height="wrap_content" 80 android:layout_height="wrap_content"
83 android:textColor="@color/cos_light_black" 81 android:textColor="@color/cos_light_black"
...@@ -89,7 +87,6 @@ ...@@ -89,7 +87,6 @@
89 87
90 <TextView 88 <TextView
91 android:id="@+id/tv_active_coupons_description" 89 android:id="@+id/tv_active_coupons_description"
92 - fontPath="fonts/PeridotPE-Regular.ttf"
93 android:layout_width="0dp" 90 android:layout_width="0dp"
94 android:layout_height="wrap_content" 91 android:layout_height="wrap_content"
95 android:ellipsize="end" 92 android:ellipsize="end"
...@@ -98,14 +95,15 @@ ...@@ -98,14 +95,15 @@
98 android:textSize="12sp" 95 android:textSize="12sp"
99 app:layout_constraintBottom_toBottomOf="parent" 96 app:layout_constraintBottom_toBottomOf="parent"
100 app:layout_constraintEnd_toEndOf="parent" 97 app:layout_constraintEnd_toEndOf="parent"
98 + app:layout_constraintHorizontal_bias="0.0"
101 app:layout_constraintStart_toEndOf="@+id/gl_vertical_62_percent_inner" 99 app:layout_constraintStart_toEndOf="@+id/gl_vertical_62_percent_inner"
102 app:layout_constraintTop_toTopOf="parent" 100 app:layout_constraintTop_toTopOf="parent"
101 + app:layout_constraintVertical_bias="0.545"
103 tools:text="Εκπτωση με ελάχιστες αγορές 100€" /> 102 tools:text="Εκπτωση με ελάχιστες αγορές 100€" />
104 </androidx.constraintlayout.widget.ConstraintLayout> 103 </androidx.constraintlayout.widget.ConstraintLayout>
105 104
106 <TextView 105 <TextView
107 android:id="@+id/tv_active_coupons_date" 106 android:id="@+id/tv_active_coupons_date"
108 - fontPath="fonts/PeridotPE-Regular.ttf"
109 android:layout_width="wrap_content" 107 android:layout_width="wrap_content"
110 android:layout_height="wrap_content" 108 android:layout_height="wrap_content"
111 android:textColor="@color/cos_light_black" 109 android:textColor="@color/cos_light_black"
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
26 26
27 <TextView 27 <TextView
28 android:id="@+id/textView3" 28 android:id="@+id/textView3"
29 - fontPath="fonts/BTCosmo-Bold.ttf"
30 android:layout_width="wrap_content" 29 android:layout_width="wrap_content"
31 android:layout_height="wrap_content" 30 android:layout_height="wrap_content"
32 android:gravity="center" 31 android:gravity="center"
...@@ -58,7 +57,6 @@ ...@@ -58,7 +57,6 @@
58 57
59 <TextView 58 <TextView
60 android:id="@+id/tv_no_coupons" 59 android:id="@+id/tv_no_coupons"
61 - fontPath="fonts/PeridotPE-Regular.ttf"
62 android:layout_width="wrap_content" 60 android:layout_width="wrap_content"
63 android:layout_height="wrap_content" 61 android:layout_height="wrap_content"
64 android:layout_centerHorizontal="true" 62 android:layout_centerHorizontal="true"
......
...@@ -49,7 +49,6 @@ ...@@ -49,7 +49,6 @@
49 49
50 <TextView 50 <TextView
51 android:id="@+id/tv_active_coupons_title" 51 android:id="@+id/tv_active_coupons_title"
52 - fontPath="fonts/BTCosmo-Bold.ttf"
53 android:layout_width="wrap_content" 52 android:layout_width="wrap_content"
54 android:layout_height="wrap_content" 53 android:layout_height="wrap_content"
55 android:ellipsize="end" 54 android:ellipsize="end"
...@@ -71,7 +70,6 @@ ...@@ -71,7 +70,6 @@
71 70
72 <TextView 71 <TextView
73 android:id="@+id/tv_active_coupons_value" 72 android:id="@+id/tv_active_coupons_value"
74 - fontPath="fonts/BTCosmo-Bold.ttf"
75 android:layout_width="wrap_content" 73 android:layout_width="wrap_content"
76 android:layout_height="wrap_content" 74 android:layout_height="wrap_content"
77 android:textColor="@color/cos_light_black" 75 android:textColor="@color/cos_light_black"
...@@ -83,7 +81,6 @@ ...@@ -83,7 +81,6 @@
83 81
84 <TextView 82 <TextView
85 android:id="@+id/tv_active_coupons_description" 83 android:id="@+id/tv_active_coupons_description"
86 - fontPath="fonts/PeridotPE-Regular.ttf"
87 android:layout_width="0dp" 84 android:layout_width="0dp"
88 android:layout_height="wrap_content" 85 android:layout_height="wrap_content"
89 android:maxLines="3" 86 android:maxLines="3"
...@@ -99,7 +96,6 @@ ...@@ -99,7 +96,6 @@
99 96
100 <TextView 97 <TextView
101 android:id="@+id/tv_active_coupons_date" 98 android:id="@+id/tv_active_coupons_date"
102 - fontPath="fonts/PeridotPE-Regular.ttf"
103 android:layout_width="wrap_content" 99 android:layout_width="wrap_content"
104 android:layout_height="wrap_content" 100 android:layout_height="wrap_content"
105 android:textColor="@color/cos_light_black" 101 android:textColor="@color/cos_light_black"
...@@ -109,7 +105,6 @@ ...@@ -109,7 +105,6 @@
109 105
110 <TextView 106 <TextView
111 android:id="@+id/tv_active_coupons_date_expired" 107 android:id="@+id/tv_active_coupons_date_expired"
112 - fontPath="fonts/PeridotPE-SemiBold.ttf"
113 android:layout_width="wrap_content" 108 android:layout_width="wrap_content"
114 android:layout_height="wrap_content" 109 android:layout_height="wrap_content"
115 android:textColor="@color/cos_light_black" 110 android:textColor="@color/cos_light_black"
...@@ -137,7 +132,7 @@ ...@@ -137,7 +132,7 @@
137 android:src="@drawable/timer_blue" /> 132 android:src="@drawable/timer_blue" />
138 133
139 <TextView 134 <TextView
140 - fontPath="fonts/PeridotPE-SemiBold.ttf" 135 + android:id="@+id/tv_active_coupons_date_limit_title"
141 android:layout_width="wrap_content" 136 android:layout_width="wrap_content"
142 android:layout_height="wrap_content" 137 android:layout_height="wrap_content"
143 android:text="@string/cos_coupon_date_limit" 138 android:text="@string/cos_coupon_date_limit"
...@@ -147,7 +142,6 @@ ...@@ -147,7 +142,6 @@
147 142
148 <TextView 143 <TextView
149 android:id="@+id/tv_active_coupons_date_limit" 144 android:id="@+id/tv_active_coupons_date_limit"
150 - fontPath="fonts/PeridotPE-SemiBold.ttf"
151 android:layout_width="wrap_content" 145 android:layout_width="wrap_content"
152 android:layout_height="wrap_content" 146 android:layout_height="wrap_content"
153 android:text="@string/cos_coupon_date_limit" 147 android:text="@string/cos_coupon_date_limit"
......