Merge pull request #77 from loki-project/legal

Update Legal Copy & URLs
This commit is contained in:
gmbnt 2020-02-07 11:33:04 +11:00 committed by GitHub
commit 384020de95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 60 additions and 34 deletions

View File

@ -65,17 +65,16 @@
android:layout_marginRight="@dimen/massive_spacing"
android:text="Copy" />
<Button
android:id="@+id/termsButton"
<TextView
android:id="@+id/termsTextView"
android:layout_width="match_parent"
android:layout_height="@dimen/onboarding_button_bottom_offset"
android:layout_marginLeft="@dimen/massive_spacing"
android:layout_marginRight="@dimen/massive_spacing"
android:gravity="center"
android:background="@color/transparent"
android:textAllCaps="false"
android:textColorLink="@color/text"
android:textSize="@dimen/very_small_font_size"
android:textColor="@color/text"
android:text="By using this service, you agree to our Terms and Conditions and Privacy Statement" />
android:text="By using this service, you agree to our Terms of Service and Privacy Policy" />
</LinearLayout>

View File

@ -55,17 +55,16 @@
android:layout_marginRight="@dimen/massive_spacing"
android:text="Continue" />
<Button
android:id="@+id/termsButton"
<TextView
android:id="@+id/termsTextView"
android:layout_width="match_parent"
android:layout_height="@dimen/onboarding_button_bottom_offset"
android:layout_marginLeft="@dimen/massive_spacing"
android:layout_marginRight="@dimen/massive_spacing"
android:gravity="center"
android:background="@color/transparent"
android:textAllCaps="false"
android:textColorLink="@color/text"
android:textSize="@dimen/very_small_font_size"
android:textColor="@color/text"
android:text="By using this service, you agree to our Terms and Conditions and Privacy Statement" />
android:text="By using this service, you agree to our Terms of Service and Privacy Policy" />
</LinearLayout>

View File

@ -66,17 +66,16 @@
android:layout_marginRight="@dimen/massive_spacing"
android:text="Copy" />
<Button
android:id="@+id/termsButton"
<TextView
android:id="@+id/termsTextView"
android:layout_width="match_parent"
android:layout_height="@dimen/onboarding_button_bottom_offset"
android:layout_marginLeft="@dimen/massive_spacing"
android:layout_marginRight="@dimen/massive_spacing"
android:gravity="center"
android:background="@color/transparent"
android:textAllCaps="false"
android:textColorLink="@color/text"
android:textSize="@dimen/very_small_font_size"
android:textColor="@color/text"
android:text="By using this service, you agree to our Terms and Conditions and Privacy Statement" />
android:text="By using this service, you agree to our Terms of Service and Privacy Policy" />
</LinearLayout>

View File

@ -55,17 +55,16 @@
android:layout_marginRight="@dimen/massive_spacing"
android:text="Continue" />
<Button
android:id="@+id/termsButton"
<TextView
android:id="@+id/termsTextView"
android:layout_width="match_parent"
android:layout_height="@dimen/onboarding_button_bottom_offset"
android:layout_marginLeft="@dimen/massive_spacing"
android:layout_marginRight="@dimen/massive_spacing"
android:gravity="center"
android:background="@color/transparent"
android:textAllCaps="false"
android:textColorLink="@color/text"
android:textSize="@dimen/very_small_font_size"
android:textColor="@color/text"
android:text="By using this service, you agree to our Terms and Conditions and Privacy Statement" />
android:text="By using this service, you agree to our Terms of Service and Privacy Policy" />
</LinearLayout>

View File

