diff options
author | Alex Ning <chineseperson5@gmail.com> | 2019-08-05 02:30:22 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2019-08-05 02:30:22 +0000 |
commit | 0d1fcecde60bbb1eb3b43736807883b12e54b2e8 (patch) | |
tree | d796ee393dfd4ea3c0f09232db38478125459cc6 /app/src/main/java/CustomView/CustomMarkwonView.java | |
parent | 44e2987a848ec07fd866f8ed76bb29c66b03e60a (diff) | |
download | infinity-for-reddit-0d1fcecde60bbb1eb3b43736807883b12e54b2e8.tar infinity-for-reddit-0d1fcecde60bbb1eb3b43736807883b12e54b2e8.tar.gz infinity-for-reddit-0d1fcecde60bbb1eb3b43736807883b12e54b2e8.tar.bz2 infinity-for-reddit-0d1fcecde60bbb1eb3b43736807883b12e54b2e8.tar.lz infinity-for-reddit-0d1fcecde60bbb1eb3b43736807883b12e54b2e8.tar.xz infinity-for-reddit-0d1fcecde60bbb1eb3b43736807883b12e54b2e8.tar.zst infinity-for-reddit-0d1fcecde60bbb1eb3b43736807883b12e54b2e8.zip |
Searching subreddits to post is available. Use Toolbar instead of ActionBar in various activities. Minor bugs fixed.
Diffstat (limited to 'app/src/main/java/CustomView/CustomMarkwonView.java')
-rw-r--r-- | app/src/main/java/CustomView/CustomMarkwonView.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/app/src/main/java/CustomView/CustomMarkwonView.java b/app/src/main/java/CustomView/CustomMarkwonView.java index c0d59f05..50ac4bbf 100644 --- a/app/src/main/java/CustomView/CustomMarkwonView.java +++ b/app/src/main/java/CustomView/CustomMarkwonView.java @@ -24,23 +24,24 @@ public class CustomMarkwonView extends MarkwonView { super(context, attrs); } - public void setMarkdown(@Nullable String markdown, Context conte) { - SpannableConfiguration configuration = SpannableConfiguration.builder(conte).linkResolver((view, link) -> { + public void setMarkdown(@Nullable String markdown, Context context) { + SpannableConfiguration configuration = SpannableConfiguration.builder(context).linkResolver((view, link) -> { if(link.startsWith("/u/") || link.startsWith("u/")) { - Intent intent = new Intent(conte, ViewUserDetailActivity.class); + Intent intent = new Intent(context, ViewUserDetailActivity.class); intent.putExtra(ViewUserDetailActivity.EXTRA_USER_NAME_KEY, link.substring(3)); - conte.startActivity(intent); + context.startActivity(intent); } else if(link.startsWith("/r/") || link.startsWith("r/")) { - Intent intent = new Intent(conte, ViewSubredditDetailActivity.class); + Intent intent = new Intent(context, ViewSubredditDetailActivity.class); intent.putExtra(ViewSubredditDetailActivity.EXTRA_SUBREDDIT_NAME_KEY, link.substring(3)); - conte.startActivity(intent); + context.startActivity(intent); } else { CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder(); // add share action to menu list builder.addDefaultShareMenuItem(); - builder.setToolbarColor(conte.getResources().getColor(R.color.colorPrimary)); + builder.setToolbarColor(context.getResources().getColor(R.color.colorPrimary)); CustomTabsIntent customTabsIntent = builder.build(); - customTabsIntent.launchUrl(conte, Uri.parse(link)); + customTabsIntent.intent.setPackage(context.getPackageName()); + customTabsIntent.launchUrl(context, Uri.parse(link)); } }).build(); |