HI card on PL emi payment screen (#8796)
This commit is contained in:
@@ -64,6 +64,7 @@
|
||||
<color name="grey_alabaster">#FAFAFA</color>
|
||||
<color name="grey_divider_color">#E3E3E3</color>
|
||||
<color name="blue_magenta">#D9D7FF</color>
|
||||
<color name="brandeis_blue">#CC0A5CFF</color>
|
||||
<color name="light_yellow_color">#FFF9DC</color>
|
||||
<color name="very_pale_orange_color">#FFF2DC</color>
|
||||
<color name="overlay_light_grey_color">#dddddd</color>
|
||||
|
||||
@@ -89,6 +89,7 @@
|
||||
<dimen name="dp_95">95dp</dimen>
|
||||
<dimen name="dp_96">96dp</dimen>
|
||||
<dimen name="dp_100">100dp</dimen>
|
||||
<dimen name="dp_105">105dp</dimen>
|
||||
<dimen name="dp_106">106dp</dimen>
|
||||
<dimen name="dp_108">108dp</dimen>
|
||||
<dimen name="dp_114">114dp</dimen>
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.navi.base.model.ActionData
|
||||
import com.navi.design.textview.model.NaviSpan
|
||||
import com.navi.naviwidgets.models.NaviTextComponent
|
||||
import com.navi.naviwidgets.models.response.Gradient
|
||||
import com.navi.naviwidgets.models.response.TextFieldData
|
||||
|
||||
interface OfferWidgetItemInfo {
|
||||
fun headerText(): String?
|
||||
@@ -23,4 +24,10 @@ interface OfferWidgetItemInfo {
|
||||
fun bgGradient(): Gradient?
|
||||
fun actionData(): ActionData?
|
||||
fun headerSpan(): List<NaviSpan>?
|
||||
fun newStyleEnabled(): Boolean?
|
||||
fun newTitle(): TextFieldData?
|
||||
fun newSubtext(): TextFieldData?
|
||||
fun newImageUrl(): String?
|
||||
fun newFooterText(): TextFieldData?
|
||||
fun newFooterIconUrl(): String?
|
||||
}
|
||||
|
||||
@@ -80,6 +80,20 @@ data class OfferWidgetItem(
|
||||
val bgGradient: Gradient? = null,
|
||||
@SerializedName("actionData")
|
||||
val actionData: ActionData? = null,
|
||||
@SerializedName("newStyleEnabled")
|
||||
val newStyleEnabled: Boolean? = false,
|
||||
@SerializedName("newTitle")
|
||||
val newTitle: TextFieldData? = null,
|
||||
@SerializedName("newSubtext")
|
||||
val newSubtext: TextFieldData? = null,
|
||||
@SerializedName("newActionData")
|
||||
val newActionData: ActionData? = null,
|
||||
@SerializedName("newImageUrl")
|
||||
val newImageUrl: String? = null,
|
||||
@SerializedName("newFooterText")
|
||||
val newFooterText: TextFieldData? = null,
|
||||
@SerializedName("newFooterIconUrl")
|
||||
val newFooterIconUrl: String? = null,
|
||||
|
||||
override val isDependentWidget: Boolean? = false,
|
||||
override val dependencyWidgetId: String? = null,
|
||||
@@ -110,4 +124,16 @@ data class OfferWidgetItem(
|
||||
override fun actionData(): ActionData? = actionData
|
||||
|
||||
override fun headerSpan(): List<NaviSpan>? = header?.titleSpan
|
||||
|
||||
override fun newStyleEnabled(): Boolean? = newStyleEnabled
|
||||
|
||||
override fun newTitle(): TextFieldData? = newTitle
|
||||
|
||||
override fun newSubtext(): TextFieldData? = newSubtext
|
||||
|
||||
override fun newImageUrl(): String? = newImageUrl
|
||||
|
||||
override fun newFooterText(): TextFieldData? = newFooterText
|
||||
|
||||
override fun newFooterIconUrl(): String? = newFooterIconUrl
|
||||
}
|
||||
|
||||
@@ -12,11 +12,12 @@ import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
import android.util.AttributeSet
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.view.isVisible
|
||||
import com.navi.design.utils.*
|
||||
import com.navi.naviwidgets.R
|
||||
import com.navi.naviwidgets.actions.NavigateClickAction
|
||||
import com.navi.naviwidgets.callbacks.WidgetCallback
|
||||
import com.navi.naviwidgets.databinding.LayoutOfferWidgetItemBinding
|
||||
import com.navi.naviwidgets.extensions.setTextFieldData
|
||||
import com.navi.naviwidgets.extensions.showWhenDataIsAvailable
|
||||
import com.navi.naviwidgets.interfaces.OfferWidgetItemInfo
|
||||
|
||||
@@ -68,17 +69,50 @@ class OfferWidgetItemLayout @JvmOverloads constructor(
|
||||
)
|
||||
)
|
||||
}
|
||||
tvTitle.showWhenDataIsAvailable(showText = info.title())
|
||||
info.titleSpan()?.let {
|
||||
tvTitle.text = info.title()?.spannedText(
|
||||
if(info.newStyleEnabled() == true) {
|
||||
binding.oldStyleContent.isVisible = false
|
||||
binding.newStyleContent.isVisible = true
|
||||
|
||||
binding.newTitle.setTextFieldData(info.newTitle())
|
||||
binding.newSubtext.setTextFieldData(info.newSubtext())
|
||||
binding.newFooterText.setTextFieldData(info.newFooterText())
|
||||
binding.newFooterIcon.showWhenDataIsAvailable(imageUrl = info.newFooterIconUrl())
|
||||
binding.newImage.showWhenDataIsAvailable(imageUrl = info.newImageUrl())
|
||||
info.actionData()?.apply {
|
||||
newAction.showWhenDataIsAvailable(title)
|
||||
bgColor?.let { color ->
|
||||
newAction.backgroundTintList = ColorStateList.valueOf(color.parseColorSafe())
|
||||
}
|
||||
titleColor?.let { color ->
|
||||
newAction.setTextColor(color.parseColorSafe())
|
||||
}
|
||||
}
|
||||
} else {
|
||||
binding.oldStyleContent.isVisible = true
|
||||
binding.newStyleContent.isVisible = false
|
||||
tvTitle.showWhenDataIsAvailable(showText = info.title())
|
||||
info.titleSpan()?.let {
|
||||
tvTitle.text = info.title()?.spannedText(
|
||||
context = context,
|
||||
span = it
|
||||
)
|
||||
}
|
||||
tvDescription.text = info.offerText()?.text.spannedText(
|
||||
context = context,
|
||||
span = it
|
||||
span = info.offerText()?.span
|
||||
)
|
||||
info.actionData()?.apply {
|
||||
tvAction.showWhenDataIsAvailable(title)
|
||||
bgColor?.let { color ->
|
||||
tvAction.backgroundTintList = ColorStateList.valueOf(color.parseColorSafe())
|
||||
}
|
||||
titleColor?.let { color ->
|
||||
tvAction.setTextColor(color.parseColorSafe())
|
||||
}
|
||||
}
|
||||
lavOffer.showWhenDataIsAvailable(lottieName = info.lottieFileName())
|
||||
}
|
||||
tvDescription.text = info.offerText()?.text.spannedText(
|
||||
context = context,
|
||||
span = info.offerText()?.span
|
||||
)
|
||||
|
||||
root.setOnClickListener {
|
||||
widgetCallback.widgetAnalytics(info.actionData()?.metaData?.clickedData)
|
||||
info.actionData()?.let { nonNullActionData ->
|
||||
@@ -91,16 +125,6 @@ class OfferWidgetItemLayout @JvmOverloads constructor(
|
||||
)
|
||||
}
|
||||
}
|
||||
info.actionData()?.apply {
|
||||
tvAction.showWhenDataIsAvailable(title)
|
||||
bgColor?.let { color ->
|
||||
tvAction.backgroundTintList = ColorStateList.valueOf(color.parseColorSafe())
|
||||
}
|
||||
titleColor?.let { color ->
|
||||
tvAction.setTextColor(color.parseColorSafe())
|
||||
}
|
||||
}
|
||||
lavOffer.showWhenDataIsAvailable(lottieName = info.lottieFileName())
|
||||
widgetCallback.widgetAnalytics(info.actionData()?.metaData?.viewedData)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="16dp"
|
||||
android:height="16dp"
|
||||
android:viewportWidth="22"
|
||||
android:viewportHeight="22">
|
||||
<path
|
||||
android:pathData="M12.293,6.293C12.683,5.902 13.317,5.902 13.707,6.293L18.707,11.293C19.098,11.683 19.098,12.317 18.707,12.707L13.707,17.707C13.317,18.098 12.683,18.098 12.293,17.707C11.902,17.317 11.902,16.683 12.293,16.293L16.586,12L12.293,7.707C11.902,7.317 11.902,6.683 12.293,6.293Z"
|
||||
android:fillColor="#1F002A"
|
||||
android:fillType="evenOdd"/>
|
||||
<path
|
||||
android:pathData="M5.293,6.293C5.683,5.902 6.317,5.902 6.707,6.293L11.707,11.293C12.098,11.683 12.098,12.317 11.707,12.707L6.707,17.707C6.317,18.098 5.683,18.098 5.293,17.707C4.902,17.317 4.902,16.683 5.293,16.293L9.586,12L5.293,7.707C4.902,7.317 4.902,6.683 5.293,6.293Z"
|
||||
android:fillColor="#1F002A"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
||||
@@ -45,67 +45,183 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/tvHeaderTitle"
|
||||
tools:backgroundTint="#F4F9FF">
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="wrap_content"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/oldStyleContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_18"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:fontFamily="@font/tt_medium"
|
||||
android:gravity="start"
|
||||
android:textColor="@color/grey_charcoal"
|
||||
android:textSize="@dimen/font_extra_small"
|
||||
app:layout_constraintBottom_toTopOf="@id/tvDescription"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="Get a health cover of" />
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
|
||||
android:id="@+id/tvDescription"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:fontFamily="@font/tt_regular"
|
||||
android:gravity="start"
|
||||
android:textColor="@color/descriptionColor4"
|
||||
android:textSize="@dimen/font_medium"
|
||||
app:layout_constraintBottom_toTopOf="@id/tvAction"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvTitle"
|
||||
tools:text="₹5 lakhs" />
|
||||
|
||||
<com.airbnb.lottie.LottieAnimationView
|
||||
android:id="@+id/lavOffer"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"
|
||||
android:layout_marginBottom="@dimen/dp_24"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
|
||||
android:id="@+id/tvAction"
|
||||
android:layout_width="@dimen/dp_122"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_36"
|
||||
android:layout_marginBottom="@dimen/dp_24"
|
||||
android:background="@drawable/rounded_positive_button_bg"
|
||||
android:backgroundTint="@color/descriptionColor4"
|
||||
android:fontFamily="@font/tt_medium"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/font_small"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvDescription"
|
||||
tools:text="Get Insured" />
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_18"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:fontFamily="@font/tt_medium"
|
||||
android:gravity="start"
|
||||
android:textColor="@color/grey_charcoal"
|
||||
android:textSize="@dimen/font_extra_small"
|
||||
app:layout_constraintBottom_toTopOf="@id/tvDescription"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="Get a health cover of" />
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
|
||||
android:id="@+id/tvDescription"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:fontFamily="@font/tt_regular"
|
||||
android:gravity="start"
|
||||
android:textColor="@color/descriptionColor4"
|
||||
android:textSize="@dimen/font_medium"
|
||||
app:layout_constraintBottom_toTopOf="@id/tvAction"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvTitle"
|
||||
tools:text="₹5 lakhs" />
|
||||
|
||||
<com.airbnb.lottie.LottieAnimationView
|
||||
android:id="@+id/lavOffer"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"
|
||||
android:layout_marginBottom="@dimen/dp_24"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
|
||||
android:id="@+id/tvAction"
|
||||
android:layout_width="@dimen/dp_122"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_36"
|
||||
android:layout_marginBottom="@dimen/dp_24"
|
||||
android:background="@drawable/rounded_positive_button_bg"
|
||||
android:backgroundTint="@color/descriptionColor4"
|
||||
android:fontFamily="@font/tt_medium"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/font_small"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvDescription"
|
||||
tools:text="Get Insured" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/newStyleContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/newImage"
|
||||
android:layout_width="@dimen/dp_105"
|
||||
android:layout_height="@dimen/dp_105"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
app:layout_constraintBottom_toTopOf="@id/newFooterContentCl"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/newTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
tools:text="Get a health cover of"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/newAction"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:paddingStart="@dimen/dp_16"
|
||||
android:paddingEnd="@dimen/dp_16"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/purple_button_color"
|
||||
tools:text="Get insured"
|
||||
android:fontFamily="@font/tt_semi_bold"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:drawableEnd="@drawable/ic_double_purple_arrow"
|
||||
android:drawablePadding="@dimen/dp_10"
|
||||
app:layout_constraintTop_toBottomOf="@id/newTitle"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:background="@drawable/rounded_violet_color_enabled_state"
|
||||
android:backgroundTint="@color/white"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_marginStart="@dimen/dp_16">
|
||||
</androidx.appcompat.widget.AppCompatButton>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/newSubtext"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:layout_marginStart="@dimen/dp_17"
|
||||
tools:text="Cashback on auto-pay setup"
|
||||
app:layout_constraintTop_toBottomOf="@id/newAction"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
app:layout_constraintBottom_toTopOf="@id/newDividerView"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/newDividerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_2"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:background="@drawable/dotted_line_grey"
|
||||
android:backgroundTint="@color/brandeis_blue"
|
||||
app:layout_constraintBottom_toTopOf="@id/newFooterContentCl"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/newFooterContentCl"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="@dimen/dp_9"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/newFooterIcon"
|
||||
android:layout_width="@dimen/dp_16"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@drawable/hand_coins" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/newFooterText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:textAlignment="center"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/newFooterIcon"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="Get assured flat ₹500 cashback" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</com.navi.naviwidgets.widgets.OfferWidgetItemLayout>
|
||||
</layout>
|
||||
Reference in New Issue
Block a user