SetupWizard: LineageSettings: correct privacy policy link span
* Some languages don't have the ´Privacy policy´-text
as the last word of the sentence.
Change-Id: I74e342c8d6bbb038db11538905a12c7fef5a84de
diff --git a/src/org/lineageos/setupwizard/LineageSettingsActivity.java b/src/org/lineageos/setupwizard/LineageSettingsActivity.java
index 4041f4b..03f7945 100644
--- a/src/org/lineageos/setupwizard/LineageSettingsActivity.java
+++ b/src/org/lineageos/setupwizard/LineageSettingsActivity.java
@@ -94,9 +94,10 @@
}
}
};
+ int ppStartIndex = policySummary.indexOf(privacy_policy);
ss.setSpan(clickableSpan,
- policySummary.length() - privacy_policy.length() - 1,
- policySummary.length() - 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
+ ppStartIndex, ppStartIndex + privacy_policy.length(),
+ Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
TextView privacyPolicy = (TextView) findViewById(R.id.privacy_policy);
privacyPolicy.setMovementMethod(LinkMovementMethod.getInstance());
privacyPolicy.setText(ss);