{"id":18975006,"url":"https://github.com/bufferapp/sociallinkify","last_synced_at":"2025-09-25T21:31:39.850Z","repository":{"id":79937328,"uuid":"122184367","full_name":"bufferapp/SocialLinkify","owner":"bufferapp","description":"An Android library for linking @ mentions \u0026 Hashtags to their corresponding social network","archived":false,"fork":false,"pushed_at":"2024-07-17T12:55:17.000Z","size":229,"stargazers_count":66,"open_issues_count":0,"forks_count":3,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-01-09T18:37:32.996Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bufferapp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-20T10:32:21.000Z","updated_at":"2024-08-20T11:00:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"91e062bf-42d8-4053-ba34-d2f3be6942fb","html_url":"https://github.com/bufferapp/SocialLinkify","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufferapp%2FSocialLinkify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufferapp%2FSocialLinkify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufferapp%2FSocialLinkify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufferapp%2FSocialLinkify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bufferapp","download_url":"https://codeload.github.com/bufferapp/SocialLinkify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234257205,"owners_count":18803955,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T15:16:57.236Z","updated_at":"2025-09-25T21:31:34.568Z","avatar_url":"https://github.com/bufferapp.png","language":"Kotlin","readme":"# SocialLinkify\nAn Android library for linking @ mentions \u0026amp; Hashtags to their corresponding social network\n\n# Motivation\n\nFor most of our projects we handle multiple social network types, which results in us needing to\nhandle multiple link destinations for @ mentions and Hashtags. For example, if the @Buffer mention\nis used then this library will allow you to make that a clickable span pointing to either the Buffer Twitter profile,\nFacebook Page or Instagram profile. The same can be done for Hashtags. Rather than duplicate code across\nour projects we decided to create a small helper library to separate this from our projects.\n\n# How to use\n\nThere is only one function to call from SocialLinkify, that is [socialLinkifyText()](https://github.com/bufferapp/SocialLinkify/blob/task/open-source-project/lib/src/main/java/org/buffer/sociallinkify/SocialLinkify.kt#L32). This will return\nyou an instance of a Spannable which you can then use to set your textview content to. This function\ntakes four parameters:\n\n- `color` - An Int representing the color you wish to use for linked elements\n\n- `text` - The String that you wish to apply linking to\n\n- `socialNetwork` - The [SocialNetwork](https://github.com/bufferapp/SocialLinkify/blob/task/open-source-project/lib/src/main/java/org/buffer/sociallinkify/model/SocialNetwork.kt) which you want the elements to be linked to. This can be either\n`TWITTER`, `FACEBOOK` or `INSTAGRAM`.\n\n- `patternTypes` - A varargs parameter for the [PatternType](https://github.com/bufferapp/SocialLinkify/blob/task/open-source-project/lib/src/main/java/org/buffer/sociallinkify/model/PatternType.kt) patterns that you want to be recognised, this can be\nany collection of `HASHTAG`, `MENTION` and `URL`.\n\nFor example, if I want to create linked spans for Twitter @ mentions, Hashtags \u0026 URLs:\n\n``` java\ntext_message.text = SocialLinkify.socialLinkifyText(\n        ContextCompat.getColor(context, R.color.some_color), message.text,\n        SocialNetwork.TWITTER, PatternType.HASHTAG, PatternType.MENTION, PatternType.URL)\n```\n\nor if I want to create linked spans for Instagram @ mentions only:\n\n``` java\ntext_message.text = SocialLinkify.socialLinkifyText(\n        ContextCompat.getColor(context, R.color.some_color), message.text,\n        SocialNetwork.INSTAGRAM, PatternType.MENTION)\n```\n\nor if I just want to create linked spans for Facebook hashtags:\n\n``` java\ntext_message.text = SocialLinkify.socialLinkifyText(\n        ContextCompat.getColor(context, R.color.some_color), message.text,\n        SocialNetwork.FACEBOOK, PatternType.HASHTAG)\n```\n\nThe SocialNetwork class also has a handy [fromString()](https://github.com/bufferapp/SocialLinkify/blob/task/open-source-project/lib/src/main/java/org/buffer/sociallinkify/model/SocialNetwork.kt#L7) function to allow you to retrieve a SocialNetwork\ninstance from some string that may be used in your app such as \"twitter\".\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbufferapp%2Fsociallinkify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbufferapp%2Fsociallinkify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbufferapp%2Fsociallinkify/lists"}