TP-12345 | Update About Us App Description (#10824)

This commit is contained in:
Shivam Goyal
2024-05-13 11:12:59 -07:00
committed by GitHub
parent 2b7adccada
commit 4cf5094b6b
2 changed files with 58 additions and 167 deletions

View File

@@ -7,7 +7,6 @@
package com.naviapp.dashboard.menu.customersupport.activities
import com.navi.insurance.R as InsuranceR
import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.compose.foundation.Image
@@ -16,22 +15,16 @@ import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.ClickableText
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.layoutId
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.em
@@ -42,6 +35,7 @@ import com.navi.common.model.ModuleNameV2
import com.navi.common.ui.activity.BaseActivity
import com.navi.design.font.FontWeightEnum
import com.navi.design.theme.*
import com.navi.insurance.R as InsuranceR
import com.naviapp.R
import com.naviapp.analytics.utils.NaviAnalytics
import dagger.hilt.android.AndroidEntryPoint
@@ -59,32 +53,30 @@ class AboutUsActivity : BaseActivity() {
private fun RenderAboutUsScreen() {
ConstraintLayout(
modifier =
Modifier
.fillMaxSize()
.padding(
start = dimensionResource(id = com.navi.amc.R.dimen.dp_30),
end = dimensionResource(id = com.navi.amc.R.dimen.dp_30),
bottom = dimensionResource(id = com.navi.amc.R.dimen.dp_20)
)
Modifier.fillMaxSize()
.padding(
start = dimensionResource(id = com.navi.amc.R.dimen.dp_30),
end = dimensionResource(id = com.navi.amc.R.dimen.dp_30),
bottom = dimensionResource(id = com.navi.amc.R.dimen.dp_20)
)
) {
val (backIv, aboutUsTv, bodyTv, logoIv, copyrightTv) = createRefs()
Image(
painter = painterResource(id = InsuranceR.drawable.ic_back_arrow_with_tail),
contentDescription = null,
modifier =
Modifier
.constrainAs(backIv) {
top.linkTo(parent.top, 40.dp)
start.linkTo(parent.start)
}
.clickable(
interactionSource = remember { MutableInteractionSource() },
indication = null
) {
naviAnalyticsEventTracker.onBackButtonTap()
finish()
}
.layoutId(backIv)
Modifier.constrainAs(backIv) {
top.linkTo(parent.top, 40.dp)
start.linkTo(parent.start)
}
.clickable(
interactionSource = remember { MutableInteractionSource() },
indication = null
) {
naviAnalyticsEventTracker.onBackButtonTap()
finish()
}
.layoutId(backIv)
)
Text(
text = stringResource(R.string.about_us),
@@ -93,35 +85,41 @@ class AboutUsActivity : BaseActivity() {
fontFamily = composeFontFamily,
fontWeight = getFontWeight(FontWeightEnum.TT_MEDIUM),
modifier =
Modifier
.constrainAs(aboutUsTv) {
top.linkTo(backIv.bottom, 30.dp)
start.linkTo(parent.start)
}
.layoutId(aboutUsTv)
Modifier.constrainAs(aboutUsTv) {
top.linkTo(backIv.bottom, 30.dp)
start.linkTo(parent.start)
}
.layoutId(aboutUsTv)
)
Text(
text = stringResource(R.string.about_us_details),
fontSize = 12.sp,
color = Grey4d4d4d,
lineHeight = 2.2.em,
letterSpacing = 0.01.em,
fontFamily = composeFontFamily,
fontWeight = getFontWeight(FontWeightEnum.TT_REGULAR),
modifier =
Modifier.constrainAs(bodyTv) {
top.linkTo(aboutUsTv.bottom, 24.dp)
start.linkTo(parent.start)
end.linkTo(parent.end)
bottom.linkTo(logoIv.top, 8.dp)
height = Dimension.fillToConstraints
}
.verticalScroll(state = rememberScrollState(), enabled = true)
.layoutId(bodyTv)
)
AnnotatedClickableText(modifier =
Modifier
.constrainAs(bodyTv) {
top.linkTo(aboutUsTv.bottom, 24.dp)
start.linkTo(parent.start)
end.linkTo(parent.end)
bottom.linkTo(logoIv.top, 8.dp)
height = Dimension.fillToConstraints
}
.verticalScroll(state = rememberScrollState(), enabled = true)
.layoutId(bodyTv))
Image(
painter = painterResource(id = R.drawable.ic_new_navi_logo_with_text),
contentDescription = "Navi Logo",
modifier =
Modifier
.constrainAs(logoIv) {
bottom.linkTo(copyrightTv.top, 8.dp)
start.linkTo(parent.start)
end.linkTo(parent.end)
}
.layoutId(logoIv)
Modifier.constrainAs(logoIv) {
bottom.linkTo(copyrightTv.top, 8.dp)
start.linkTo(parent.start)
end.linkTo(parent.end)
}
.layoutId(logoIv)
)
Text(
text = stringResource(R.string.copyright_text),
@@ -129,111 +127,18 @@ class AboutUsActivity : BaseActivity() {
color = WhiteCCCCCC,
fontFamily = composeFontFamily,
fontWeight = getFontWeight(FontWeightEnum.TT_REGULAR),
textAlign = TextAlign.Center,
modifier =
Modifier
.constrainAs(copyrightTv) {
start.linkTo(parent.start)
end.linkTo(parent.end)
bottom.linkTo(parent.bottom)
}
.layoutId(copyrightTv)
Modifier.constrainAs(copyrightTv) {
start.linkTo(parent.start)
end.linkTo(parent.end)
bottom.linkTo(parent.bottom)
}
.layoutId(copyrightTv)
)
}
}
@Composable
fun AnnotatedClickableText(modifier: Modifier) {
val mAnnotatedLinkString = buildAnnotatedString {
// creating a string to display in the Text
val aboutUsText = stringResource(R.string.about_us_details)
val naviTechnologiesLimitedHyperLinkText = stringResource(R.string.navi_technologies_limited)
val naviFinserveAnnotatedLinkText = stringResource(R.string.navi_finserv_link)
val naviAmcHypeLinkText = stringResource(R.string.navi_amc_limited)
// word and span to be hyperlinked
val startIndexOfNaviTechLtdLinkText = aboutUsText.indexOf(naviTechnologiesLimitedHyperLinkText)
val endIndexOfNaviTechLtdLinkText = startIndexOfNaviTechLtdLinkText + naviTechnologiesLimitedHyperLinkText.length
val startIndexOfNaviFinservLinkText = aboutUsText.indexOf(naviFinserveAnnotatedLinkText)
val endIndexOfNaviFinservLinkText = startIndexOfNaviFinservLinkText + naviFinserveAnnotatedLinkText.length
val startIndexOfNaviAmcLinkText = aboutUsText.indexOf(naviAmcHypeLinkText)
val endIndexOfNaviAmcLinkText = startIndexOfNaviAmcLinkText + naviAmcHypeLinkText.length
append(aboutUsText)
// Add Style to Hyperlink
addStyle(
style = SpanStyle(
color = FF1F002A,
textDecoration = TextDecoration.Underline
), start = startIndexOfNaviTechLtdLinkText, end = endIndexOfNaviTechLtdLinkText
)
addStyle(
style = SpanStyle(
color = FF1F002A,
textDecoration = TextDecoration.Underline
), start = startIndexOfNaviFinservLinkText, end = endIndexOfNaviFinservLinkText
)
addStyle(
style = SpanStyle(
color = FF1F002A,
textDecoration = TextDecoration.Underline
), start = startIndexOfNaviAmcLinkText, end = endIndexOfNaviAmcLinkText
)
// attach a string annotation that
// stores a URL to the text "link"
addStringAnnotation(
tag = "URL",
annotation = "https://navi.com/",
start = startIndexOfNaviTechLtdLinkText,
end = endIndexOfNaviTechLtdLinkText
)
addStringAnnotation(
tag = "URL",
annotation = "https://www.navifinserv.com/",
start = startIndexOfNaviFinservLinkText,
end = endIndexOfNaviFinservLinkText
)
addStringAnnotation(
tag = "URL",
annotation = "https://navi.com/mutual-fund",
start = startIndexOfNaviAmcLinkText,
end = endIndexOfNaviAmcLinkText
)
}
// UriHandler parse and opens URI inside
// AnnotatedString Item in Browse
val mUriHandler = LocalUriHandler.current
ClickableText(
text = mAnnotatedLinkString,
modifier = modifier,
style = TextStyle(
fontSize = 12.sp,
color = Grey4d4d4d,
lineHeight = 2.2.em,
letterSpacing = 0.01.em,
fontFamily = composeFontFamily,
fontWeight = getFontWeight(FontWeightEnum.TT_REGULAR)
),
onClick = { offset ->
// We check if there is an *URL* annotation attached to the text
// at the clicked position
mAnnotatedLinkString.getStringAnnotations(
tag = "URL", start = offset,
end = offset
)
.firstOrNull()?.let { annotation ->
mUriHandler.openUri(annotation.item)
}
}
)
}
@Preview(showBackground = true)
@Composable
fun DefaultPreview() {

View File

@@ -406,21 +406,7 @@
<string name="copyright_text">© 2024 Navi Technologies Ltd. All rights are reserved.</string>
<string name="moratorium_not_available">Moratorium Not Available</string>
<string name="i_agree_to_not_availing_the_moratorium">I, %s, agree to not availing the moratorium</string>
<string name="about_us_details">Navi is a financial services app owned by Navi Technologies Limited,
where you can avail of Cash Loans, Housing Loans, Health Insurance policies, and invest in a wide
range of Mutual Fund schemes and Digital gold.\n\nThe loans are provided by Navi Finserv Limited,
which is a registered Non-Deposit taking systemically important Non-Banking Financial Company
registered and regulated by the Reserve Bank of India.\n\nOur Health Insurance plans are provided
by Navi General Insurance Limited. We\'re on a mission to give you an amazing health insurance experience,
seamless digital claims service and best-in-class benefits. With Navi Health Insurance,
you will never have to worry about your hospital bills again!\n\nNavi Mutual Fund is registered
with the Securities &amp; Exchange Board of India with Anmol Como Broking Private Limited as its sponsor.
Navi AMC Limited is the Investment Manager to Navi Mutual Fund. Navi Trustee Limited is the trustee to Navi AMC Limited.\n\nNavi
Technologies Limited enables investments in Digital Gold for customers looking for a convenient,
cost-effective and secure way to invest in the coveted yellow metal. You can securely buy,
sell or accumulate 24K certified 99.9% pure gold with Navi Digital Gold from the comfort of your home.\n\nDisclaimer:
Mutual Fund investments are subject to market risks, read all scheme-related documents carefully.
</string>
<string name="about_us_details">At Navi, our mission is to make financial products and services simple, affordable, and accessible for a billion Indians. The Navi App is developed and owned by Navi Technologies Limited.\n\nNavi UPI is offered by Navi Technologies Limited as an NPCI-approved Third Party Application Provider.\n\nCash Loans and Home Loans are provided by Navi Finserv Limited, a systemically-important non-Deposit taking NBFC registered and regulated by the RBI.\n\nHealth Insurance is offered by Navi General Insurance Limited, a non-life insurer registered with the IRDAI.\n\nNavi Mutual Fund offers multiple mutual fund schemes to investors. The Mutual Fund is registered with SEBI with Navi MF Sponsor Private Limited as its sponsor. Navi AMC Limited is the Investment Manager to Navi Mutual Fund. Navi Trustee Limited is the trustee to Navi AMC Limited.</string>
<string name="customer_call">Call (Mon-Sat, 10am-6pm)</string>
<string name="rating_review_hint">Type your review here (optional)</string>
<string name="submit">Submit</string>