From 4d6782107de7874e61486ace2bb49d4f78467321 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Tue, 31 Dec 2019 21:54:51 +0800 Subject: Handle sidebar links. Version 2.1.0. --- .../infinityforreddit/Activity/LinkResolverActivity.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/src/main/java/ml') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java index c7c57387..d35e129f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java @@ -39,6 +39,7 @@ public class LinkResolverActivity extends AppCompatActivity { private static final String SUBREDDIT_PATTERN = "/[rR]/\\w+/{0,1}"; private static final String USER_PATTERN_1 = "/user/\\w+/{0,1}"; private static final String USER_PATTERN_2 = "/[uU]/\\w+/{0,1}"; + private static final String SIDEBAR_PATTERN = "/[rR]/\\w+/about/sidebar"; @Inject SharedPreferences mSharedPreferences; @@ -139,6 +140,10 @@ public class LinkResolverActivity extends AppCompatActivity { intent.putExtra(ViewUserDetailActivity.EXTRA_MESSAGE_FULLNAME, messageFullname); intent.putExtra(ViewUserDetailActivity.EXTRA_NEW_ACCOUNT_NAME, newAccountName); startActivity(intent); + } else if (path.matches(SIDEBAR_PATTERN)) { + Intent intent = new Intent(this, ViewSidebarActivity.class); + intent.putExtra(ViewSidebarActivity.EXTRA_SUBREDDIT_NAME, path.substring(3, path.length() - 14)); + startActivity(intent); } else { deepLinkError(uri); } -- cgit v1.2.3