mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-30 21:07:11 +01:00
Update link handling for amp and v.redd.it
Added manifest entries for google.com amp links (reddit only) and v.redd.it. Updated handling of google amp links in LinkResolverActivity.
This commit is contained in:
parent
d6c3bfddd7
commit
1fb3ba6e3f
@ -276,6 +276,13 @@
|
|||||||
<data
|
<data
|
||||||
android:host="reddit.com"
|
android:host="reddit.com"
|
||||||
android:scheme="https" />
|
android:scheme="https" />
|
||||||
|
<data
|
||||||
|
android:host="www.google.com"
|
||||||
|
android:scheme="https"
|
||||||
|
android:pathPattern="/amp/s/amp.reddit.com/.*"/>
|
||||||
|
<data
|
||||||
|
android:host="v.redd.it"
|
||||||
|
android:scheme="https" />
|
||||||
<data
|
<data
|
||||||
android:host="amp.reddit.com"
|
android:host="amp.reddit.com"
|
||||||
android:scheme="https" />
|
android:scheme="https" />
|
||||||
|
@ -50,6 +50,7 @@ public class LinkResolverActivity extends AppCompatActivity {
|
|||||||
private static final String IMGUR_IMAGE_PATTERN = "/\\w+/?";
|
private static final String IMGUR_IMAGE_PATTERN = "/\\w+/?";
|
||||||
private static final String RPAN_BROADCAST_PATTERN = "/rpan/r/[\\w-]+/\\w+/?\\w+/?";
|
private static final String RPAN_BROADCAST_PATTERN = "/rpan/r/[\\w-]+/\\w+/?\\w+/?";
|
||||||
private static final String WIKI_PATTERN = "/[rR]/[\\w-]+/(wiki|w)/?\\w+";
|
private static final String WIKI_PATTERN = "/[rR]/[\\w-]+/(wiki|w)/?\\w+";
|
||||||
|
private static final String GOOGLE_AMP_PATTERN = "/amp/s/amp.reddit.com/.*";
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@Named("default")
|
@Named("default")
|
||||||
@ -266,6 +267,13 @@ public class LinkResolverActivity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
deepLinkError(uri);
|
deepLinkError(uri);
|
||||||
}
|
}
|
||||||
|
} else if (authority.contains("google.com") ){
|
||||||
|
if ( path.matches(GOOGLE_AMP_PATTERN) ) {
|
||||||
|
String url = path.substring(11, path.length()); // skipping past amp straight to reddit
|
||||||
|
handleUri(Uri.parse("https://" + url));
|
||||||
|
} else {
|
||||||
|
deepLinkError(uri);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
deepLinkError(uri);
|
deepLinkError(uri);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user