Skip to content

Commit 72ad15e

Browse files
committed
add an Invite Friends button
1 parent 632a296 commit 72ad15e

File tree

6 files changed

+39
-2
lines changed

6 files changed

+39
-2
lines changed

app/src/main/java/com/simplemobiletools/filemanager/activities/AboutActivity.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,24 @@ private void setupRateUs() {
6060
}
6161
}
6262

63+
@OnClick(R.id.about_invite)
64+
public void inviteFriend() {
65+
final Intent intent = new Intent();
66+
final String text = String.format(getString(R.string.share_text), getString(R.string.app_name), getStoreUrl());
67+
intent.setAction(Intent.ACTION_SEND);
68+
intent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.app_name));
69+
intent.putExtra(Intent.EXTRA_TEXT, text);
70+
intent.setType("text/plain");
71+
startActivity(Intent.createChooser(intent, getString(R.string.invite_via)));
72+
}
73+
6374
@OnClick(R.id.about_rate_us)
6475
public void rateUsClicked() {
6576
final Uri uri = Uri.parse("market://details?id=" + getPackageName());
6677
try {
6778
startActivity(new Intent(Intent.ACTION_VIEW, uri));
6879
} catch (ActivityNotFoundException ignored) {
69-
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id=" + getPackageName())));
80+
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(getStoreUrl())));
7081
}
7182
}
7283

@@ -92,4 +103,8 @@ public void googlePlusClicked() {
92103
final String link = "https://plus.google.com/communities/104880861558693868382";
93104
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(link)));
94105
}
106+
107+
private String getStoreUrl() {
108+
return "https://play.google.com/store/apps/details?id=" + getPackageName();
109+
}
95110
}

app/src/main/res/layout/activity_about.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,22 @@
3838
android:text="@string/email"/>
3939

4040
<TextView
41-
android:id="@+id/about_rate_us"
41+
android:id="@+id/about_invite"
4242
android:layout_width="match_parent"
4343
android:layout_height="wrap_content"
4444
android:layout_below="@+id/about_email"
4545
android:paddingBottom="@dimen/activity_margin"
4646
android:paddingTop="@dimen/activity_margin"
47+
android:text="@string/invite_friends_underlined"
48+
android:textColor="@color/colorPrimary"/>
49+
50+
<TextView
51+
android:id="@+id/about_rate_us"
52+
android:layout_width="match_parent"
53+
android:layout_height="wrap_content"
54+
android:layout_below="@+id/about_invite"
55+
android:paddingBottom="@dimen/activity_margin"
56+
android:paddingTop="@dimen/activity_margin"
4757
android:text="@string/rate_us_underlined"
4858
android:textColor="@color/colorPrimary"/>
4959

app/src/main/res/values-it/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
<string name="website">Altre semplici app e codici sorgenti in:\nhttp://simplemobiletools.com</string>
4444
<string name="email_label">Invia la tua opinione o i tuoi suggerimenti a:</string>
4545
<string name="third_party_licences_underlined"><u>Licenze di terze parti</u></string>
46+
<string name="invite_friends_underlined"><u>Invite friends</u></string>
47+
<string name="share_text">Hey, come check out %1$s at %2$s</string>
48+
<string name="invite_via">Invite via</string>
4649
<string name="rate_us_underlined"><u>Dacci un voto sul Play Store</u></string>
4750
<string name="follow_us">Seguici:</string>
4851
<string name="copyright">v %1$s\nCopyright © Simple Mobile Tools %2$d</string>

app/src/main/res/values-ja/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
<string name="website">もっとシンプルなアプリとソースコードは:\nhttp://simplemobiletools.com</string>
4444
<string name="email_label">ご意見やご提案をお送りください:</string>
4545
<string name="third_party_licences_underlined"><u>サードパーティー ライセンス</u></string>
46+
<string name="invite_friends_underlined"><u>Invite friends</u></string>
47+
<string name="share_text">Hey, come check out %1$s at %2$s</string>
48+
<string name="invite_via">Invite via</string>
4649
<string name="rate_us_underlined"><u>Play ストアで評価してください</u></string>
4750
<string name="follow_us">フォローしてください:</string>
4851
<string name="copyright">v %1$s\nCopyright © Simple Mobile Tools %2$d</string>

app/src/main/res/values-sv/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
<string name="website">Fler enkla appar och källkod här:\nhttp://simplemobiletools.com</string>
4444
<string name="email_label">Skicka feedback och förslag till:</string>
4545
<string name="third_party_licences_underlined"><u>Tredjepartslicenser</u></string>
46+
<string name="invite_friends_underlined"><u>Invite friends</u></string>
47+
<string name="share_text">Hey, come check out %1$s at %2$s</string>
48+
<string name="invite_via">Invite via</string>
4649
<string name="rate_us_underlined"><u>Betygsätt oss i Play Butiken</u></string>
4750
<string name="follow_us">Följ oss:</string>
4851
<string name="copyright">v %1$s\nCopyright © Simple Mobile Tools %2$d</string>

app/src/main/res/values/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@
4444
<string name="email_label">Send your feedback or suggestions to:</string>
4545
<string name="email" translatable="false">[email protected]</string>
4646
<string name="third_party_licences_underlined"><u>Third party licences</u></string>
47+
<string name="invite_friends_underlined"><u>Invite friends</u></string>
48+
<string name="share_text">Hey, come check out %1$s at %2$s</string>
49+
<string name="invite_via">Invite via</string>
4750
<string name="rate_us_underlined"><u>Rate us in the Play Store</u></string>
4851
<string name="follow_us">Follow us:</string>
4952
<string name="copyright">v %1$s\nCopyright © Simple Mobile Tools %2$d</string>

0 commit comments

Comments
 (0)