Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_android_sdk_maven_plugin
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Panagiotis Triantafyllou
2023-04-18 14:05:43 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
465d7fc9fa2f9a23f424738855a460bf859e1a02
465d7fc9
1 parent
fd2ddd0c
ui fixes
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
21 additions
and
42 deletions
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponInfoActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponsetInfoActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/ActiveCouponAdapter.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/CouponsetsAdapter.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/MergedGiftsAdapter.java
warply_android_sdk/src/main/res/layout/active_coupon_layout.xml
warply_android_sdk/src/main/res/layout/activity_coupon_info.xml
warply_android_sdk/src/main/res/layout/activity_coupon_share.xml
warply_android_sdk/src/main/res/layout/activity_telco.xml
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponInfoActivity.java
View file @
465d7fc
...
...
@@ -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
());
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponsetInfoActivity.java
View file @
465d7fc
...
...
@@ -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
(
Html
Compat
.
fromHtml
(
mCouponset
.
getDescription
(),
HtmlCompat
.
FROM_HTML_MODE_COMPACT
));
mTvCouponsetSubtitle
.
setMovementMethod
(
LinkMovementMethod
.
getInstance
());
mLlTerms
.
setOnClickListener
(
this
);
mTvTermsValue
.
setText
(
Html
.
fromHtml
(
mCouponset
.
getTerms
()
));
mTvTermsValue
.
setText
(
Html
Compat
.
fromHtml
(
mCouponset
.
getTerms
(),
HtmlCompat
.
FROM_HTML_MODE_COMPACT
));
mTvTermsValue
.
setMovementMethod
(
LinkMovementMethod
.
getInstance
());
if
(!
TextUtils
.
isEmpty
(
mCouponset
.
getImgPreview
()))
{
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/ActiveCouponAdapter.java
View file @
465d7fc
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
));
}
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/CouponsetsAdapter.java
View file @
465d7fc
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
(
Html
Compat
.
fromHtml
(
couponsetItem
.
getDescription
(),
HtmlCompat
.
FROM_HTML_MODE_COMPACT
));
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd hh:mm"
);
Date
newDate
=
new
Date
();
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/MergedGiftsAdapter.java
View file @
465d7fc
...
...
@@ -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(Html
Compat.fromHtml(mergedgiftsItem.getCouponset().getDescription(), HtmlCompat.FROM_HTML_MODE_COMPACT
));
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
// Date newDate = new Date();
...
...
warply_android_sdk/src/main/res/layout/active_coupon_layout.xml
View file @
465d7fc
...
...
@@ -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_margin
Start
=
"16dp"
android:layout_margin
Horizontal
=
"16dp"
android:orientation=
"vertical"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_to
StartOf=
"@+id/gl_vertical_72_perc
ent"
app:layout_constraintEnd_to
EndOf=
"par
ent"
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"
...
...
warply_android_sdk/src/main/res/layout/activity_coupon_info.xml
View file @
465d7fc
...
...
@@ -103,7 +103,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginTop=
"
48
dp"
android:layout_marginTop=
"
24
dp"
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=
"
40
dp"
android:layout_marginTop=
"
24
dp"
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=
"
64
dp"
android:layout_marginTop=
"
32
dp"
android:background=
"@drawable/selector_button_green"
android:gravity=
"center"
android:orientation=
"horizontal"
...
...
warply_android_sdk/src/main/res/layout/activity_coupon_share.xml
View file @
465d7fc
...
...
@@ -100,7 +100,7 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"24dp"
android:layout_marginTop=
"
64
dp"
android:layout_marginTop=
"
32
dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/textView14"
>
...
...
warply_android_sdk/src/main/res/layout/activity_telco.xml
View file @
465d7fc
...
...
@@ -154,7 +154,7 @@
android:layout_height=
"55dp"
android:layout_below=
"@+id/textView13"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"
44
dp"
android:layout_marginTop=
"
32
dp"
android:background=
"@drawable/selector_button_green"
android:gravity=
"center"
android:orientation=
"horizontal"
>
...
...
Please
register
or
login
to post a comment