Negative reinforcement d0 exp (#5422)
* update info with timer widget * fix info with timer layout ui * refactor widget ext code * code refactor Co-authored-by: amit-kumar <amit.kumar@navi.com>
This commit is contained in:
committed by
GitHub Enterprise
parent
c9434ec41a
commit
2a13472944
@@ -493,69 +493,48 @@ fun TextView.setSubstringStyles(
|
||||
|
||||
if (isValidIndexRange("$textData ", startEndIndex)) {
|
||||
when (styleString.font) {
|
||||
FontWeightEnum.BOLD.name, FontWeightEnum.NAVI_BOLD.name -> {
|
||||
val boldSpan =
|
||||
CustomTypefaceSpan(
|
||||
"",
|
||||
ResourcesCompat.getFont(context, getFontStyle(FontWeightEnum.BOLD))
|
||||
?: Typeface.DEFAULT
|
||||
)
|
||||
spannableString.setSpan(
|
||||
boldSpan,
|
||||
startEndIndex.first,
|
||||
startEndIndex.second,
|
||||
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||
FontWeightEnum.TT_BOLD.name -> {
|
||||
setSpanForSpannableString(
|
||||
context,
|
||||
spannableString,
|
||||
startEndIndex,
|
||||
getFontStyle(FontWeightEnum.TT_BOLD)
|
||||
)
|
||||
}
|
||||
FontWeightEnum.SEMI_BOLD.name, FontWeightEnum.NAVI_SEMI_BOLD.name -> {
|
||||
val semiBoldSpan =
|
||||
CustomTypefaceSpan(
|
||||
"",
|
||||
ResourcesCompat.getFont(
|
||||
context,
|
||||
getFontStyle(FontWeightEnum.SEMI_BOLD)
|
||||
)
|
||||
?: Typeface.DEFAULT
|
||||
)
|
||||
spannableString.setSpan(
|
||||
semiBoldSpan,
|
||||
startEndIndex.first,
|
||||
startEndIndex.second,
|
||||
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||
FontWeightEnum.TT_SEMI_BOLD.name,
|
||||
FontWeightEnum.ROBOTO_BOLD.name,
|
||||
FontWeightEnum.EXTRA_BOLD.name,
|
||||
FontWeightEnum.NAVI_EXTRA_BOLD.name,
|
||||
FontWeightEnum.NAVI_BLACK.name -> {
|
||||
setSpanForSpannableString(
|
||||
context,
|
||||
spannableString,
|
||||
startEndIndex,
|
||||
getFontStyle(FontWeightEnum.TT_SEMI_BOLD)
|
||||
)
|
||||
}
|
||||
FontWeightEnum.REGULAR.name, FontWeightEnum.NAVI_REGULAR.name -> {
|
||||
val regularSpan =
|
||||
CustomTypefaceSpan(
|
||||
"",
|
||||
ResourcesCompat.getFont(
|
||||
context,
|
||||
getFontStyle(FontWeightEnum.REGULAR)
|
||||
)
|
||||
?: Typeface.DEFAULT
|
||||
)
|
||||
spannableString.setSpan(
|
||||
regularSpan,
|
||||
startEndIndex.first,
|
||||
startEndIndex.second,
|
||||
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||
FontWeightEnum.TT_REGULAR.name,
|
||||
FontWeightEnum.ROBOTO_REGULAR.name,
|
||||
FontWeightEnum.SEMI_BOLD.name,
|
||||
FontWeightEnum.NAVI_SEMI_BOLD.name,
|
||||
FontWeightEnum.REGULAR.name,
|
||||
FontWeightEnum.NAVI_REGULAR.name -> {
|
||||
setSpanForSpannableString(
|
||||
context,
|
||||
spannableString,
|
||||
startEndIndex,
|
||||
getFontStyle(FontWeightEnum.TT_REGULAR)
|
||||
)
|
||||
}
|
||||
FontWeightEnum.EXTRA_BOLD.name, FontWeightEnum.NAVI_EXTRA_BOLD.name -> {
|
||||
val extraBoldSpan =
|
||||
CustomTypefaceSpan(
|
||||
"",
|
||||
ResourcesCompat.getFont(
|
||||
context,
|
||||
getFontStyle(FontWeightEnum.EXTRA_BOLD)
|
||||
)
|
||||
?: Typeface.DEFAULT
|
||||
)
|
||||
spannableString.setSpan(
|
||||
extraBoldSpan,
|
||||
startEndIndex.first,
|
||||
startEndIndex.second,
|
||||
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||
FontWeightEnum.TT_MEDIUM.name,
|
||||
FontWeightEnum.ROBOTO_MEDIUM.name,
|
||||
FontWeightEnum.BOLD.name,
|
||||
FontWeightEnum.NAVI_BOLD.name -> {
|
||||
setSpanForSpannableString(
|
||||
context,
|
||||
spannableString,
|
||||
startEndIndex,
|
||||
getFontStyle(FontWeightEnum.TT_MEDIUM)
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -626,6 +605,19 @@ fun TextView.setSubstringStyles(
|
||||
text = spannableString
|
||||
}
|
||||
|
||||
fun setSpanForSpannableString(
|
||||
context: Context,
|
||||
spannableString: SpannableString,
|
||||
startEndIndex: Pair<Int, Int>,
|
||||
fontStyle: Int
|
||||
) {
|
||||
val customSpan =
|
||||
CustomTypefaceSpan("", ResourcesCompat.getFont(context, fontStyle) ?: Typeface.DEFAULT)
|
||||
spannableString.setSpan(
|
||||
customSpan, startEndIndex.first, startEndIndex.second, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||
)
|
||||
}
|
||||
|
||||
class CustomTypefaceSpan(family: String?, private val newType: Typeface) : TypefaceSpan(family) {
|
||||
override fun updateDrawState(ds: TextPaint) {
|
||||
applyCustomTypeFace(ds, newType)
|
||||
|
||||
@@ -30,6 +30,8 @@ data class InfoWithTimerWidget(
|
||||
data class InfoWithTimerWidgetBody(
|
||||
@SerializedName("timerInfo")
|
||||
val timerInfo: TimerInfo? = null,
|
||||
@SerializedName("elevatedCardData")
|
||||
val elevatedCardData: InfoWithTimerElevatedCardData? = null,
|
||||
@SerializedName("title")
|
||||
val title: TextFieldData? = null,
|
||||
@SerializedName("subTitle")
|
||||
@@ -52,3 +54,12 @@ data class TimerInfo(
|
||||
@SerializedName("leftIcon")
|
||||
val leftIcon: ImageFieldData? = null
|
||||
)
|
||||
|
||||
data class InfoWithTimerElevatedCardData(
|
||||
@SerializedName("title")
|
||||
val title: TextFieldData? = null,
|
||||
@SerializedName("tagData")
|
||||
val tagData: TagWithStyleAndProperties? = null,
|
||||
@SerializedName("keyValueFields")
|
||||
val keyValueFields: List<KeyValueTextFieldData>? = null
|
||||
)
|
||||
|
||||
@@ -506,6 +506,8 @@ object NaviWidgetIconUtils {
|
||||
private const val ICON_STAGE_UNINITIATED = "ICON_STAGE_UNINITIATED"
|
||||
private const val RETRY_ICON = "RETRY_ICON"
|
||||
private const val ICON_INFO_GREEN = "ICON_INFO_GREEN"
|
||||
private const val RUPEE_PROCESSING_ALERT = "RUPEE_PROCESSING_ALERT"
|
||||
private const val BLUE_INFO_TOAST = "BLUE_INFO_TOAST"
|
||||
|
||||
fun updateIcon(
|
||||
imageDetail: ImageDetail,
|
||||
@@ -796,6 +798,7 @@ object NaviWidgetIconUtils {
|
||||
ARROW_TERTIARY -> R.drawable.ic_li_chevron_right
|
||||
EXCLAMATION_TOAST -> R.drawable.ic_exclamation_toast
|
||||
YELLOW_EXCLAMATION_TOAST -> R.drawable.yellow_ic_explamation
|
||||
BLUE_INFO_TOAST -> R.drawable.blue_info_toast_svg
|
||||
GRAY_INFO -> R.drawable.grey_info
|
||||
PERSON_CROSS -> R.drawable.ic_kyc_rejected
|
||||
REFRESH_ICON -> R.drawable.refresh_icon
|
||||
@@ -1037,6 +1040,7 @@ object NaviWidgetIconUtils {
|
||||
ICON_STAGE_PENDING -> R.drawable.ic_processing_icon_in_progress_2
|
||||
ICON_STAGE_UNINITIATED -> R.drawable.ic_uninitiated
|
||||
ICON_INFO_GREEN -> R.drawable.ic_line_success_svg
|
||||
RUPEE_PROCESSING_ALERT -> R.drawable.rupee_processing_alert_svg
|
||||
else -> -1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,9 +16,12 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.databinding.ViewDataBinding
|
||||
import com.navi.base.utils.isNotNull
|
||||
import com.navi.base.utils.orZero
|
||||
import com.navi.design.R
|
||||
import com.navi.design.utils.CornerRadius
|
||||
import com.navi.design.utils.dpToPx
|
||||
import com.navi.design.utils.getNaviDrawable
|
||||
import com.navi.design.utils.parseColorSafe
|
||||
import com.navi.naviwidgets.actions.ShowInfoBottomSheetV3Action
|
||||
import com.navi.naviwidgets.callbacks.WidgetCallback
|
||||
import com.navi.naviwidgets.databinding.LayoutInfoWithTimerBinding
|
||||
@@ -62,6 +65,7 @@ class InfoWithTimerWidgetLayout @JvmOverloads constructor(
|
||||
?.let { root.setBackgroundColor(it) }
|
||||
|
||||
setTimerInfo()
|
||||
setElevatedCard()
|
||||
|
||||
|
||||
titleTv.setTextFieldData(widgetData?.title)
|
||||
@@ -122,6 +126,30 @@ class InfoWithTimerWidgetLayout @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
private fun LayoutInfoWithTimerBinding.setElevatedCard() {
|
||||
widgetData?.elevatedCardData?.let { data ->
|
||||
elevatedCard.root.visibility = VISIBLE
|
||||
elevatedCardBgSpaceView.visibility = VISIBLE
|
||||
elevatedCard.data = data
|
||||
data.tagData?.backgroundColor?.let {
|
||||
elevatedCard.tagTv.background =
|
||||
getNaviDrawable(
|
||||
radii = CornerRadius(
|
||||
leftBottom = dpToPx(data.tagData.cornerRadius.orZero())
|
||||
),
|
||||
backgroundColor = it.parseColorSafe(COLOR_WHITE)
|
||||
)
|
||||
}
|
||||
data.keyValueFields?.let {
|
||||
elevatedCard.emiAmount = it.getOrNull(0)
|
||||
elevatedCard.emiDate = it.getOrNull(1)
|
||||
}
|
||||
} ?: run {
|
||||
elevatedCard.root.visibility = GONE
|
||||
elevatedCardBgSpaceView.visibility = GONE
|
||||
}
|
||||
}
|
||||
|
||||
private fun setDayHourMinuteFormattedString(mills: Long, textView: TextView) {
|
||||
var days: Long = 0
|
||||
var hours: Long = 0
|
||||
@@ -150,5 +178,6 @@ class InfoWithTimerWidgetLayout @JvmOverloads constructor(
|
||||
|
||||
companion object {
|
||||
const val DEFAULT_UPDATE_DURATION_IN_MILLIS: Long = 1000
|
||||
const val COLOR_WHITE = "#FFFFFF"
|
||||
}
|
||||
}
|
||||
|
||||
33
navi-widgets/src/main/res/drawable/blue_info_toast_svg.xml
Normal file
33
navi-widgets/src/main/res/drawable/blue_info_toast_svg.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M0,0h24v24h-24z"/>
|
||||
<path
|
||||
android:pathData="M12,23.003C18.075,23.003 23,18.078 23,12.003C23,5.928 18.075,1.003 12,1.003C5.925,1.003 1,5.928 1,12.003C1,18.078 5.925,23.003 12,23.003Z"
|
||||
android:fillColor="#4B4966"/>
|
||||
<path
|
||||
android:pathData="M12,4.503C14.612,4.505 17.139,5.437 19.126,7.132C21.114,8.826 22.434,11.174 22.848,13.753C23.091,12.254 23.021,10.721 22.643,9.25C22.264,7.779 21.584,6.403 20.647,5.207C19.71,4.012 18.535,3.024 17.197,2.305C15.859,1.587 14.387,1.153 12.873,1.032C11.359,0.911 9.836,1.104 8.401,1.601C6.965,2.097 5.649,2.886 4.533,3.917C3.418,4.947 2.528,6.198 1.92,7.59C1.312,8.982 0.998,10.484 1,12.003C1.004,12.59 1.055,13.175 1.152,13.753C1.566,11.174 2.886,8.826 4.873,7.132C6.861,5.437 9.388,4.505 12,4.503Z"
|
||||
android:fillColor="#9592BB"/>
|
||||
<path
|
||||
android:strokeWidth="1"
|
||||
android:pathData="M12,23.003C18.075,23.003 23,18.078 23,12.003C23,5.928 18.075,1.003 12,1.003C5.925,1.003 1,5.928 1,12.003C1,18.078 5.925,23.003 12,23.003Z"
|
||||
android:strokeLineJoin="round"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ffffff"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M11.606,6.545C11.647,6.518 11.696,6.503 11.745,6.503C11.811,6.503 11.875,6.53 11.922,6.576C11.969,6.623 11.995,6.687 11.995,6.753C11.995,6.803 11.98,6.851 11.953,6.892C11.925,6.933 11.886,6.965 11.841,6.984C11.795,7.003 11.745,7.008 11.696,6.998C11.648,6.989 11.603,6.965 11.568,6.93C11.533,6.895 11.509,6.85 11.5,6.802C11.49,6.753 11.495,6.703 11.514,6.657C11.533,6.612 11.565,6.573 11.606,6.545Z"
|
||||
android:fillColor="#ffffff"/>
|
||||
<path
|
||||
android:strokeWidth="1"
|
||||
android:pathData="M14.5,17.003H13C12.735,17.003 12.48,16.898 12.293,16.71C12.105,16.523 12,16.268 12,16.003V9.503C12,9.371 11.947,9.243 11.854,9.15C11.76,9.056 11.633,9.003 11.5,9.003H10M11.745,6.503C11.696,6.503 11.647,6.518 11.606,6.545C11.565,6.573 11.533,6.612 11.514,6.657C11.495,6.703 11.49,6.753 11.5,6.802C11.509,6.85 11.533,6.895 11.568,6.93C11.603,6.965 11.648,6.989 11.696,6.998C11.745,7.008 11.795,7.003 11.841,6.984C11.886,6.965 11.925,6.933 11.953,6.892C11.98,6.851 11.995,6.803 11.995,6.753C11.995,6.687 11.969,6.623 11.922,6.576C11.875,6.53 11.811,6.503 11.745,6.503Z"
|
||||
android:strokeLineJoin="round"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ffffff"
|
||||
android:strokeLineCap="round"/>
|
||||
</group>
|
||||
</vector>
|
||||
@@ -0,0 +1,74 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="72dp"
|
||||
android:height="72dp"
|
||||
android:viewportWidth="72"
|
||||
android:viewportHeight="72">
|
||||
<path
|
||||
android:pathData="M31.675,55.839C39.745,55.839 46.267,49.296 46.267,41.246C46.267,33.197 39.724,26.654 31.675,26.654C23.625,26.654 17.082,33.197 17.082,41.246C17.082,49.296 23.625,55.839 31.675,55.839Z"
|
||||
android:fillColor="#FF9E88"/>
|
||||
<path
|
||||
android:pathData="M31.675,26.654C23.604,26.654 17.082,33.197 17.082,41.246C17.082,45.206 18.697,48.994 21.538,51.749L42.178,31.109C39.423,28.247 35.635,26.654 31.675,26.654Z"
|
||||
android:fillColor="#FFEAEA"/>
|
||||
<path
|
||||
android:pathData="M31.675,55.839C39.745,55.839 46.267,49.296 46.267,41.246C46.267,33.197 39.724,26.654 31.675,26.654C23.625,26.654 17.082,33.197 17.082,41.246C17.082,49.296 23.625,55.839 31.675,55.839Z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2.47238"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#102F3D"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M38.363,35.495H34.654C35.313,36.072 35.725,36.847 35.89,37.819H38.363V39.525H35.964C35.833,40.844 35.322,41.907 34.431,42.715C33.558,43.506 32.38,43.959 30.896,44.074L36.039,51.417H32.899L28.152,44.099H26.421V42.072H29.734C31.893,42.072 33.121,41.223 33.418,39.525H26.421V37.819H33.368C33.055,36.27 31.844,35.495 29.734,35.495H26.421V33.814H38.363V35.495Z"
|
||||
android:fillColor="#102F3D"/>
|
||||
<path
|
||||
android:pathData="M38.864,17.593C29.222,14.666 18.353,17.83 11.94,26.353C3.718,37.243 5.87,52.761 16.761,60.982"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2.47238"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#102F3D"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M23.778,64.682C33.592,67.997 44.826,64.854 51.391,56.138C59.612,45.248 57.46,29.73 46.57,21.508"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2.47238"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#102F3D"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M15.812,53.729L16.824,61.069L9.485,62.08"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2.47238"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#102F3D"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M46.461,28.182L45.45,20.843L52.789,19.832"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2.47238"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#102F3D"
|
||||
android:strokeLineCap="round"/>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M38.411,2.143h31.017v31.017h-31.017z"/>
|
||||
<path
|
||||
android:pathData="M68.136,17.406C68.146,21.202 66.659,24.848 63.998,27.556C61.336,30.263 57.716,31.812 53.92,31.867C52.066,31.895 50.225,31.555 48.504,30.866C46.783,30.177 45.216,29.153 43.893,27.854C42.571,26.554 41.52,25.005 40.8,23.296C40.081,21.588 39.708,19.753 39.704,17.899C39.693,14.103 41.18,10.455 43.841,7.747C46.502,5.039 50.124,3.49 53.92,3.435C55.774,3.407 57.615,3.748 59.336,4.437C61.058,5.126 62.625,6.15 63.947,7.45C65.27,8.749 66.321,10.299 67.04,12.007C67.759,13.717 68.132,15.551 68.136,17.406Z"
|
||||
android:fillColor="#FF3333"/>
|
||||
<path
|
||||
android:pathData="M53.92,8.604C57.256,8.549 60.501,9.692 63.065,11.827C65.629,13.961 67.341,16.945 67.891,20.236C68.07,19.303 68.152,18.355 68.136,17.406C68.132,15.551 67.759,13.717 67.04,12.007C66.321,10.299 65.27,8.749 63.947,7.45C62.625,6.15 61.058,5.126 59.336,4.437C57.615,3.748 55.774,3.407 53.92,3.435C50.124,3.49 46.502,5.039 43.841,7.747C41.18,10.455 39.693,14.103 39.704,17.899C39.722,18.686 39.803,19.47 39.947,20.244C40.602,17.002 42.344,14.081 44.885,11.965C47.426,9.848 50.613,8.663 53.92,8.604Z"
|
||||
android:fillColor="#FF7575"/>
|
||||
<path
|
||||
android:pathData="M53.92,20.241V11.194M68.136,17.406C68.146,21.202 66.659,24.848 63.998,27.556C61.336,30.263 57.716,31.812 53.92,31.867C52.066,31.895 50.225,31.555 48.504,30.866C46.783,30.177 45.216,29.153 43.893,27.854C42.571,26.554 41.52,25.005 40.8,23.296C40.081,21.588 39.708,19.753 39.704,17.899C39.693,14.103 41.18,10.455 43.841,7.747C46.502,5.039 50.124,3.49 53.92,3.435C55.774,3.407 57.615,3.748 59.336,4.437C61.058,5.126 62.625,6.15 63.947,7.45C65.27,8.749 66.321,10.299 67.04,12.007C67.759,13.717 68.132,15.551 68.136,17.406V17.406Z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="1.93857"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ffffff"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M53.908,25.406C53.866,25.406 53.825,25.416 53.786,25.433C53.747,25.45 53.713,25.475 53.683,25.505C53.655,25.536 53.632,25.572 53.617,25.611C53.602,25.651 53.595,25.693 53.597,25.735C53.6,25.819 53.635,25.899 53.695,25.958C53.755,26.017 53.836,26.051 53.92,26.052V26.052C53.962,26.051 54.004,26.042 54.042,26.025C54.081,26.008 54.116,25.983 54.145,25.952C54.174,25.922 54.196,25.886 54.211,25.846C54.226,25.807 54.233,25.764 54.231,25.722C54.229,25.64 54.195,25.562 54.137,25.503C54.08,25.445 54.002,25.41 53.92,25.406H53.914"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="1.93857"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ffffff"
|
||||
android:strokeLineCap="round"/>
|
||||
</group>
|
||||
</vector>
|
||||
@@ -6,140 +6,194 @@
|
||||
-->
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<com.navi.naviwidgets.widgets.InfoWithTimerWidgetLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/color_FFF3F0"
|
||||
android:paddingBottom="@dimen/dp_28"
|
||||
android:paddingHorizontal="@dimen/dp_16"
|
||||
android:paddingTop="@dimen/dp_16">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/timer_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="@dimen/dp_16"
|
||||
android:paddingVertical="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:visibility="gone"
|
||||
tools:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/leftIcon"
|
||||
android:visibility="gone"
|
||||
tools:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
tools:src="@drawable/ic_outlined_clock"
|
||||
android:layout_marginEnd="@dimen/dp_6"/>
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/timer_tv"
|
||||
style="@style/BoldSp12ColorFF5732"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:minWidth="@dimen/dp_100"
|
||||
android:visibility="gone"
|
||||
tools:text="21d 17hr 20m"
|
||||
tools:visibility="visible" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/title_tv"
|
||||
style="@style/BoldSp20Color191919"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:visibility="gone"
|
||||
android:lineSpacingExtra="@dimen/sp_8"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/timer_layout"
|
||||
app:layout_constraintEnd_toEndOf="@id/endIconLeftBarrier"
|
||||
tools:text="DUE IN 9 DAYS"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/sub_title_tv"
|
||||
style="@style/SemiBoldSp12Color6B6B6B"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title_tv"
|
||||
app:layout_constraintEnd_toEndOf="@id/endIconLeftBarrier"
|
||||
tools:text="DUE IN 9 DAYS"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/end_icon"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@drawable/ic_due_alarm"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/endIconBottomBarrier"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="bottom"
|
||||
app:constraint_referenced_ids="end_icon,sub_title_tv" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/endIconLeftBarrier"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="left"
|
||||
app:constraint_referenced_ids="end_icon" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/important_info_layout"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/widget_cl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:background="@color/color_FFF3F0"
|
||||
android:paddingHorizontal="@dimen/dp_16"
|
||||
android:paddingVertical="@dimen/dp_12"
|
||||
android:background="@color/white"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/endIconBottomBarrier">
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/left_tv"
|
||||
style="@style/SemiBoldSp14Color191919"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone"
|
||||
tools:text="Current overdue EMI"
|
||||
tools:visibility="visible" />
|
||||
android:paddingTop="@dimen/dp_16"
|
||||
android:paddingBottom="@dimen/dp_28">
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/right_tv"
|
||||
style="@style/SemiBoldSp14Color191919"
|
||||
<LinearLayout
|
||||
android:id="@+id/timer_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="@dimen/dp_16"
|
||||
android:paddingVertical="@dimen/dp_8"
|
||||
android:visibility="gone"
|
||||
tools:text="16295"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center_horizontal"
|
||||
android:minWidth="@dimen/dp_100"
|
||||
android:textAlignment="center">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/leftIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="@dimen/dp_6"
|
||||
android:visibility="gone"
|
||||
tools:src="@drawable/ic_outlined_clock"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/timer_tv"
|
||||
style="@style/BoldSp12ColorFF5732"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:visibility="gone"
|
||||
tools:text="21d 17hr 20m"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/title_tv"
|
||||
style="@style/BoldSp20Color191919"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:lineSpacingExtra="@dimen/sp_8"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="@id/endIconLeftBarrier"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/timer_layout"
|
||||
tools:text="DUE IN 9 DAYS"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/sub_title_tv"
|
||||
style="@style/SemiBoldSp12Color6B6B6B"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="@id/endIconLeftBarrier"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title_tv"
|
||||
tools:text="DUE IN 9 DAYS"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/end_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_0"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/sub_title_tv"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/textIconBarrier"
|
||||
tools:src="@drawable/ic_due_alarm"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/textIconBarrier"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="top"
|
||||
app:constraint_referenced_ids="timer_layout,title_tv" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/endIconBottomBarrier"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="bottom"
|
||||
app:constraint_referenced_ids="end_icon,sub_title_tv" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/endIconLeftBarrier"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="left"
|
||||
app:constraint_referenced_ids="end_icon" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/important_info_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:background="@color/white"
|
||||
android:paddingHorizontal="@dimen/dp_16"
|
||||
android:paddingVertical="@dimen/dp_12"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/endIconBottomBarrier"
|
||||
tools:visibility="visible">
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/left_tv"
|
||||
style="@style/SemiBoldSp14Color191919"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone"
|
||||
tools:text="Current overdue EMI"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/right_tv"
|
||||
style="@style/SemiBoldSp14Color191919"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end"
|
||||
android:visibility="gone"
|
||||
tools:text="16295"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/elevated_card_bg_space_view"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/important_info_layout"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/line_view"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="@dimen/dp_1"
|
||||
android:layout_marginBottom="@dimen/dp_60"
|
||||
app:layout_constraintBottom_toBottomOf="@id/widget_cl"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<include
|
||||
android:id="@+id/elevated_card"
|
||||
layout="@layout/view_info_with_timer_elevated_card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginHorizontal="@dimen/dp_8"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/line_view" />
|
||||
|
||||
</com.navi.naviwidgets.widgets.InfoWithTimerWidgetLayout>
|
||||
</layout>
|
||||
@@ -0,0 +1,154 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="data"
|
||||
type="com.navi.naviwidgets.models.response.InfoWithTimerElevatedCardData" />
|
||||
|
||||
<variable
|
||||
name="emiAmount"
|
||||
type="com.navi.naviwidgets.models.response.KeyValueTextFieldData" />
|
||||
|
||||
<variable
|
||||
name="emiDate"
|
||||
type="com.navi.naviwidgets.models.response.KeyValueTextFieldData" />
|
||||
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/widget_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:backgroundTint="@color/white"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:outlineSpotShadowColor="@color/shadowColor"
|
||||
app:cardCornerRadius="@dimen/dp_8"
|
||||
app:cardElevation="@dimen/dp_8"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardUseCompatPadding="true"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:targetApi="P">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="@dimen/dp_8">
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/tag_tv"
|
||||
style="@style/Title3TextStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="@dimen/dp_8"
|
||||
android:paddingTop="@dimen/dp_4"
|
||||
android:paddingEnd="@dimen/dp_8"
|
||||
android:paddingBottom="@dimen/dp_4"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:setTextFieldData="@{data.tagData.tagText}"
|
||||
tools:text="DUE TODAY"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/title_tv"
|
||||
style="@style/Title3TextStyle"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_32"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:setTextFieldData="@{data.title}"
|
||||
tools:text="Pay EMI"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginHorizontal="@dimen/dp_16"
|
||||
android:layout_marginVertical="@dimen/dp_16"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_tv">
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/first_key"
|
||||
style="@style/Title3TextStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:setTextFieldData="@{emiAmount.key}"
|
||||
tools:text="EMI Amount"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/first_value"
|
||||
style="@style/Title3TextStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="@id/first_key"
|
||||
app:layout_constraintTop_toBottomOf="@id/first_key"
|
||||
app:setTextFieldData="@{emiAmount.value}"
|
||||
tools:text="₹8,000"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline"
|
||||
android:layout_width="@dimen/dp_1"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.5" />
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/second_key"
|
||||
style="@style/Title3TextStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="@id/guideline"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:setTextFieldData="@{emiDate.key}"
|
||||
tools:text="EMI date"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/second_value"
|
||||
style="@style/Title3TextStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/guideline"
|
||||
app:layout_constraintTop_toBottomOf="@id/second_key"
|
||||
app:setTextFieldData="@{emiDate.value}"
|
||||
tools:text="12 Mar 2022"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
Reference in New Issue
Block a user