add oldschool text invite

This commit is contained in:
tibbi 2016-08-20 13:21:40 +02:00
parent 2c858ff3ae
commit 9892ea8291
2 changed files with 15 additions and 4 deletions

View File

@ -36,10 +36,16 @@ class AboutActivity : SimpleActivity() {
about_email.movementMethod = LinkMovementMethod.getInstance()
}
private fun setupInvite() {
about_invite.setOnClickListener {
val intent = Intent()
val text = String.format(getString(R.string.share_text), getString(R.string.app_name), getStoreUrl())
intent.action = Intent.ACTION_SEND
intent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.app_name))
intent.putExtra(Intent.EXTRA_TEXT, text)
intent.type = "text/plain"
about_invite.setOnClickListener {
startActivity(Intent.createChooser(intent, getString(R.string.invite_via)))
}
}
@ -89,7 +95,11 @@ class AboutActivity : SimpleActivity() {
try {
return "market://details?id=" + packageName
} catch (ignored: ActivityNotFoundException) {
return "http://play.google.com/store/apps/details?id=" + packageName
return getStoreUrl()
}
}
private fun getStoreUrl(): String {
return "https://play.google.com/store/apps/details?id=" + packageName
}
}

View File

@ -15,7 +15,8 @@
<string name="email" translatable="false">hello@simplemobiletools.com</string>
<string name="third_party_licences_underlined"><u>Third party licences</u></string>
<string name="invite_friends_underlined"><u>Invite friends</u></string>
<string name="come_check_out">Come check out %s</string>
<string name="share_text">Hey, come check out %1$s at %2$s</string>
<string name="invite_via">Invite via</string>
<string name="rate_us_underlined"><u>Rate us in the Play Store</u></string>
<string name="follow_us">Follow us:</string>
<string name="copyright">v %1$s\nCopyright © Simple Mobile Tools %2$d</string>