Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #324 #325

Merged
merged 1 commit into from
Jan 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -87,6 +87,19 @@ public boolean onPreferenceClick(Preference preference) {
}
});

Preference tell_friend=findPreference(getString(R.string.pref_tell_key));
tell_friend.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_TEXT,getString(R.string.pref_tell_message)+" http://play.google.com/store/apps/details?id=" + getActivity().getPackageName());
shareIntent.setType("text/plain");
startActivity(shareIntent);
return true;
}
});

Preference restoreProject = findPreference(getString(R.string.key_restore_project));
restoreProject.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
3 changes: 3 additions & 0 deletions source-code/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -417,5 +417,8 @@
<string name="pref_rate_summary">Rate our app on Play Store</string>
<string name="pref_rate_key">rate</string>
<string name="settings_network_unavailable">Network not available</string>
<string name="pref_tell_key">tell</string>
<string name="pref_tell_title">Tell a friend</string>
<string name="pref_tell_message">BuildmLearn Toolkit for your phone. Download it from here :</string>
</resources>

5 changes: 5 additions & 0 deletions source-code/app/src/main/res/xml/fragment_settings.xml
Original file line number Diff line number Diff line change
@@ -28,4 +28,9 @@
android:key="@string/pref_rate_key"
android:title="@string/pref_rate_title"
android:summary="@string/pref_rate_summary"/>

<PreferenceScreen
android:key="@string/pref_tell_key"
android:title="@string/pref_tell_title"/>

</PreferenceScreen>