@ -10,7 +10,10 @@ import android.os.Bundle
import android.os.Handler
import android.text.Spannable
import android.text.SpannableStringBuilder
import android.text.method.LinkMovementMethod
import android.text.style.ClickableSpan
import android.text.style.StyleSpan
import android.view.View
import android.widget.Toast
import kotlinx.android.synthetic.main.activity_register.*
import network.loki.messenger.R
@ -45,11 +48,23 @@ class RegisterActivity : BaseActionBarActivity() {
setUpActionBarSessionLogo()
registerButton.setOnClickListener { register() }
copyButton.setOnClickListener { copyPublicKey() }
val termsExplanation = SpannableStringBuilder("By using this service, you agree to our Terms and Conditions and Privacy Statement")
termsExplanation.setSpan(StyleSpan(Typeface.BOLD), 40, 60, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
termsExplanation.setSpan(StyleSpan(Typeface.BOLD), 65, 82, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
termsButton.text = termsExplanation
termsButton.setOnClickListener { showTerms() }
val termsExplanation = SpannableStringBuilder("By using this service, you agree to our Terms of Service and Privacy Policy")
termsExplanation.setSpan(StyleSpan(Typeface.BOLD), 40, 56, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
termsExplanation.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
openURL("https://getsession.org/legal/#tos")
}
}, 40, 56, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
termsExplanation.setSpan(StyleSpan(Typeface.BOLD), 61, 75, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
termsExplanation.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
openURL("https://getsession.org/privacy-policy/")
}
}, 61, 75, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
termsTextView.movementMethod = LinkMovementMethod.getInstance()
termsTextView.text = termsExplanation
updateKeyPair()
}
// endregion
@ -142,9 +157,9 @@ class RegisterActivity : BaseActionBarActivity() {
Toast.makeText(this, R.string.activity_register_public_key_copied_message, Toast.LENGTH_SHORT).show()
}
private fun showTerms() {
private fun openURL(url: String) {
try {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/loki-project/loki-messenger-android/blob/master/privacy-policy.md"))
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
startActivity(intent)
} catch (e: Exception) {
Toast.makeText(this, "Couldn't open link", Toast.LENGTH_SHORT).show()

View File

@ -6,7 +6,10 @@ import android.net.Uri
import android.os.Bundle
import android.text.Spannable
import android.text.SpannableStringBuilder
import android.text.method.LinkMovementMethod
import android.text.style.ClickableSpan
import android.text.style.StyleSpan
import android.view.View
import android.widget.Toast
import kotlinx.android.synthetic.main.activity_restore.*
import network.loki.messenger.R
@ -38,11 +41,23 @@ class RestoreActivity : BaseActionBarActivity() {
setContentView(R.layout.activity_restore)
mnemonicEditText.imeOptions = mnemonicEditText.imeOptions or 16777216 // Always use incognito keyboard
restoreButton.setOnClickListener { restore() }
val termsExplanation = SpannableStringBuilder("By using this service, you agree to our Terms and Conditions and Privacy Statement")
termsExplanation.setSpan(StyleSpan(Typeface.BOLD), 40, 60, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
termsExplanation.setSpan(StyleSpan(Typeface.BOLD), 65, 82, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
termsButton.text = termsExplanation
termsButton.setOnClickListener { showTerms() }
val termsExplanation = SpannableStringBuilder("By using this service, you agree to our Terms of Service and Privacy Policy")
termsExplanation.setSpan(StyleSpan(Typeface.BOLD), 40, 56, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
termsExplanation.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
openURL("https://getsession.org/legal/#tos")
}
}, 40, 56, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
termsExplanation.setSpan(StyleSpan(Typeface.BOLD), 61, 75, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
termsExplanation.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
openURL("https://getsession.org/privacy-policy/")
}
}, 61, 75, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
termsTextView.movementMethod = LinkMovementMethod.getInstance()
termsTextView.text = termsExplanation
}
// endregion
@ -97,9 +112,9 @@ class RestoreActivity : BaseActionBarActivity() {
}
}
private fun showTerms() {
private fun openURL(url: String) {
try {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/loki-project/loki-messenger-android/blob/master/privacy-policy.md"))
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
startActivity(intent)
} catch (e: Exception) {
Toast.makeText(this, "Couldn't open link", Toast.LENGTH_SHORT).show()