Skip to content

Commit

Permalink
增加官方网站
Browse files Browse the repository at this point in the history
  • Loading branch information
iceCola7 committed Oct 1, 2019
1 parent e23e99f commit 7618189
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ class SettingFragment : PreferenceFragment(), SharedPreferences.OnSharedPreferen
false
}

findPreference("official_website").setOnPreferenceClickListener {
context?.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.official_website_url))))
false
}

findPreference("changelog").setOnPreferenceClickListener {
context?.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.changelog_url))))
false
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-en/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@
<string name="copyright_summary">Only for personal and non commercial purposes</string>
<string name="version">Version</string>
<string name="current_version">Current Version&#160;</string>
<string name="official_website">Official Website</string>
<string name="official_website_url">https://www.wanandroid.com</string>

<!-- Setting -->
<string name="setting">Setting</string>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@
<string name="copyright_summary">仅作个人及非商业用途</string>
<string name="version">版本</string>
<string name="current_version">当前版本&#160;</string>
<string name="official_website">官方网站</string>
<string name="official_website_url">https://www.wanandroid.com</string>

<!-- Setting -->
<string name="setting">设置</string>
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/xml/pref_setting.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@
android:layout="@layout/custom_preference_layout"
android:title="@string/version" />

<Preference
android:key="official_website"
android:layout="@layout/custom_preference_layout"
android:summary="@string/official_website_url"
android:title="@string/official_website" />

<Preference
android:key="changelog"
android:layout="@layout/custom_preference_layout"
Expand Down

0 comments on commit 7618189

Please sign in to comment.