mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-24 01:48:23 +01:00
Handle sidebar links. Version 2.1.0.
This commit is contained in:
parent
e4ce71bf2a
commit
4d6782107d
@ -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 {
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user