mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-29 04:17:12 +01:00
Support redd.it links.
This commit is contained in:
parent
d6dd171ac4
commit
420e9518bc
@ -37,6 +37,7 @@ public class LinkResolverActivity extends AppCompatActivity {
|
|||||||
private static final String USER_PATTERN_2 = "/[uU]/\\w+/{0,1}";
|
private static final String USER_PATTERN_2 = "/[uU]/\\w+/{0,1}";
|
||||||
private static final String SIDEBAR_PATTERN = "/[rR]/\\w+/about/sidebar";
|
private static final String SIDEBAR_PATTERN = "/[rR]/\\w+/about/sidebar";
|
||||||
private static final String MULTIREDDIT_PATTERN = "/user/\\w+/m/\\w+/{0,1}";
|
private static final String MULTIREDDIT_PATTERN = "/user/\\w+/m/\\w+/{0,1}";
|
||||||
|
private static final String REDD_IT_POST_PATTERN = "/\\w+/{0,1}";
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@Named("default")
|
@Named("default")
|
||||||
@ -130,7 +131,12 @@ public class LinkResolverActivity extends AppCompatActivity {
|
|||||||
Intent intent = new Intent(this, ViewMultiRedditDetailActivity.class);
|
Intent intent = new Intent(this, ViewMultiRedditDetailActivity.class);
|
||||||
intent.putExtra(ViewMultiRedditDetailActivity.EXTRA_MULTIREDDIT_PATH, path);
|
intent.putExtra(ViewMultiRedditDetailActivity.EXTRA_MULTIREDDIT_PATH, path);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
} else {
|
} else if (path.matches(REDD_IT_POST_PATTERN)) {
|
||||||
|
Intent intent = new Intent(this, ViewPostDetailActivity.class);
|
||||||
|
intent.putExtra(ViewPostDetailActivity.EXTRA_POST_ID, path.substring(1));
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
else {
|
||||||
deepLinkError(uri);
|
deepLinkError(uri);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user