Skip to content

Commit

Permalink
fixed tnc title
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiragKalra committed Dec 25, 2020
1 parent 27ccc0f commit 0df9368
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/src/main/java/com/bruhascended/organiso/StartActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class StartActivity : AppCompatActivity() {
// ask the user to accept TnC and privacy policy
val flag = Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
val mContext = this
var strIn = getString(R.string.terms_and_conditions)
val strIn = getString(R.string.terms_and_conditions)
var strOut = getString(R.string.agree_to_tnc, strIn)
var start = strOut.indexOf(strIn)
var strBuilder = SpannableStringBuilder(strOut)
Expand All @@ -171,20 +171,20 @@ class StartActivity : AppCompatActivity() {
tnc.text = strBuilder
tnc.movementMethod = LinkMovementMethod.getInstance()

strIn = getString(R.string.privacy_policy)
strOut = getString(R.string.read_privacy_policy, strIn)
start = strOut.indexOf(strIn)
val strInPP = getString(R.string.privacy_policy)
strOut = getString(R.string.read_privacy_policy, strInPP)
start = strOut.indexOf(strInPP)
strBuilder = SpannableStringBuilder(strOut)
strBuilder.setSpan(object : ClickableSpan() {
override fun onClick(view: View) {
startActivity(
Intent(mContext, PolicyActivity::class.java).apply {
putExtra(Intent.EXTRA_FROM_STORAGE,"privacy_policy.html")
putExtra(Intent.EXTRA_TITLE, strIn)
putExtra(Intent.EXTRA_TITLE, strInPP)
}
)
}
}, start, start + strIn.length, flag)
}, start, start + strInPP.length, flag)
privacy.text = strBuilder
privacy.movementMethod = LinkMovementMethod.getInstance()

Expand Down

0 comments on commit 0df9368

Please sign in to comment.