diff options
author | andrewrasch <raschykid@gmail.com> | 2021-09-22 04:04:21 +0000 |
---|---|---|
committer | andrewrasch <raschykid@gmail.com> | 2021-09-22 04:04:21 +0000 |
commit | 0ca6bc25af02b52ce7b89b1c895a3d00e307d821 (patch) | |
tree | a87e627b46ddaff916d01fb4ef789605e85b531c /app/src/main | |
parent | 2d5829830e062d5cef8ca3ffa55e7dab607b84a7 (diff) | |
download | infinity-for-reddit-0ca6bc25af02b52ce7b89b1c895a3d00e307d821.tar infinity-for-reddit-0ca6bc25af02b52ce7b89b1c895a3d00e307d821.tar.gz infinity-for-reddit-0ca6bc25af02b52ce7b89b1c895a3d00e307d821.tar.bz2 infinity-for-reddit-0ca6bc25af02b52ce7b89b1c895a3d00e307d821.tar.lz infinity-for-reddit-0ca6bc25af02b52ce7b89b1c895a3d00e307d821.tar.xz infinity-for-reddit-0ca6bc25af02b52ce7b89b1c895a3d00e307d821.tar.zst infinity-for-reddit-0ca6bc25af02b52ce7b89b1c895a3d00e307d821.zip |
Added link to wiki in subreddit
Subreddit details menu now has a link to its wiki. Subs without a wiki will show the "this subreddit has no wiki" page.
Diffstat (limited to '')
3 files changed, 13 insertions, 0 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java index 4096a96b..11d19e16 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java @@ -1180,6 +1180,12 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp Toast.makeText(this, R.string.no_app, Toast.LENGTH_SHORT).show(); } return true; + } else if (itemId == R.id.action_go_to_wiki_activity ) { + Intent wikiIntent = new Intent(this, WikiActivity.class); + wikiIntent.putExtra(WikiActivity.EXTRA_SUBREDDIT_NAME, subredditName); + wikiIntent.putExtra(WikiActivity.EXTRA_WIKI_PATH, "index"); + startActivity(wikiIntent); + return true; } return false; } diff --git a/app/src/main/res/menu/view_subreddit_detail_activity.xml b/app/src/main/res/menu/view_subreddit_detail_activity.xml index c1631814..cb92de44 100644 --- a/app/src/main/res/menu/view_subreddit_detail_activity.xml +++ b/app/src/main/res/menu/view_subreddit_detail_activity.xml @@ -58,4 +58,10 @@ android:orderInCategory="9" android:title="@string/action_share" app:showAsAction="never" /> + + <item + android:id="@+id/action_go_to_wiki_activity" + android:orderInCategory="10" + android:title="@string/action_go_to_wiki" + app:showAsAction="never" /> </menu> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 68ab820b..08ce7077 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1190,5 +1190,6 @@ <string name="app_lock_timeout_6_hours">6 hours</string> <string name="app_lock_timeout_12_hours">12 hours</string> <string name="app_lock_timeout_24_hours">24 hours</string> + <string name="action_go_to_wiki">Go to Wiki</string> </resources> |