diff options
author | Alex Ning <chineseperson5@gmail.com> | 2019-12-31 13:54:51 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2019-12-31 13:54:51 +0000 |
commit | 4d6782107de7874e61486ace2bb49d4f78467321 (patch) | |
tree | 5abaf7407a2f30da92b559d120b3a1aee76ad5dd /app | |
parent | e4ce71bf2a15232bacbb8eef438b35dcd5a8e08a (diff) | |
download | infinity-for-reddit-4d6782107de7874e61486ace2bb49d4f78467321.tar infinity-for-reddit-4d6782107de7874e61486ace2bb49d4f78467321.tar.gz infinity-for-reddit-4d6782107de7874e61486ace2bb49d4f78467321.tar.bz2 infinity-for-reddit-4d6782107de7874e61486ace2bb49d4f78467321.tar.lz infinity-for-reddit-4d6782107de7874e61486ace2bb49d4f78467321.tar.xz infinity-for-reddit-4d6782107de7874e61486ace2bb49d4f78467321.tar.zst infinity-for-reddit-4d6782107de7874e61486ace2bb49d4f78467321.zip |
Handle sidebar links. Version 2.1.0.
Diffstat (limited to '')
-rw-r--r-- | app/build.gradle | 4 | ||||
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/app/build.gradle b/app/build.gradle index b8218769..50a01d53 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "ml.docilealligator.infinityforreddit" minSdkVersion 21 targetSdkVersion 29 - versionCode 25 - versionName "2.0.0" + versionCode 26 + versionName "2.1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { 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); } |