Support one more image domain. Have not validate the link yet.

This commit is contained in:
Alex Ning 2021-07-21 22:40:03 +08:00
parent 3eb608888b
commit 63e27eb23a

View File

@ -118,7 +118,11 @@ public class LinkResolverActivity extends AppCompatActivity {
List<String> segments = uri.getPathSegments(); List<String> segments = uri.getPathSegments();
if (authority != null) { if (authority != null) {
if (authority.equals("v.redd.it")) { if (authority.equals("reddit-uploaded-media.s3-accelerate.amazonaws.com")) {
Intent intent = new Intent(this, ViewImageOrGifActivity.class);
intent.putExtra(ViewImageOrGifActivity.EXTRA_IMAGE_URL_KEY, uri.toString());
startActivity(intent);
} else if (authority.equals("v.redd.it")) {
Intent intent = new Intent(this, ViewVideoActivity.class); Intent intent = new Intent(this, ViewVideoActivity.class);
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_V_REDD_IT); intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_V_REDD_IT);
intent.putExtra(ViewVideoActivity.EXTRA_V_REDD_IT_URL, uri.toString()); intent.putExtra(ViewVideoActivity.EXTRA_V_REDD_IT_URL, uri.toString());