diff options
author | Alex Ning <chineseperson5@gmail.com> | 2019-08-05 09:44:00 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2019-08-05 09:44:00 +0000 |
commit | 5bb9cf789143725c7645ec54ed908ea52a255770 (patch) | |
tree | 109303a6a6704fcf37424ac2211b98006abe6038 /app/src/main/java | |
parent | 7761d3875673e65cfb6d0cb496a781a9ee8f2db3 (diff) | |
download | infinity-for-reddit-5bb9cf789143725c7645ec54ed908ea52a255770.tar infinity-for-reddit-5bb9cf789143725c7645ec54ed908ea52a255770.tar.gz infinity-for-reddit-5bb9cf789143725c7645ec54ed908ea52a255770.tar.bz2 infinity-for-reddit-5bb9cf789143725c7645ec54ed908ea52a255770.tar.lz infinity-for-reddit-5bb9cf789143725c7645ec54ed908ea52a255770.tar.xz infinity-for-reddit-5bb9cf789143725c7645ec54ed908ea52a255770.tar.zst infinity-for-reddit-5bb9cf789143725c7645ec54ed908ea52a255770.zip |
Minor bugs related to Custom Tabs fixed. Support more reddit domains.
Diffstat (limited to '')
-rw-r--r-- | app/src/main/java/CustomView/CustomMarkwonView.java | 7 |
1 files changed, 5 insertions, 2 deletions
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(); |