|
|
|
@ -102,14 +102,17 @@ class SubscriptionFragment : BaseFragment(), SkuDetailsResponseListener, Purchas |
|
|
|
val ssb = SpannableStringBuilder(upgradeString) |
|
|
|
val ssb = SpannableStringBuilder(upgradeString) |
|
|
|
|
|
|
|
|
|
|
|
val indexOfLastSpace = upgradeString.lastIndexOf(" ") |
|
|
|
val indexOfLastSpace = upgradeString.lastIndexOf(" ") |
|
|
|
val end = upgradeString.chars().count().toInt() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val lightTypeFace = ResourcesCompat.getFont(requireContext(), R.font.roboto_light) |
|
|
|
if (indexOfLastSpace >= 0) { |
|
|
|
val boldTypeFace = ResourcesCompat.getFont(requireContext(), R.font.roboto_bold) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (lightTypeFace != null && boldTypeFace != null) { |
|
|
|
val end = upgradeString.chars().count().toInt() |
|
|
|
ssb.setSpan(TypefaceSpan(lightTypeFace), 0, indexOfLastSpace, Spanned.SPAN_EXCLUSIVE_INCLUSIVE) |
|
|
|
val lightTypeFace = ResourcesCompat.getFont(requireContext(), R.font.roboto_light) |
|
|
|
ssb.setSpan(TypefaceSpan(boldTypeFace), indexOfLastSpace, end, Spanned.SPAN_EXCLUSIVE_INCLUSIVE) |
|
|
|
val boldTypeFace = ResourcesCompat.getFont(requireContext(), R.font.roboto_bold) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (lightTypeFace != null && boldTypeFace != null) { |
|
|
|
|
|
|
|
ssb.setSpan(TypefaceSpan(lightTypeFace), 0, indexOfLastSpace, Spanned.SPAN_EXCLUSIVE_INCLUSIVE) |
|
|
|
|
|
|
|
ssb.setSpan(TypefaceSpan(boldTypeFace), indexOfLastSpace, end, Spanned.SPAN_EXCLUSIVE_INCLUSIVE) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.title.text = ssb |
|
|
|
this.title.text = ssb |
|
|
|
|