From 72ad15e3ae1252106866dc74e54c0b617da81935 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 22 Aug 2016 21:47:33 +0200 Subject: [PATCH] add an Invite Friends button --- .../filemanager/activities/AboutActivity.java | 17 ++++++++++++++++- app/src/main/res/layout/activity_about.xml | 12 +++++++++++- app/src/main/res/values-it/strings.xml | 3 +++ app/src/main/res/values-ja/strings.xml | 3 +++ app/src/main/res/values-sv/strings.xml | 3 +++ app/src/main/res/values/strings.xml | 3 +++ 6 files changed, 39 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/simplemobiletools/filemanager/activities/AboutActivity.java b/app/src/main/java/com/simplemobiletools/filemanager/activities/AboutActivity.java index 27d4974f..d882e12e 100644 --- a/app/src/main/java/com/simplemobiletools/filemanager/activities/AboutActivity.java +++ b/app/src/main/java/com/simplemobiletools/filemanager/activities/AboutActivity.java @@ -60,13 +60,24 @@ public class AboutActivity extends SimpleActivity { } } + @OnClick(R.id.about_invite) + public void inviteFriend() { + final Intent intent = new Intent(); + final String text = String.format(getString(R.string.share_text), getString(R.string.app_name), getStoreUrl()); + intent.setAction(Intent.ACTION_SEND); + intent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.app_name)); + intent.putExtra(Intent.EXTRA_TEXT, text); + intent.setType("text/plain"); + startActivity(Intent.createChooser(intent, getString(R.string.invite_via))); + } + @OnClick(R.id.about_rate_us) public void rateUsClicked() { final Uri uri = Uri.parse("market://details?id=" + getPackageName()); try { startActivity(new Intent(Intent.ACTION_VIEW, uri)); } catch (ActivityNotFoundException ignored) { - startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id=" + getPackageName()))); + startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(getStoreUrl()))); } } @@ -92,4 +103,8 @@ public class AboutActivity extends SimpleActivity { final String link = "https://plus.google.com/communities/104880861558693868382"; startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(link))); } + + private String getStoreUrl() { + return "https://play.google.com/store/apps/details?id=" + getPackageName(); + } } diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index d0157ec2..f43c95dd 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -38,12 +38,22 @@ android:text="@string/email"/> + + diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 4388bf2c..b2a7ad53 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -43,6 +43,9 @@ Altre semplici app e codici sorgenti in:\nhttp://simplemobiletools.com Invia la tua opinione o i tuoi suggerimenti a: Licenze di terze parti + Invite friends + Hey, come check out %1$s at %2$s + Invite via Dacci un voto sul Play Store Seguici: v %1$s\nCopyright © Simple Mobile Tools %2$d diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 2c7a2712..a70c63c7 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -43,6 +43,9 @@ もっとシンプルなアプリとソースコードは:\nhttp://simplemobiletools.com ご意見やご提案をお送りください: サードパーティー ライセンス + Invite friends + Hey, come check out %1$s at %2$s + Invite via Play ストアで評価してください フォローしてください: v %1$s\nCopyright © Simple Mobile Tools %2$d diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index a88ae21f..8e129293 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -43,6 +43,9 @@ Fler enkla appar och källkod här:\nhttp://simplemobiletools.com Skicka feedback och förslag till: Tredjepartslicenser + Invite friends + Hey, come check out %1$s at %2$s + Invite via Betygsätt oss i Play Butiken Följ oss: v %1$s\nCopyright © Simple Mobile Tools %2$d diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index bd8341ca..7285cd10 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -44,6 +44,9 @@ Send your feedback or suggestions to: hello@simplemobiletools.com Third party licences + Invite friends + Hey, come check out %1$s at %2$s + Invite via Rate us in the Play Store Follow us: v %1$s\nCopyright © Simple Mobile Tools %2$d