Skip to content
This repository has been archived by the owner on Aug 26, 2019. It is now read-only.

Commit

Permalink
添加 Google+ 入口
Browse files Browse the repository at this point in the history
  • Loading branch information
seven332 committed Dec 27, 2014
1 parent 3ed95db commit 376c332
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@
<string name="author_summary" translatable="false">Hippo &lt;ehviewersu@gmail.com&gt;</string>
<string name="twitter_title">Twitter</string>
<string name="twitter_summary">\@jkjvinn is in charge</string>
<string name="google_plus_title" translatable="false">Google+</string>
<string name="changelog_title">Changelog</string>
<string name="thanks_title">Thanks</string>
<string name="website_title">Website</string>
Expand Down
4 changes: 4 additions & 0 deletions res/xml/about_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
android:title="@string/twitter_title"
android:summary="@string/twitter_summary" />

<Preference
android:key="google_plus"
android:title="@string/google_plus_title" />

<Preference
android:key="changelog"
android:title="@string/changelog_title" />
Expand Down
9 changes: 9 additions & 0 deletions src/com/hippo/ehviewer/ui/SettingsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,7 @@ public static class AboutFragment extends PreferenceFragment implements

private static final String KEY_AUTHOR = "author";
private static final String KEY_TWITTER = "twitter";
private static final String KEY_GOOGLE_PLUS = "google_plus";
private static final String KEY_CHANGELOG = "changelog";
private static final String KEY_THANKS = "thanks";
private static final String KEY_WEBSITE = "website";
Expand All @@ -740,6 +741,7 @@ public static class AboutFragment extends PreferenceFragment implements

private Preference mAuthor;
private Preference mTwitter;
private Preference mGooglePlus;
private Preference mChangelog;
private Preference mThanks;
private Preference mWebsite;
Expand All @@ -760,6 +762,8 @@ public void onCreate(Bundle savedInstanceState) {
mAuthor.setOnPreferenceClickListener(this);
mTwitter = findPreference(KEY_TWITTER);
mTwitter.setOnPreferenceClickListener(this);
mGooglePlus = findPreference(KEY_GOOGLE_PLUS);
mGooglePlus.setOnPreferenceClickListener(this);
mChangelog = findPreference(KEY_CHANGELOG);
mChangelog.setOnPreferenceClickListener(this);
mThanks = findPreference(KEY_THANKS);
Expand Down Expand Up @@ -830,6 +834,11 @@ public boolean onClick(MaterialAlertDialog dialog, int which) {
}
}).setNegativeButton(android.R.string.cancel).show();

} else if (KEY_GOOGLE_PLUS.equals(key)) {
Uri uri = Uri.parse("https://plus.google.com/communities/103823982034655188459");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);

} else if (KEY_CHANGELOG.equals(key)) {
InputStream is = getActivity().getResources().openRawResource(R.raw.change_log);
new MaterialAlertDialog.Builder(getActivity()).setTitle(R.string.changelog)
Expand Down

0 comments on commit 376c332

Please sign in to comment.