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.
This commit is contained in:
andrewrasch 2021-09-22 00:04:21 -04:00
parent 2d5829830e
commit 0ca6bc25af
3 changed files with 13 additions and 0 deletions

View File

@ -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;
}

View File

@ -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>

View File

@ -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>