From 5bb9cf789143725c7645ec54ed908ea52a255770 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Mon, 5 Aug 2019 17:44:00 +0800 Subject: Minor bugs related to Custom Tabs fixed. Support more reddit domains. --- app/src/main/java/CustomView/CustomMarkwonView.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app/src/main/java') diff --git a/app/src/main/java/CustomView/CustomMarkwonView.java b/app/src/main/java/CustomView/CustomMarkwonView.java index 50ac4bbf..05c2e2fa 100644 --- a/app/src/main/java/CustomView/CustomMarkwonView.java +++ b/app/src/main/java/CustomView/CustomMarkwonView.java @@ -40,8 +40,11 @@ public class CustomMarkwonView extends MarkwonView { builder.addDefaultShareMenuItem(); builder.setToolbarColor(context.getResources().getColor(R.color.colorPrimary)); CustomTabsIntent customTabsIntent = builder.build(); - customTabsIntent.intent.setPackage(context.getPackageName()); - customTabsIntent.launchUrl(context, Uri.parse(link)); + Uri uri = Uri.parse(link); + if(uri.getHost() != null && uri.getHost().equals("www.reddit.com")) { + customTabsIntent.intent.setPackage(context.getPackageName()); + } + customTabsIntent.launchUrl(context, uri); } }).build(); -- cgit v1.2.3